I am triying to update a table whose primary keys are number and date.
In the Mapping object i have the respective values as long and Calendar.
The update fails because of the Calendar object. The update works fine if i remove Calendar Data type attribute from the mapping file.
I REALLY DONT KNOW WHY I ENCOUNTER THIS PROBLEM, I TRIED WITH THE SAME SET OF VALUES FOR INSERT AND UPDATE BUT THE UPDATE ALWAYS FAILS.
Hibernate version:
3.0.1
Mapping documents:
<composite-id>
<key-property name="productId" type="long" column="PRDCT_ID"/>
<key-property name="startDateAndTime" type="calendar" column="USE_START_DTME"/>
</composite-id>
Code between sessionFactory.openSession() and session.close():
Calendar cal = Calendar.getInstance();
cal.set(2005,Calendar.AUGUST,25,9,9,9);
ProductId productId = new ProductId();
productId.setProductId(new Long("84"));
VO vo = new VO();
vo.setStartDateAndTime(cal);
session.save(vo)
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 10g
The generated SQL (show_sql=true):
update PRDCT_INV set OFF_MKT_QTY=?, BASE_QTY=?, MIN_LOS=?, OUT_OF_ORDER_QTY=?, VIRTUAL_SOLD_QTY=?, USE_END_DTME=?, OVRBKD_QTY=?, INV_STS_CD=?, SOLD_QTY=?, STS_CHNG_REASON_CD=?, VIRTUAL_BASE_QTY=?, PREV_STS_CD=? where PRDCT_ID=? and USE_START_DTME=?
Debug level Hibernate log excerpt:
|