-->
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: Querying for Composite Elements
PostPosted: Mon Apr 28, 2008 12:20 pm 
Newbie

Joined: Tue Apr 22, 2008 7:17 am
Posts: 14
Hi,

Another newbie question...

I have a mapping that defines two lists as properties, each made up of composite-elements. In the DB this is implemented by having a join to another table where each row in the joined table is an instance of the composite element.

My mapping looks like:

Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                  assembly="OzoneHR.Domain"
                  namespace="OzoneHR.Domain.Questionnaires">
  <class name="QuestionTemplate" table="QuestionTemplate">
    <id name="Id" access="nosetter.camelcase-underscore"
        column="QuestionTemplateID" type="Int32">
      <generator class="identity" />
    </id>
    <property name="QuestionText" column="QuestionText" type="String" not-null="true" access="nosetter.camelcase-underscore" />   
    <bag name="SubDomains"
         table="QuestionTemplateInSubdomain"
         cascade="all"
         access="nosetter.camelcase-underscore"
         >
      <key column="QuestionTemplateID" />     
      <composite-element class="QuestionnaireSubdomain">       
        <property name="SubdomainName" access="nosetter.camelcase-underscore" column="Subdomain" not-null="true" />         
      </composite-element>     
    </bag>
    <bag name="Domains"
         table="QuestionTemplateInDomain"
         cascade="all"
         access="nosetter.camelcase-underscore"
         >
      <key column="QuestionTemplateID" />
      <composite-element class="QuestionnaireDomain">
        <property name="DomainName" access="nosetter.camelcase-underscore" column="Domain" not-null="true" />       
      </composite-element>
    </bag>
  </class>
</hibernate-mapping>


What I'd like to do is a get a list of all the distinct Domains in the system. As domain isn't an entity, I only have access to it through the QuestionTemplate entity, my query I'm assuming will somehow have to go through the QuestionTemplate class, but I haven't been able to get it to work.

Any help would be greatly appreciated!!

Thanks,
Matt


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 08, 2008 5:48 pm 
Newbie

Joined: Tue Apr 22, 2008 7:17 am
Posts: 14
No one can help? Any suggestions on where else I could find an answer?

Thanks,
Matt


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.