simple singularities

hibernate default value

Filed under: java, programming — fri13th May 22, 2007 @ 11:09 am

i found some trouble in hibernate, last night. hibernate annotation doesn’t support default value explicitly. you can use by implementing UserType interface. but, you know it’s not an annotation at all. there’s two workarounds to avoid this situation. first is making tables and model classes manually. use alter or create you know, this isn’t annotation but it doesn’t conflict annotation nor clumsy. 2nd is columnDefinition. this is an annotation and non-portable way to definite table. i don’t want to recommend it, either.

i choosed the first, manual way to solve my problem. but it’s very unpleasant to use non-authentic way when implementing basic functions. hibernate supports so many sql dbs. for that reason, basically hibernate provides minimum set of functions. and when you want more, there’s no way but to use workarounds.. and you know, workarounds are not documented well.. it’s a some kind of tragic..

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment