-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem mapping timestamp
PostPosted: Mon Oct 02, 2006 11:13 am 
Newbie

Joined: Mon Oct 02, 2006 11:01 am
Posts: 1
Hi,

My schema validation is failing when bringing up the hibernate session. The problem seems to be the mapping of a timestamp to the DATE or TIMESTAMP datatype in oracle. I've read about this problem on when dealing with MS SqlServer in a ejb3 forum... and there were no solutions. The code works fine if validation is not done. Lastly the interesting thing is that even after allowing Hibernate to construct the db schema for me from the mapping files, when then switched to validate mode, it failed validation. Thanks for any help.

-max

Hibernate version: 3.1.3

Mapping documents:

<property name="model_classification_date" column="model_classification_date" type="timestamp"/>

Full stack trace of any exception that occurs:

[junit] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in class path resource [test-oracl
e-session-factory.xml]: Initialization of bean failed; nested exception is org.h
ibernate.HibernateException: Wrong column type: model_classification_date, expected: timestamp
[junit] org.hibernate.HibernateException: Wrong column type: model_classific
ation_date, expected: timestamp
[junit] at org.hibernate.mapping.Table.validateColumns(Table.java:251)
[junit] at org.hibernate.cfg.Configuration.validateSchema(Configuration.
java:1007)
[junit] at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaVal
idator.java:116)
[junit] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryIm
pl.java:317)
[junit] at org.hibernate.cfg.Configuration.buildSessionFactory(Configura
tion.java:1218)
[junit] at org.springframework.orm.hibernate3.LocalSessionFactoryBean.ne
wSessionFactory(LocalSessionFactoryBean.java:825)
[junit] at org.springframework.orm.hibernate3.LocalSessionFactoryBean.af
terPropertiesSet(LocalSessionFactoryBean.java:751)
[junit] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
[junit] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:233)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory
.getBean(AbstractBeanFactory.java:145)
[junit] at org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveReference(BeanDefinitionValueResolver.java:186)
[junit] at org.springframework.beans.factory.support.BeanDefinitionValue
Resolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
[junit] at org.springframework.beans.factory.support.AbstractAutowireCap
ableBeanFactory.resolveConstructorArguments(AbstractAutowireCapableBeanFactory.j
ava:747)

Name and version of the database you are using: oracle 10g


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

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.