here are my mapping files, working fine with postgresql, so normally I just need to change datasource in Tomcat configuration...
hibernateWorkplan.hbm.xml :
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.datasource">java:comp/env/jdbc/workplan</property>
<property name="show_sql">false</property>
<property name="jdbc.batch_size">10</property>
<!-- Mapping files -->
<mapping resource="fr/ordimoule/portail/hibernate/Client.hbm.xml" />
<mapping resource="fr/ordimoule/portail/hibernate/Contact.hbm.xml" />
</session-factory>
</hibernate-configuration>
Client.hbm.xml :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="fr.ordimoule.portail.commercial.Client" table="tMA008">
<id name="numeroClient" type="string">
<column name="ccli010" sql-type="char(10)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="nomClient" type="string">
<column name="ccli040" sql-type="char(40)" not-null="true"/>
</property>
</class>
</hibernate-mapping>
Contact.hbm.xml :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="fr.ordimoule.portail.commercial.Contact" table="contact">
<id name="numeroContact" type="string">
<column name="id" sql-type="char(10)" not-null="true"/>
<generator class="uuid.hex"/>
</id>
<property name="nomContact" type="string">
<column name="nomcontact" sql-type="char(30)" not-null="true"/>
</property>
<property name="numeroClient" type="string">
<column name="numeroclient" sql-type="char(10)" not-null="true"/>
</property>
</class>
</hibernate-mapping>