Download User Manual
Transcript
User Manual 5.4 Configure the Hibernate The configuration of hibernate in Jimys is done using 2 files: - hibernate.cfg.xml : Hibernate configuration - mapping.hbm.xml : Database mapping file hibernate.cfg.xml Different properties must be specified in this configuration file. All the information is related to the configuration of hibernate and the database. No mapping information should be specified in this file. • • • • • session-factory name o The JNDI name of the session factory which is used to bind it in the JNDI tree. connection.datasource o The JNDI datasource name. This name is the datasource name of the database configured in JOnAS. Default : jdbc_1 Dialect o The SQL dialect to use. Please see the hibernate documentation for a complete list of valid values. (For example : “org.hibernate.dialect.PostgreSQLDialect”) show_sql o Show the executed SQL strings at runtime. mapping resource o The mapping file name to use. mapping.hbm.xml The mapping of all the java beans is done in this file. You should not modify this file! But it depends on how the database analyzes the SQL string. The tables are created by the cmp2 beans the first time. Now it is possible that the database interprets the SQL string case sensitive. So it is possible that you have to see the table names after creation with a database tool and change the table names in the mapping.hbm.xml file. jimys_usermanual1.0.13.doc - 23 - 20/10/05