-->
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.  [ 2 posts ] 
Author Message
 Post subject: xml export
PostPosted: Wed Jun 15, 2005 6:31 pm 
Newbie

Joined: Fri Mar 04, 2005 9:33 pm
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I am having dificulty trying to enable an xml export from a basic model.
I have had to cut the xml part down to a simple listing of single elements in one class only in an attempy to isolate the issue but am a little stumped now and would appriciate some help.

version 3.0.5.

Stacktrace:

java.lang.ClassCastException at org.hibernate.type.CompositeCustomType.setToXMLNode(CompositeCustomType.java:246) at org.hibernate.property.Dom4jAccessor$ElementSetter.set(Dom4jAccessor.java:307) at org.hibernate.tuple.AbstractTuplizer.setPropertyValues(AbstractTuplizer.java:207) at org.hibernate.persister.entity.BasicEntityPersister.setPropertyValues(BasicEntityPersister.java:2919) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:530) at org.hibernate.loader.Loader.doQuery(Loader.java:436) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218) at org.hibernate.loader.Loader.doList(Loader.java:1593) at org.hibernate.loader.Loader.list(Loader.java:1577) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at com.sorted.property.test.ReadXMLTest.testCreateDocument(Unknown Source) at com.sorted.property.test.TestCase.runTest(Unknown Source)






code:

initData();
Session session = HibernateUtil.getSession();
Session dom4jSession = session.getSession(EntityMode.DOM4J);
Document doc = DocumentFactory.getInstance().createDocument();

Element root = doc.addElement("root");
Query q = dom4jSession.getNamedQuery("findPropertyInPriceRange");

q.setParameter("minAmount", new BigDecimal(0));
q.setParameter("maxAmount", new BigDecimal(10000000));
System.out.println("b4 problem");
List p = q.list();
// List results = dom4jSession.createQuery("from Property prop").list();
System.out.println("after");
addToNode(p, root);

XMLWriter writer = new XMLWriter(new FileWriter("C:\\test.xml"));
writer.write(doc);
writer.close();

_________________
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 4:57 am 
Beginner
Beginner

Joined: Wed Sep 17, 2003 10:43 am
Posts: 48
i havent used v3 yet, but could this couls be a problem with the equals implementation of your POJOs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.