Hi!
I started using hibernate v3.2 a few weeks ago.
About the mapping files I learned, that non-mandatory attributes usually take some sane value automaticly.
But <key column... is not like that.
From testing I learned (the
docs don't say anything) that the default value for column name is "id".
Off course "id" is a very common name, mostly used for the primary key column, so a <key> with no explicit column name would conflict with it.
Whats worse, the hbm2ddl (from Hibernate Tools v3.2 beta 8) does not detect this. Neither does new Configuration().configure().buildSessionFactory(). It only fails when an object is persisted, because the DB complains about the mixed up FK constraints.
So please either :
- document this behavior
- change <key column=> to use some good default value
- enlighten me why this is good as is :-)
Regards,
David