I have my mapping set up with all the joins and everything.
Sorry about using column names, I am using java property name.
Here is my mapping file for the PICTBT_PARTY_ROLE
Code:
<hibernate-mapping>
<class name="com.fbfs.cp.pic.common.model.hibernate.PictbtPartyRole" table="PICTBT_PARTY_ROLE" schema="PICADMNT">
<id name="partyRoleKey" type="java.lang.Integer">
<column name="I_PARTY_ROLE_KEY" />
<generator class="native"></generator>
</id>
<many-to-one name="party" class="com.fbfs.cp.pic.common.model.hibernate.PictbtParty" fetch="select">
<column name="I_PARTY_KEY" not-null="true" />
</many-to-one>
<many-to-one name="partyRoleType" class="com.fbfs.cp.pic.common.model.hibernate.PictbdPartyRoleType" fetch="select">
<column name="I_ROLE_TYPE_KEY" not-null="true" />
</many-to-one>
<property name="effectiveDate" type="java.util.Date">
<column name="D_EFFECTIVE" length="26" not-null="true" />
</property>
<property name="expiredDate" type="java.util.Date">
<column name="D_EXPIRED" length="26" not-null="true" />
</property>
<property name="useridEntered" type="java.lang.String">
<column name="I_USERID_ENTERED" length="10" not-null="true" />
</property>
<property name="useridUpdated" type="java.lang.String">
<column name="I_USERID_UPDATED" length="10" />
</property>
<property name="enteredDate" type="java.util.Date">
<column name="D_ENTERED" length="26" not-null="true" />
</property>
<property name="updatedDate" type="java.util.Date">
<column name="D_UPDATED" length="26" />
</property>
<set name="agreementPartyRoles" inverse="true">
<key>
<column name="I_PARTY_ROLE_KEY" not-null="true" />
</key>
<one-to-many class="com.fbfs.cp.pic.common.model.hibernate.PictbtAgreementPartyRole" />
</set>
</class>
</hibernate-mapping>
Here is my mapping code for PICTBT_PARTY_RELATIONSHIP
Code:
<hibernate-mapping>
<class name="com.fbfs.cp.pic.common.model.hibernate.PictbtPartyRelationship" table="PICTBT_PARTY_RELATIONSHIP" schema="PICADMNT">
<id name="partyRelationshipKey" type="java.lang.Integer">
<column name="I_PARTY_RELATIONSHIP_KEY" />
<generator class="native"></generator>
</id>
<many-to-one name="partyRelationshipType" class="com.fbfs.cp.pic.common.model.hibernate.PictbdRelationshipType" fetch="select">
<column name="I_RELATIONSHIP_TYPE_KEY" not-null="true" />
</many-to-one>
<many-to-one name="role1" class="com.fbfs.cp.pic.common.model.hibernate.PictbtPartyRole" fetch="select">
<column name="I_PARTY_ROLE1_KEY" not-null="true" />
</many-to-one>
<many-to-one name="role2" class="com.fbfs.cp.pic.common.model.hibernate.PictbtPartyRole" fetch="select">
<column name="I_PARTY_ROLE2_KEY" not-null="true" />
</many-to-one>
<property name="effectiveDate" type="java.util.Date">
<column name="D_EFFECTIVE" length="26" not-null="true" />
</property>
<property name="expiredDate" type="java.util.Date">
<column name="D_EXPIRED" length="26" not-null="true" />
</property>
<property name="useridEntered" type="java.lang.String">
<column name="I_USERID_ENTERED" length="10" not-null="true" />
</property>
<property name="useridUpdated" type="java.lang.String">
<column name="I_USERID_UPDATED" length="10" />
</property>
<property name="enteredDate" type="java.util.Date">
<column name="D_ENTERED" length="26" not-null="true" />
</property>
<property name="updatedDate" type="java.util.Date">
<column name="D_UPDATED" length="26" />
</property>
<property name="altProducerId" type="java.lang.String">
<column name="I_ALT_PRODUCER_ID" length="20" />
</property>
<property name="yearsOfPriorService" type="java.lang.Short">
<column name="Q_YEARS_PRIOR_SERVICE"/>
</property>
<property name="relationshipDate" type="java.util.Date">
<column name="D_RELATIONSHIP" length="26" />
</property>
<property name="relationshipExpiredDate" type="java.util.Date">
<column name="D_RELATIONSHIP_EXPIRED" length="26" />
</property>
</class>
</hibernate-mapping>
Code:
public class RelationshipDto extends ProducerDto {
private Integer partyRelationshipKey;
private Integer relationshipTypeKey;
private String relationshipTypeName;
private Integer partyRole1Key;
private Integer partyRole2Key;
private String altProducerId;
private Integer partyKey2;
private String party2Name;
private Date effectiveDate;
private Date expiredDate;
private Date relationshipDate;
private String effectiveDateString;
private String expiredDateString;
private Short roleTypeKey1;
private Short roleTypeKey2;
}
Code:
public class PictbtPartyRole implements java.io.Serializable {
// Fields
private Integer partyRoleKey;
private PictbtParty party;
private PictbdPartyRoleType partyRoleType;
private Date effectiveDate;
private Date expiredDate;
private String useridEntered;
private String useridUpdated;
private Date enteredDate;
private Date updatedDate;
}
Code:
public class PictbtPartyRelationship implements java.io.Serializable {
// Fields
private Integer partyRelationshipKey;
private PictbdRelationshipType partyRelationshipType;
private PictbtPartyRole role1;
private PictbtPartyRole role2;
private Date effectiveDate;
private Date expiredDate;
private String useridEntered;
private String useridUpdated;
private Date enteredDate;
private Date updatedDate;
private String altProducerId;
private Short yearsOfPriorService;
private Date relationshipDate;
private Date relationshipExpiredDate;
}
Thank you Chuck
Venkat