Hi NG!
I'm trying to map a byte[]-property to a DB2-database using:
- hibernate 3.2.4.sp1
- hibernateTools 3.2.0.beta9
- spring-framework-2.0.6
My smart HibernatePlusSpringTotallyEasy-book tells me just to build a class like this:
@Entity
public class Picture {
private byte[] data;
@Lob
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
}
Said and done, the hibernate-tools generate this class-mapping-xml-file:
[...]
<property name="data" type="org.hibernate.type.PrimitiveByteArrayBlobType">
<column name="data" />
</property>
[...]
If I start my Spring-Container, I get the following exception, that I do not understand.
Any help would be really appreciated...
Berti
Caused by: org.hibernate.MappingException: Could not determine type for: org.hibernate.type.PrimitiveByteArrayBlobType, for columns: [org.hibernate.mapping.Column(data)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:410)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1026)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
... 45 more
|