-->
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.  [ 4 posts ] 
Author Message
 Post subject: Orcle Hibernate issue with Timestamp
PostPosted: Fri Aug 02, 2013 8:38 am 
Newbie

Joined: Fri Aug 02, 2013 8:24 am
Posts: 9
Hello,

I have oracle database of version 11.2g.
Hibernate version 3.0.
JDK 1.6

I have one table which have few columns of data type TIMESTAMP(3) in oracle.
When I generated HBM file for this table using eclipse plugins, my column of data type Timestamp gets mapped to Java object as "Serializable" rather than Date or Timestamp.

Below are the configuration details.

Jar file used: ojdbc6.jar
Dialect: org.hibernate.dialect.OracleDialect
Driver: oracle.jdbc.driver.OracleDriver

I manually changed it to "Timestamp" in HBM file.
This is resulting in applicable start up failure with error message:

Caused by: org.hibernate.HibernateException: Wrong column type: start_datetime, expected: date
at org.hibernate.mapping.Table.validateColumns(Table.java:251)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1007)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:317)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:855)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:774)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
... 81 more


Is there any version or combination mist-match for dialect, hibernate version and oracle version?

Can you please guide me on this?

Thank you
Geeta B


Top
 Profile  
 
 Post subject: Re: Orcle Hibernate issue with Timestamp
PostPosted: Mon Aug 05, 2013 5:46 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
Please Map it to a Date and see if it that works ?

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


Top
 Profile  
 
 Post subject: Re: Orcle Hibernate issue with Timestamp
PostPosted: Wed Aug 14, 2013 1:30 am 
Newbie

Joined: Fri Aug 02, 2013 8:24 am
Posts: 9
Thanks for reply Ajit.

I did and it made no difference.
So as seconf approach what I did is I suppressed validation by removing "hibernate.hbm2ddl=validate" property.
Also I regenerated all the HBM files and manually changed from Serializable (which is Java type given to property associated with columns of time Date) to timestamp and now I don't get any such error.


Top
 Profile  
 
 Post subject: Re: Orcle Hibernate issue with Timestamp
PostPosted: Tue Aug 20, 2013 6:32 am 
Beginner
Beginner

Joined: Wed Feb 06, 2013 2:43 am
Posts: 46
Great

_________________
Thanks,
Ajit Singh
ajits@mindfiresolutions.com
www.mindfiresolutions.com


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