all,
i am starting a new project with new db schema, no legacy data. i have two choices on how to keep hbm mapping files and java class files in sync:
1) write all the hibernate mappings in hbm file and generate Java class files using hbm2java. if i need customized behavior, i can always subclass the generated java class. (it will look like this: foo.hbm.xml -> FooBase.java -> Foo.java, where FooBase.java is generated by hbm2java and any customization goes into Foo.java which extends FooBase.java)
2) write the Java class myself and then use XDoclet to generate mapping files. my experience with XDoclet (working with hibernate and other technologies) has been that it may not be able to provide all the features. so i am a little bit hesitant.
would you share your experience? pros and cons? many thanks.
|