-->
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.  [ 4 posts ] 
Author Message
 Post subject: Using a proxy to manage a relationship?
PostPosted: Tue Feb 17, 2004 12:33 am 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
Hibernate very nicely handles relationships between objects and does the correct lazy loading against the DB.

Is there a place where I can plug into this my own lazy-loading proxy implementation? A class that takes the parameters from the parent record and does something a little different when fetching the child records? I need (ideally) to substitute just a tiny bit of the SQL.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 4:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
There are several places to look:

(1) use a custom persister
(2) implement ProxyFactory (requires 2.1.2)
(3) implement Type (look at ManyToOneType)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 6:55 am 
Regular
Regular

Joined: Wed Dec 31, 2003 4:26 am
Posts: 108
Location: Berkeley, CA
How do I tell Hibernate to use a different one?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 7:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
1.: <class persister="...">
2.: Extend AbstractEntityPersister and override createProxyFactory()
3.: <property type="...">


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