Hi Mike, I do have the discriminator column. I have the following columns in my test_table:
Column name ------------------ ID_COLUMN COLUMN_A SITE_ID DISCRIMINATOR COLUMN_B CONTAINING_OBJ_ID The sql "select id_column, CONTAINING_OBJ_ID, discriminator from test_table" generates the following result: ID_COLUMN CONTAINING_OBJ_ID DISCRIMINATOR -------------------- ----------------- ------------------------------- 1 1 S 3 1 S 4 - D 2 1 S 5 - D To get the trace, you can put <property name="openjpa.Log" value="DefaultLevel=TRACE" /> in your persistence.xml. Regards, Fay --- On Mon, 12/8/08, nibbler <[EMAIL PROTECTED]> wrote: > From: nibbler <[EMAIL PROTECTED]> > Subject: Re: Help - Single table inheritance not working with one-to-many > collection > To: users@openjpa.apache.org > Date: Monday, December 8, 2008, 2:51 PM > Hi Fay, > I will figure out how to turn the trace on in eclipse and > then do that and > report back. > > I did notice in your trace it's not using the > discriminator column? Did you > set any values for that column in your table when running > your example > (thanks for doing that, btw :) If 2 of your rows have the > discriminator set > to 'S', then you should only get 2 TestChild1s back > in the getTestChildren() > method. I'm getting 5. > > Thanks, > -Mike > > > Fay Wang wrote: > > > > Hi Mike, > > I could not reproduce your problem. I used your > entity definitions with > > the following modification: > > (1) put @Entity to the Test class > > (2) made Test class an abstract class, > > > > After the insert, my table has 5 rows in it: > > > > select id_column, CONTAINING_OBJ_ID from test_table > > > > ID_COLUMN CONTAINING_OBJ_ID > > -------------------- ----------------- > > 1 1 > > 3 1 > > 4 - > > 2 1 > > 5 - > > > > I then tested with the following: > > > > ContainingObject co = > em.find(ContainingObject.class, 1); > > Set<TestChild1> children = > co.getTestChildren(); > > System.out.println("There are " + > children.size() + " testChild1 > > objs"); // THIS WILL SHOW all 5. > > > > > > The JDBC trace shows the push-down sql as: > > > > > > > > > > and I got 3 back. Which revision are you using? > can you get the jdbc > > trace? > > > > Regards, > > Fay > > > -- > View this message in context: > http://n2.nabble.com/Help---Single-table-inheritance-not-working-with-one-to-many-collection-tp1620948p1631360.html > Sent from the OpenJPA Users mailing list archive at > Nabble.com.