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: batch-size on subclass?
PostPosted: Wed Nov 19, 2008 2:58 am 
Newbie

Joined: Mon Sep 26, 2005 12:34 pm
Posts: 7
I'm trying to map several classes with an abstract base class in one table, and several subclasses, some of which have their own table.

The classes look roughly like this:

abstract class Base;
abstract class ABase : Base;
class A1: ABase;
class A2: ABase;
abstract class BBase : Base;
class B1 : BBase;
class B2 : BBase;

There is a table for Base, a table for ABase and its descendants, and a table for BBase and its descendants, and several more sets of classes and tables following in that pattern.

My mapping uses a <class/> for Base, with a discriminator column, and <subclass/> for the others, with the extra tables pulled in via <join/> in the subclass.

The mapping works, but I'm running into a snag trying to do some performance tuning. I set the <join> items to fetch="select", since in any given query of Base, the entities returned are commonly only of one or two types, so joining all the other tables was slowing things down.

The select fetch strategy improved things, but I'd like to be able to batch fetch several items at once. It seems like this would naturally be done by setting batch-size="10" or so on the <subclass/> -- what it does on a simple <class/> is exactly what I'd like to do for me here. However it's not legal on a subclass, and I'm not sure even if it was, if that would carry over to the join.

Any suggestions on how I might get it to do the batch queries for my subclass tables?


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.