-->
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: Inheritance and specific class level query
PostPosted: Sun Jan 23, 2005 7:38 pm 
Newbie

Joined: Sun Jan 23, 2005 6:49 pm
Posts: 7
Hello,

I have following class structure:
Code:
public class A {
    private Long id;
    private String field1;
    // getters and setters omitted
}
public class B extends A {
    private String field2;
    // getters and setters omitted
}
public class C extends B {
    private String field3;
    // getters and setters omitted
}


I use joined-subclass inheritance:
Code:
<class name="A" table="class_a" ...>
[... id, fields ...]
    <joined-subclass name="B" table="class_b">
        <key column="a_id"/>
        [ fields ... ]
        <joined-subclass name="C" table="class_c">
            <key column="b_id"/>
            [ fields.... ]
        </joined-subclass>
    </joined-subclass>
</class>


Everything (creating, updating, deleting etc) works fine.

I don't know how to get all instances of class B, but only of class B (without instances of class C which are extending class B), or how to get all instances only of class A (without instances of B and C).

Warm regards,

_________________
Piotr Bzdyl


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.