-->
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: hbm2ddl - oracle - timestamp
PostPosted: Wed Apr 04, 2007 10:43 am 
Newbie

Joined: Thu Jul 20, 2006 6:25 pm
Posts: 6
I have hibernate annotations in my code, and use hbm2ddl to generate schema for a couple of different hibernate dialects. I have some fields annotated as

/**
* End time of the task
* @return
*/
@Temporal(TemporalType.TIMESTAMP)
public Date getEndTime() {
return endTime_;
}

I would expect this to map to the oracle TIMESTAMP, but I get
create table ... ( ... startTime date, ...

This code generates a "timestamp" for hsqldb and a "datetime" for ms-sql.

I'm using the hibernate-tools.jar from
hibernate-tools/plugins/org.hibernate.eclipse_3.2.0.beta9a

Is this a bug or am I misinterpreting something? Is there a newer release of the tools?

_________________
Nate Franzen


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 1:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
My guess is that you are using OracleDialect instead of Oracle9Dialect.

Oracle9Dialect has the following:
registerColumnType( Types.TIMESTAMP, "timestamp" );

where as OracleDialect has:
// Oracle8 and previous define only a "DATE" type which
// is used to represent all aspects of date/time
registerColumnType( Types.TIMESTAMP, "date" );

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 1:56 pm 
Newbie

Joined: Thu Jul 20, 2006 6:25 pm
Posts: 6
Oooh. Thank you.

I didn't know or didn't notice or forgot that there was another oracle dialect. It works as expected with Oracle9Dialect.

_________________
Nate Franzen


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.