I have a small but serious problem with XML export (EntityMode.DOM4J), which works just fine in almost all circumstances. Only if I include a blob in my mapping, it throws an Unsupported Operation exception, which would be okay for me because I don't need the blob value in the XML file.
My mappings looks like that:
<property name="binaryValue" type="blob">
<column name="BINARY_VALUE"/>
</property>
If I comment that property out, everything is fine again. But I want to keep it inside, but I don't want it to affect the XML file. Is there a way to tell Hibernate to ignore that property for XML export? Perhaps something like embed-xml="false"?
If not, is there another solution for this problem?
-----
Problem: Blobs in XML export
Hibernate version: 3.1.1
Mapping documents:
<property name="binaryValue" type="blob">
<column name="BINARY_VALUE"/>
</property>
Code between sessionFactory.openSession() and session.close():
java.lang.UnsupportedOperationException: todo
at org.hibernate.type.BlobType.setToXMLNode(BlobType.java:137)
at org.hibernate.property.Dom4jAccessor$ElementSetter.set(Dom4jAccessor.java:310)
at org.hibernate.tuple.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:82)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:847)
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:62)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
at org.hibernate.proxy.Dom4jLazyInitializer.getElement(Dom4jLazyInitializer.java:21)
at org.hibernate.proxy.Dom4jProxy.target(Dom4jProxy.java:563)
at org.hibernate.proxy.Dom4jProxy.setName(Dom4jProxy.java:205)
at org.hibernate.tuple.ElementWrapper.setName(ElementWrapper.java:204)
at org.hibernate.type.AbstractType.replaceNode(AbstractType.java:127)
at org.hibernate.type.EntityType.setToXMLNode(EntityType.java:453)
at org.hibernate.property.Dom4jAccessor$ElementSetter.set(Dom4jAccessor.java:310)
at org.hibernate.tuple.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:330)
at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2150)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1127)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
Name and version of the database you are using: Oracle 9.2
|