Hibernate version:2.2
hi, i have problems to understand the whole relation setup.
assume, i have the following mappings
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="X" assembly="X">
<class name="B" table="b">
<id name="Id" column="id" type="Int32">
<generator class="increment" />
</id>
<property name="Symbol">
<column name="symbol" sql-type="varchar(16)" not-null="true" />
</property>
<property name="Priority">
<column name="priority" sql-type="integer" not-null="true" />
</property>
</class>
</hibernate-mapping>
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="X" assembly="X">
<class name="A" table="a">
<id name="Id" column="id" type="Int32">
<generator class="increment" />
</id>
<property name="Name">
<column name="name" sql-type="text" not-null="true" />
</property>
<property name="BID">
<column name="bid" sql-type="integer" not-null="true" />
</property>
</class>
</hibernate-mapping>
the tables look like this
Code:
A.id | A.name | A.bid
------------------------
1 | foo | 1
2 | bar | 1
3 | foo | 2
2 | xyz | 1
Code:
B.id | B.symbol| B.priority
------------------------
1 | abc | 50
2 | def | 100
my questions are:
1) how to enhance my mappings so that it matches the relations between the relation?
2) how can i find all A's with A.name = 'foo' sorted by the B.priority?