herminator wrote:
1. use increment as generator,
besides "increment" being the *worst* id generator to choose then if you want it for *all* keys then the reveng class is the best option.
Quote:
2. use int for the id's (not Integer) and
depends on your db, but two choices:
1) implement columnToHibernateTypeName to return java.lang.Integer for the relevant columns
2) use a type-mapping that redefines it for all classes of integer columns you are using
Quote:
3. use equals() and hash() function
automatically for all entities.
You do know this is dangerous, right ? :)
in any case, only currently possible by putting <meta> into the templates.
Quote:
- for 3.: <meta attribute="use-in-equals">true</meta> in XXX.hbm.xml has no effect when using the reveng.xml. Why?
huh? hbm.xml is not read then using reverse engineering so how should they have effect ? the hbm.xml is just generated.
If you want to generate pojo based on the generated hbm.xml's then do it in 2 steps.
Quote:
- The hibernate.jar does not contain the DelegatingReverseEngineeringStrategy-class. Where can I get it?
its in hibernate-tools.jar, see docs for where it is.