-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Calendar Object in the Where clause fails....
PostPosted: Thu Aug 25, 2005 5:56 pm 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
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:


Top
 Profile  
 
 Post subject: fails?
PostPosted: Thu Aug 25, 2005 7:04 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
That might be about milliseconds in the calendar. Did you try to nullify them?

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.