-->
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.  [ 3 posts ] 
Author Message
 Post subject: Oracle Interval Datatype
PostPosted: Mon Aug 29, 2005 3:52 pm 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
How do i map Interval datatype in Hibernate Mapping.
I encountered errors if i use long or string.

Any thoughts are highly appreciated.

Hibernate version:
3.01.
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 29, 2005 4:45 pm 
Regular
Regular

Joined: Thu Apr 21, 2005 9:05 am
Posts: 50
Location: Boston, U.S
Only String works, rest of them does not work.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 3:33 pm 
Senior
Senior

Joined: Wed Sep 24, 2003 3:01 pm
Posts: 158
Location: Bragan�a Paulista - Brasil
Hi,

I´m using Hibernate 2.1.4 with Oracle 9.

I´m trying to use Interval data type, and I create a TO com String
data type attribute to represents the interval, like this:

Code:

Class:

public class OsTO implements Serializable
{
   private Long id;
   
   private Calendar nextExecutionDate;
   
   private String executionDsFrequency;
   
   private String executionYmFrequency;
.
.
.
}

Mapping file:

<hibernate-mapping>
    <class name="ta.j2ee.sitename.model.to.OsTO" table="os_test">
        <id name="id" column="os_id">
         <generator class="assigned"/>
      </id>   
        <property name="nextExecutionDate" column="NEXT_EXECUTION_DT"/>       
        <property name="executionDsFrequency" column="EXECUTION_DS_FREQ"/>       
        <property name="executionYmFrequency" column="EXECUTION_YM_FREQ"/>
    </class>   
</hibernate-mapping>



The table is like this:

Code:
Nome                                      Nulo?    Tipo
----------------------------------------- -------- ----------------------------
OS_ID                                              NUMBER(10)
NEXT_EXECUTION_DT                                  DATE
EXECUTION_DS_FREQ                                  INTERVAL DAY(2) TO SECOND(6)
EXECUTION_YM_FREQ                                  INTERVAL YEAR(2) TO MONTH



What do I must to do to mapping Intervals?

thanx!!!!

_________________
Tads


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.