-->
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.  [ 6 posts ] 
Author Message
 Post subject: <timestamp> with oracle
PostPosted: Sun Sep 25, 2005 9:21 pm 
Newbie

Joined: Sun Sep 25, 2005 8:59 pm
Posts: 3
In part of a hibernate hbm.xml file I have the following defined:

...
<class name="com.mycompany.Employee" table="EMPLOYEE">
<id name="id" type="int" column="EMPLOYEE_ID">
<meta attribute="scope-set">protected</meta>

<generator class="native" />
</id>

<timestamp name="DOB" />
...

I'm using the hbm2dll SchemaExport task against an oracle database(9i).
I'm expecting a timestamp column to be created for DOB in the database. Instead I get a Date column. What's wrong?

The only way I can get a timestamp column type to be created is if I do something like the following:
<property name="Birthdate" type="timestamp">
<column name="DOB" sql-type="timestamp" />
</property>

...which is not desirable


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 25, 2005 11:51 pm 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
property/column elements were designed for fields like "DOB" . timestamp element was designed for version checking .

Why is property/column undesireable ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 12:03 am 
Newbie

Joined: Sun Sep 25, 2005 8:59 pm
Posts: 3
Perhaps the example is getting in the way of the question.. In my real application I use a timestamp column for versioning. Shouldn't it work anyway?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 2:22 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Cant say. So ... Why is property/column undesireable ? ;)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 2:26 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
Have you tried <version>?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 27, 2005 5:46 pm 
Newbie

Joined: Sun Sep 25, 2005 8:59 pm
Posts: 3
dennisbyrne wrote:
Cant say. So ... Why is property/column undesireable ? ;)


My hibernate object doesn't have this field. It inherits it from an abstract class.


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