I want to save an object in data base.
I'm using MySQL data base, but when I try it I get an exception that says: "data is bigger than Column length".
How can I increase the length of my column using hibernate?
Thanks. Best Regards. A TEXT column with a maximum length of 16,777,215 (2 24 âˆ' 1) characters. The effective maximum length is less if the value contains multibyte characters.
The length of the roadway occupied by a column or a convoy in movement. See also road space. Dictionary of Military and Associated Terms.
The @Lob annotation specifies that the database should store the property as Large Object. The columnDefinition in the @Column annotation defines the column type for the property. Since we're going to save byte array, we're using BLOB.
It is flagged with a few standard validation annotations: @Size(min=2, max=30) : Allows names between 2 and 30 characters long. @NotNull : Does not allow a null value, which is what Spring MVC generates if the entry is empty.
if your column is varchar
use annotation length
@Column(length = 255)
or use another column type
@Column(columnDefinition="TEXT")
@Column(name = Columns.COLUMN_NAME, columnDefinition = "NVARCHAR(MAX)")
max
indicates that the maximum storage size is 2^31-1 bytes (2 GB)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With