Hi,
When using a String enum in a table, the lengh of the generated @Column is not defined, resulting in using the default which is 255.
From a performance point of view this is not optimal as JDBC drivers usually allocate the memory based on the max length of the fields. So if we have a few enums that can waste memory.
It would be nice to have the generation code that takes the maximum length of the enum ID string to define the length of the fields in the @Column annotation (and if the length of the IDs are extended/reduced , propose to update the field length of all entities that reference that Enum.) - that would be the optimal solution in my opinion.
If too much work, it would be great that, if I change the length manually, Studio does not remove it every time I touch the table definition.
In this example, leg is an enumeration of type string with only one character - so I added manually the length (it is not generated)
@Column(name = "LEG", nullable = false, length = 1)
@NotNull
private String leg;
if I change the table (any change to the entity removes the length I explicitly set).
This is quite a burden as every time I need to restore the length (otherwise the schema is changed)
Thanks!