hbm.xml files are used by hibernate for the ORM (Object Relational Mapping).
In squale the hbm.xml files are generated by using comments (xdoclet2) put in the business objects. So don't modify directly the hbm files but the xdoclet comments in the business objects class.
For create the hbm.xml files launch the target "java2hbm" of the ant file (build.xml in squale-core/_to-handle_). You will find all the hbm.xml file create in the directory : squale-core/target/generated-hbm.
Be careful Xdoclet2 is inconsistent with java Enum. So you should exclude the Enum class in the java2hbm task
You should :
Now squale will use this new hbm.xml files.
All the scripts which concern the database creation / modification are in the project squale-database. You have a list of script for each kind of database (Oracle, MySQL, ...)
squale-core | |-- mysql | |-- creation-scripts | | |-- 01-databaseCreation.sql | | |-- 02-setDefaultValues.sql | | `-- 03-initSquale.sql | | | `-- migration-scripts | |-- current-migration-script.sql | |-- N-1toN_script | | `-- N-1toN-migration-script.sql | |-- mysql | |-- creation-scripts | | |-- 01-databaseCreation.sql | | |-- 02-setDefaultValues.sql | | `-- 03-initSquale.sql | | | `-- migration-scripts | |-- current-migration-script.sql | |-- N-1toN_script | | `-- N-1toN-migration-script.sql
If you change the hbm files the database creation script (01-databaseCreation.sql) and the current-migration-script.sql will also change.
For create the new script
For Oracle :
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
For MySQL :
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
For create the script the ant task use the hbm.xml files which are in squale-core/src/main/java/ressources/mapping. So in a same ant launch we can't create the new hbm file and the new script.
Write in this file the good sql instruction in order to pass from the old database to the new database.