Ich habe ein kleines, aber ernstes Problem mit dem XML Export (EntityMode.DOM4J) von Hibernate, das in den meisten Fällen wunderbar funktioniert. Nur wenn ich einen Blob in mein Mapping hinzufüge wird eine Unsupported Operation exception geworfen, womit ich eigentlich kein Problem habe, weil ich den Blobwert nicht im XML benötige.
Mein Mapping:
<property name="binaryValue" type="blob">
<column name="BINARY_VALUE"/>
</property>
Wenn ich das Property auskommentiere, läuft der Export natürlich wieder, nur ist das leider keine Option. Kann ich Hibernate irgendwie mitteilen, dass er das Property für den XML export ignorieren soll, aber für den Pojo-Modus nicht?
Oder hat jemand eine ganz andere Idee?
Danke.
-----
Problem: Blobs im 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
|