-->
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: Disassociating an object from CGLIB
PostPosted: Fri May 05, 2006 6:18 pm 
Beginner
Beginner

Joined: Mon Dec 06, 2004 4:20 pm
Posts: 34
Hi, I'm running Hibernate 3.0 on Oracle 10g, and have a question on how to disassociate a persistent object from CGLIB. Here is my scenario:

1. I retrieve a parent object from a hibernate session.
2. I get a child object from the parent, which (of course) has a reference to the parent. The object is then detached, because the session is closed - this is a Web application.
3. The parent attribute is never accessed, thus leaving it as a CGLIB attribute.
4. I pass the child object to Castor to marshal it to XML.
5. Castor, of course, tries to access all of the attributes and I get errors because the session has been closed.

So, what I would like to do is to remove all references to parent objects. I will handle child references, but I'm wondering if there's a way to remove non-referenced persistent attributes from a persistent object?

Thanks in advance,

Don


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 07, 2006 11:19 am 
Senior
Senior

Joined: Tue Mar 09, 2004 2:38 pm
Posts: 141
Location: Lowell, MA USA
You could always define a Castor XML mapping that explicitly does not go after the parent reference. I'll assume that you are currently using Castors default marshaller? Alternatively, you could define an interface on the Child object that does not refer to the parent. You could then have Castor marshal the interface, not the concrete class. Just to be clear, I'm not talking about using this interface as a Hibernate proxy, just as a means to get you through your issues with Castor. The Castor mapping approach would probably be the least invasive.

Ryan-

_________________
Ryan J. McDonough
http://damnhandy.com

Please remember to rate!


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.