You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to setup ORMLite with different kinds of databases, where some huge JSON strings should get persisted into.
When using MySQL, the solution to those long strings (for me) was to set the columnDefinition to LONGTEXT, where as for Postgres, this value LONGTEXT is invalid. This is of cause just a very special edge case, however, there may exist alot of other use cases, where it is necessary to overwrite the DatabaseField annotation values for different database types, e.g. if one needs to specify a different persister/datatype.
Maybe there should be a built in way, to overwrite the DatabaseField annotation data, as well as the one from javax.persistance equivalents for different types of database?
Because I needed this feature in my project, here is my own solution for others having the same need:
Note that its needed to may call methods of ORMLite always with this configuration, since the configuration may get cached. Figured out because I tried to call TableUtils.dropTable(conn, MyEntity.class) before using OverloadableDatabaseTableConfig.
The text was updated successfully, but these errors were encountered:
I tried to setup ORMLite with different kinds of databases, where some huge JSON strings should get persisted into.
When using MySQL, the solution to those long strings (for me) was to set the columnDefinition to
LONGTEXT
, where as for Postgres, this valueLONGTEXT
is invalid. This is of cause just a very special edge case, however, there may exist alot of other use cases, where it is necessary to overwrite the DatabaseField annotation values for different database types, e.g. if one needs to specify a different persister/datatype.Maybe there should be a built in way, to overwrite the DatabaseField annotation data, as well as the one from javax.persistance equivalents for different types of database?
Because I needed this feature in my project, here is my own solution for others having the same need:
Example usage
Annotations
Custom config "processor"
Example setup
Note that its needed to may call methods of ORMLite always with this configuration, since the configuration may get cached. Figured out because I tried to call
TableUtils.dropTable(conn, MyEntity.class)
before usingOverloadableDatabaseTableConfig
.The text was updated successfully, but these errors were encountered: