Hello,
I'm using Hibernate 2.12 with J2EE and Oracle 9i. The problem I'm experiencing is that inserts and deletes to my db work, but updates don't.
--The JUnit test file
Code:
public void testDirectionsInsert()
{
drData.setDirectionsName("Destin");
drData.setDirections("Go to 77 Seascape Boulevard.");
drData.setUserId(new Integer(2));
drDAO.insert(drData);
}
public void testDirectionsUpdate()
{
DirectionsData tmp = drDAO.findDirectionsByDirectionsId(new Long(4));
drData.setDirectionsName("Destin - Majestic Sun");
drDAO.update(tmp);
}
public void testDirectionsDelete()
{
DirectionsData tmp = (DirectionsData) drDAO.findDirectionsByDirectionsId(7);
}
--The body of the update method called above:
Code:
trans = session.beginTransaction();
session.update(o);
session.flush();
trans.commit();
--And finally, the hbm.xml
Code:
<hibernate-mapping package="com.cendant.trg.getaways.model">
<class name="DirectionsData" table="directions">
<id name="directionsId" column="directions_id">
<generator class="sequence">
<param name="sequence">directions_id_sq</param>
</generator>
</id>
<property name="directionsName" column="directions_name"/>
<property name="directions" column="directions"/>
<property name="userId" column="user_id"/>
<property name="dateModified" column="date_modified"/>
</class>
</hibernate-mapping>
Please help! I don't get any errors. It just doesn't work.
Thanks!!