I have the following sql and want to make sure that the mapping required for this query are correct:
select trans.date, con.type, ai.item
from Transaction tran, Condition con, AssignedItem ai
where tran.id = ai.transaction.id
and con.id = ai.condition.id
and tran.department=:deptNum
plus do i need the many-to-one mapping for the above query also in the Transaction and Condition table as well
or just plain mappings for those
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="AssignedItem" table="AssignedItem">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="item" column="item"/>
<property name="ai_trans_id" column="trans_id"/>
<property name="ai_con_id" column="con_id"/>
<property name="title"/>
<many-to-one column="ai_con_id" class="transactions"/>
<many-to-one column="ai_con_id" class="condition"/>
</class>
</hibernate-mapping>
|