-->
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.  [ 1 post ] 
Author Message
 Post subject: XML/Hashmap persistence using EntityManager
PostPosted: Sun Jun 11, 2006 12:52 pm 
Newbie

Joined: Sun Jun 11, 2006 12:28 pm
Posts: 2
Is this supported? I am getting an "java.lang.IllegalArgumentException: XClass not coming from this ReflectionManager implementation" exception.

Hibernate document says that "you can provides any XML file in the mapping file element ie. either hbm files or EJB3 deployment descriptor."

Or is it applicable only for POJO?

EntityManagerFactory emf = Persistence.createEntityManagerFactory("sample");
EntityManager em = emf.createEntityManager();

Session sess = ((EntityManagerImpl)em).getSession();
Session dom4jSession = sess.getSession(EntityMode.DOM4J);
Transaction tx = sess.beginTransaction();

Document document = DocumentHelper.createDocument();
Element acc = document.addElement( "Account" );

Object accid = dom4jSession.save(acc);
System.out.println(accid+" saved");


I am using 3.2.0.CR1 from entitymanager and 3.2 CR2 for core. I tried dom4j for hibernate.default_entity_mode in persistence.xml and didn't help. It works on directly created SessionFactory (without entitymanager) with EntityMode.DOM4J.

thanks,
mani doraisamy


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

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.