My mapping file is and we are using :-
Code:
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
and sample code to update records is
-------------------------------------------------------------
Code:
aUser.setLastUpdtById(sysUser);
aUserDAO.update(aUser, session);
session.flush();
---------------------------------------------------
Quote:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">
jdbc/oracle/cmis
</property>
<!-- Database Settings -->
<property name="hibernate.dialect">
net.sf.hibernate.dialect.Oracle9Dialect
</property>
<property name="hibernate.jdbc.batch_versioned_data">false</property>
<property name="hibernate.jdbc.batch_size">0</property>
<property name="hibernate.default_schema">ADMN</property>
<property name="hibernate.show_sql">true</property>
<!-- Transaction Settings -->
<property name="hibernate.transaction.manager_lookup_class">
net.sf.hibernate.transaction.WebSphereTransactionManagerLookup
</property>
<property name="hibernate.transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<!-- Session Factory Settings -->
<property name="hibernate.session_factory_name">
HibernateSessionFactory
</property>
<!-- Mapping Files - audt_admn schema -->
<mapping resource="xxx/xxx/xxx/audit/domain/AudtHdr.hbm.xml" />
</session-factory>
</hibernate-configuration>
Here is my mapping file for class.
--------------------------------------------------------
Quote:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM
"hibernate-mapping-2.0.dtd" >
<hibernate-mapping>
<!--
Created by the Middlegen Hibernate plugin
http://boss.bekk.no/boss/middlegen/http://hibernate.sourceforge.net/-->
<class name="xxx.xxx.xxx.scrty.domain.ScrtyUser" table="SCRTY_USER" schema="SCRTY_ADMN">
<composite-id>
<key-property name="userId" column="USER_ID" type="java.lang.String" length="8" />
<key-property name="user1stName" column="USER_1ST_NAME" type="java.lang.String" length="30" />
<key-property name="userLastName" column="USER_LAST_NAME" type="java.lang.String" length="30" />
<key-property name="stusCd" column="STUS_CD" type="java.lang.String" length="1" />
<key-property name="stusDt" column="STUS_DT" type="java.sql.Timestamp" length="7" />
<key-property name="lastUpdtDt" column="LAST_UPDT_DT" type="java.sql.Timestamp" length="7" />
<key-property name="lastUpdtById" column="LAST_UPDT_BY_ID" type="java.lang.String" length="8" />
<key-property name="invldPwCnt" column="INVLD_PW_CNT" type="java.lang.Integer" length="2" />
<key-property name="lockNum" column="LOCK_NUM" type="java.lang.Long" length="16" />
<key-property name="id" column="ID" type="java.lang.Long" length="14" />
</composite-id>
<!-- associations -->
</class>
</hibernate-mapping>