Hi, I read a lot of topics about setting default values for not nullable columns.
A lot of discussions but not a final "best" solution...
I'm working with Hibernate annotations and I know that "default" option is not supported; somebody says a solution is an interceptor (?), in hibernate sites the proposal is "UserType".
I think this could be a good solution, even if it seems I have to implement a "DefaultIntegerType", another "DefaultDateType", a "DefaultStringType" and so on... I'm right?
Moreover it seems I can't declare my entity with dynamic-insert, because my user type would not be involved.
At last, what is the better solution for fields like "lastUpdateDate" (..not versioning timestamp); I could use another usertype that automatically fill this field with the current date before persist... but, as before, I can't declare my entity with dynamic-update. I'm right?
Please, give me a solution...
Regards,
Fabio
|