Migrate HAR hibernate archive to AS7
redmond007 Aug 17, 2011 5:09 PMI'm migrating an application packaged as a HAR hibernate archive from JBoss AS5 to AS7. I have a number of questions, and I know I have a number of hurdles I have to face in order to migrate my application successfully. I don't mind researching things on my own - but at this point I'm not quite sure what is possible, or the direction I should take and would appreciate any pointers or comments.
I know that JBoss AS7 does not support HAR hibernate archives - so I have to make some sort of changes in order to get this to work. My app requires hibernate3, which I include as a dependency. My HAR is structured like
HAR
|
|-com
| |-business classes
| |-*class files and *hbm.xml files
|
|-META-INF
|-hibernate.xml
My hibernate.xml file looks like
<hibernate-configuration xmlns="urn:jboss:hibernate-deployer:1.0">
<session-factory name="java:/hibernate/SessionFactory" bean="jboss.har:service=Hibernate">
<property name="datasourceName">java:/MySqlDS</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- <property name="sessionFactoryInterceptor">org.jboss.test.hibernate.SimpleInterceptor</property> -->
<!-- <property name="hbm2ddlAuto">create</property> -->
<depends>jboss:service=Naming</depends>
<depends>jboss:service=TransactionManager</depends>
</session-factory>
</hibernate-configuration>
I'm attaching a business class included in my HAR, along with its associated *hbm.xml file. We are using *hbm.xml files in our HAR to define entities, and not the newer style of hibernate annotations. A couple of questions I have are:
-is there a way I can just package my HAR as a JAR and use it inside of AS7 without having to go through the trouble of rewrite my business classes to use annotations to define entities instead of using *hbm.xml files?
-if not is there a guide somewhere about converting your code to use hibernate annotations and persistence.xml? I don't mind doing research but right now I'm not sure what I should be researching.
-
MyClass.java.zip 928 bytes
-
MyClass.hbm.xml 2.2 KB
-
hibernate.xml 648 bytes