what do i need to place in session.get(class, serializable) when my serializable consists of two integer?
Mapping:
Code:
<?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 default-lazy="false">
<class name="com.Elcom.tables.Contacts.OrganisationContact" table="OrganisationContacts">
<composite-id>
<key-property name="person" type="integer" column="person_id"/>
<key-property name="organisation" type="integer" column="org_id"/>
</composite-id>
<many-to-one name="person" class="com.Elcom.tables.Contacts.Person" insert="false" update="false">
<column name="person_id"/>
</many-to-one>
<many-to-one name="organisation" class="com.Elcom.tables.Organisation" column="org_id" insert="false" update="false"/>
<property name="job" type="string" length="50"/>
</class>
</hibernate-mapping>
I need function with interface:
Code:
OrganisationContact getOrganisatonContactById(Long org_id, Long person_id)
Should I use HQL query? Or I can use session.get somehow?