-->
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.  [ 3 posts ] 
Author Message
 Post subject: How can I filter out blobs in XML export?
PostPosted: Wed Feb 01, 2006 9:10 am 
Newbie

Joined: Wed Feb 01, 2006 8:27 am
Posts: 2
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 01, 2006 10:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
No, nothing like that. The entity modes basically assume that the domain set is consistent across all the modes for a given entity (i.e. the same number of fields/properties).


Top
 Profile  
 
 Post subject: is anyone working on this?
PostPosted: Thu Jun 29, 2006 4:32 pm 
Newbie

Joined: Thu Jun 29, 2006 3:54 pm
Posts: 2
Steve,

Is anyone working on this issue? It would be so nice to only specify certain columns to go on the XML file and not all of them.

- Kalman


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

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.