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
|