-->
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.  [ 2 posts ] 
Author Message
 Post subject: 2 classes, one table
PostPosted: Wed Jul 14, 2004 9:00 am 
Regular
Regular

Joined: Mon Jun 14, 2004 1:42 pm
Posts: 80
Location: Brazil
What happens if I create 2 or more classes over the same table, with diferent where clauses ? how the polymofphism attribute affects the behaviour ? is that a bad design, what limitations someone will face ?

still trying to escape from simplistic "columnx='classA'" subclassing :(


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 14, 2004 10:51 am 
Beginner
Beginner

Joined: Mon Nov 03, 2003 11:48 pm
Posts: 29
I have done something like this. I have a class using multiple one-to-many to point to one class. The parent has code like:
Code:
    /**
     * @hibernate.set lazy="true" where="fieldElement = 'FterEcud'" cascade="all-delete-orphan" inverse="false"
     * @hibernate.collection-key column="tar_id"
     * @hibernate.collection-one-to-many class="org.guidestar.uk.fin.hibernate.FinRevExpItem"
     *
     */
    public Set getExpCostUnDetails() {
        return this.expCostUnDetails;
    }


Code:

       <set
            name="expCostUnDetails"
            lazy="true"
            inverse="false"
            cascade="all-delete-orphan"
            sort="unsorted"
            where="fieldElement = 'FterEcud'"
        >

              <key
                  column="tar_id"
              >
              </key>

              <one-to-many
                  class="org.guidestar.uk.fin.hibernate.FinRevExpItem"
              />
        </set>

Don't know if that helps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.