Hibernate pluralization
Posted
by matiasf
on Stack Overflow
See other posts from Stack Overflow
or by matiasf
Published on 2010-02-16T17:30:06Z
Indexed on
2010/05/01
0:57 UTC
Read the original article
Hit count: 234
I have
- A MySQL database currently in production use for a CakePHP application
- A Java SE application accessing the same database via Hibernate, currently in development.
I'm using the Netbeans "automigrate" feature to create the POJO classes and XML files (do I really need the XML files when using annotations?). As the schema is quite complex creating the tables manually is way too much work.
Cake expects all DB tables to be pluralized (the Address class is automagically mapped to the addresses table). When running the Netbeans automigration it then does pluralization on the already pluralized table names (I'm getting Addresses.java and setAddresseses() methods).
I know I'm asking for trouble running two very different data layers against the same database, but I'd like to know if it's possible to have Netbeans generating the POJO classes in singular form or if there is another (better) way to manage this.
© Stack Overflow or respective owner