[jboss-user] [EJB 3.0] - Class enhanced by javassist to normal Entity

Kruno do-not-reply at jboss.com
Tue Oct 23 05:05:20 EDT 2007


I am using Jboss 4.2 with seam.
I have a problem. I need to convert entity that has been lazy fetched to it's original class, so I can persist it. Trying to persist entity that is lazy fetched (enhanced by javassist) would cause exception.
I have this problem because I can not declare persist cascade between main entity and sub entities which are lazily fetched. ( project tracks historical data, and unfortunately database does not have triggers )
I have managed to solve problem by using hibernate session 

  |  ((Session)manager.getDelegate()).evict(main.getSubEntity());
  | 	SubEntity sub= manager.find(SubEntity.class,main.getSubEntity().getId());
  | 			
  | 		osoba.setSubEntity(sub);
  | 
But this kind of solution is not acceptable because then I am tide to jboss and hibernate, ( It is imperative that I have ability to move code to another application server) 
Please help.
            Thanks in advance Kruno.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097744#4097744

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097744



More information about the jboss-user mailing list