openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nibbler <Michael.Schn...@VerizonWireless.com>
Subject Re: Help - Single table inheritance not working with one-to-many collection
Date Mon, 08 Dec 2008 22:51:53 GMT

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.


Mime
View raw message