hibernate xml mapping file does not support default value. So when i try to create a column with default value in mysql, then i run the hibernate save() method without setting the column value. the default value cannot be generated.
i have done some search. according to this post: https://forums.hibernate.org/viewtopic.php?t=171&highlight=default+value&sid=84a014fd93dd9b680afc606f616ca4f6 it said hibernate does not support default value. we can use trigger instead.
Any way we can do this except trigger? and how can we do this by trigger
OK i try to do more search i find the answer:
ibernate does not support default values, you should either manager this using database triggers or assign default values in your domain.
But if i assign default values in my domain, said in constructer, do we have any drawback?
thx!