I'm actually working with .Net so my properties have uppercase...
I'm assuming the parameter setting will be the same tho in the two versions.
My mapping file looks like this:
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="OzoneHR.Domain"
namespace="OzoneHR.Domain.Questionnaires">
<class name="Question" table="Question">
<id name="QuestionId" access="nosetter.camelcase-underscore"
column="QuestionId" type="Int32">
<generator class="identity" />
</id>
<property name="QuestionText" column="QuestionText" type="String" length="400" not-null="true" />
<component name="Subdomain" class="QuestionnaireSubdomain">
<property name="SubdomainName" access="nosetter.camelcase-underscore" column="Subdomain" />
</component>
<component name="Domain" class="QuestionnaireDomain">
<property name="DomainName" access="nosetter.camelcase-underscore" column="Domain" />
</component>
<property name="OrderPosition" type="Int32" not-null="true" />
<many-to-one name="QuestionnaireSection" access="nosetter.camelcase-underscore" column="QuestionnaireSectionID"
class="QuestionnaireSection" not-null="true" />
</class>
</hibernate-mapping>
And my code looks like:
Code:
session.CreateQuery("select distinct q.Subdomain from Question q where q.Domain = :domain")
.SetParameter("domain", domain)