The configuration of Hibernate3 and data sources supported by EJB3.0 in jboss4
JBoss EJB3.0 is built above Hibernate 3.0. Configuring a data source Your entity bean needs to create a hibernate. Properties profile. There is a default hibernate configuration file EJB3.Deployer / meta-inf / hibernate.properties under the EJB 3.0 deployment package.
Please refer to the document we came with Hibernate 3.0 to learn how to configure each value in the hibernate.properties file. I only do some instructions here.
Hibernate.Transaction.Manager_lookup_class = org.hibernate.transaction.jbosstransactionManagerLookup
Hibernate.hbm2ddl.auto = crete-drop
Hibernate.cache.provider_class = org.hibernate.cache.hashtablecacheProvider
Hibernate.Connection.DataSource = Java: / Defaultds
Hibernate.diaract = org.hibernate.dialect.hsqldiaforct
The above is the default configuration file for EJB3.Deployer / meta-inf / hibernate.properties under EJB3.0 applications.
Hibernate.Connection.DataSource points to JNDi names to jboss data sources
Hibernate.diact The default is Hypersonic SQL, but you can change to other database dialects such as Oracle. You can refer to the Hibernate 3.0 documentation.
Hibernate.hbm2ddl.auto = CREATE-DROP Establish a database chart in the deployment and deletes them when unsitial.
Hibernate.Transaction.manager_lookup_class defines Hibernates' transaction management. It generally cannot change.
Hibernate.cache.provider_class defines the cache structure that Hibernate will use. If you use you in the cluster, you may consider JBoss's cache.
Each deployed hibernate.properties file
You may need to replace the default hibernate.properties file. Then use the variable mentioned above to define a minimum configuration to create a handy hibernate.properties file. Then put the file on the meta-INF / under Meta-INF / or Incentures under theejb3 jar directory.