-->
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: Dinamically class name change
PostPosted: Wed Sep 30, 2009 2:41 am 
Newbie

Joined: Wed Sep 30, 2009 2:04 am
Posts: 5
Hello.
In our company we have big hierarchy of classes. And we have many relations between classes/objects.
For example we have BusinessObject, and relations with diff objects Relation.
But we have many business objects classes, and if we make session.load(BusinessObject.class, uuid), then hibernate will make big sql query (20-30kb). Hibernate will join all descendant classes.
But using one relation with different type property is good. We can't make many relations.

Also we have cache, that can tell me class by uuid.

We can use session.load(cache.getClass(uuid), uuid)

and sql will be small.

But when we use hql for retrieve objects, or objects loaded as many-to-one property, we can't use this triсk.

I try to use my LoadEventListener and override onLoad method, or change LodEvent to my load event, where i change class to my class from cache. But i think, this way will kill many hibernate mechanizms. (may be cache, batch loading or else).

May be anybody knows how i can do this class change to descendant class, to some uuids on objects load? Need do it without dirty tricks. Thanks.


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.