These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Query by example not retrieving correct result set...
PostPosted: Sun Jun 01, 2008 4:39 pm 
Newbie

Joined: Sun Jun 01, 2008 3:54 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.2.6

Java Objects:

Award -> AwardRcptRole -> Recipient

package com.myco.integration.database.dataobjects;

// Generated May 29, 2008 10:29:12 AM by Hibernate Tools 3.2.1.GA

import com.myco.integration.database.DataObject;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

public class Award implements DataObject, java.io.Serializable {

private Long grantId;
private String awardStatusCd;
private String awardStatusNm;
private String payeeReferenceNm;
private Date perfPerdBeginDt;
private Date perfPerdEndDt;
private Date liquidPerdDt;
private Date suspendPerdDt;
private Date closeoutPerdDt;
private String displayAwardStr;
private BigDecimal payReqLimitAmt;
private Set awardFlags = new HashSet(0);
private Set awardBalanceses = new HashSet(0);
private Set awardRcptRoles = new HashSet(0);
private Set grntAppls = new HashSet(0);
private Set awardDetailRcptRoles = new HashSet(0);

public Award() {
}

public Award(Long grantId) {
this.grantId = grantId;
}

public Award(Long grantId, String awardStatusCd, String awardStatusNm,
String payeeReferenceNm, Date perfPerdBeginDt, Date perfPerdEndDt,
Date liquidPerdDt, Date suspendPerdDt, Date closeoutPerdDt,
String displayAwardStr, BigDecimal payReqLimitAmt, Set awardFlags,
Set awardBalanceses, Set awardRcptRoles, Set grntAppls,
Set awardDetailRcptRoles) {
this.grantId = grantId;
this.awardStatusCd = awardStatusCd;
this.awardStatusNm = awardStatusNm;
this.payeeReferenceNm = payeeReferenceNm;
this.perfPerdBeginDt = perfPerdBeginDt;
this.perfPerdEndDt = perfPerdEndDt;
this.liquidPerdDt = liquidPerdDt;
this.suspendPerdDt = suspendPerdDt;
this.closeoutPerdDt = closeoutPerdDt;
this.displayAwardStr = displayAwardStr;
this.payReqLimitAmt = payReqLimitAmt;
this.awardFlags = awardFlags;
this.awardBalanceses = awardBalanceses;
this.awardRcptRoles = awardRcptRoles;
this.grntAppls = grntAppls;
this.awardDetailRcptRoles = awardDetailRcptRoles;
}

public Long getGrantId() {
return this.grantId;
}

public void setGrantId(Long grantId) {
this.grantId = grantId;
}

public String getAwardStatusCd() {
return this.awardStatusCd;
}

public void setAwardStatusCd(String awardStatusCd) {
this.awardStatusCd = awardStatusCd;
}

public String getAwardStatusNm() {
return this.awardStatusNm;
}

public void setAwardStatusNm(String awardStatusNm) {
this.awardStatusNm = awardStatusNm;
}

public String getPayeeReferenceNm() {
return this.payeeReferenceNm;
}

public void setPayeeReferenceNm(String payeeReferenceNm) {
this.payeeReferenceNm = payeeReferenceNm;
}

public Date getPerfPerdBeginDt() {
return this.perfPerdBeginDt;
}

public void setPerfPerdBeginDt(Date perfPerdBeginDt) {
this.perfPerdBeginDt = perfPerdBeginDt;
}

public Date getPerfPerdEndDt() {
return this.perfPerdEndDt;
}

public void setPerfPerdEndDt(Date perfPerdEndDt) {
this.perfPerdEndDt = perfPerdEndDt;
}

public Date getLiquidPerdDt() {
return this.liquidPerdDt;
}

public void setLiquidPerdDt(Date liquidPerdDt) {
this.liquidPerdDt = liquidPerdDt;
}

public Date getSuspendPerdDt() {
return this.suspendPerdDt;
}

public void setSuspendPerdDt(Date suspendPerdDt) {
this.suspendPerdDt = suspendPerdDt;
}

public Date getCloseoutPerdDt() {
return this.closeoutPerdDt;
}

public void setCloseoutPerdDt(Date closeoutPerdDt) {
this.closeoutPerdDt = closeoutPerdDt;
}

public String getDisplayAwardStr() {
return this.displayAwardStr;
}

public void setDisplayAwardStr(String displayAwardStr) {
this.displayAwardStr = displayAwardStr;
}

public BigDecimal getPayReqLimitAmt() {
return this.payReqLimitAmt;
}

public void setPayReqLimitAmt(BigDecimal payReqLimitAmt) {
this.payReqLimitAmt = payReqLimitAmt;
}

public Set getAwardFlags() {
return this.awardFlags;
}

public void setAwardFlags(Set awardFlags) {
this.awardFlags = awardFlags;
}

public Set getAwardBalanceses() {
return this.awardBalanceses;
}

public void setAwardBalanceses(Set awardBalanceses) {
this.awardBalanceses = awardBalanceses;
}

public Set getAwardRcptRoles() {
return this.awardRcptRoles;
}

public void setAwardRcptRoles(Set awardRcptRoles) {
this.awardRcptRoles = awardRcptRoles;
}

public Set getGrntAppls() {
return this.grntAppls;
}

public void setGrntAppls(Set grntAppls) {
this.grntAppls = grntAppls;
}

public Set getAwardDetailRcptRoles() {
return this.awardDetailRcptRoles;
}

public void setAwardDetailRcptRoles(Set awardDetailRcptRoles) {
this.awardDetailRcptRoles = awardDetailRcptRoles;
}

// The following is extra code specified in the hbm.xml files
public Integer getIdentity() {
return null;
}

public void setIdentity(Integer identity) {
}
// end of extra code specified in the hbm.xml files

}

-------------------------------------------------
package com.myco.integration.database.dataobjects;

// Generated May 29, 2008 9:25:40 AM by Hibernate Tools 3.2.1.GA

import com.myco.integration.database.DataObject;
import java.util.Date;

public class AwardRcptRole implements DataObject, java.io.Serializable {

private AwardRcptRoleId id;
private Award award;
private Recipient recipient;
private Date effectiveStartDt;
private Date effectiveEndDt;
private String requestorNm;
private String requestDt;
private String roleNm;

public AwardRcptRole() {
}

public AwardRcptRole(AwardRcptRoleId id, Date effectiveStartDt,
String roleNm) {
this.id = id;
this.effectiveStartDt = effectiveStartDt;
this.roleNm = roleNm;
}

public AwardRcptRole(AwardRcptRoleId id, Award award, Recipient recipient,
Date effectiveStartDt, Date effectiveEndDt, String requestorNm,
String requestDt, String roleNm) {
this.id = id;
this.award = award;
this.recipient = recipient;
this.effectiveStartDt = effectiveStartDt;
this.effectiveEndDt = effectiveEndDt;
this.requestorNm = requestorNm;
this.requestDt = requestDt;
this.roleNm = roleNm;
}

public AwardRcptRoleId getId() {
return this.id;
}

public void setId(AwardRcptRoleId id) {
this.id = id;
}

public Award getAward() {
return this.award;
}

public void setAward(Award award) {
this.award = award;
}

public Recipient getRecipient() {
return this.recipient;
}

public void setRecipient(Recipient recipient) {
this.recipient = recipient;
}

public Date getEffectiveStartDt() {
return this.effectiveStartDt;
}

public void setEffectiveStartDt(Date effectiveStartDt) {
this.effectiveStartDt = effectiveStartDt;
}

public Date getEffectiveEndDt() {
return this.effectiveEndDt;
}

public void setEffectiveEndDt(Date effectiveEndDt) {
this.effectiveEndDt = effectiveEndDt;
}

public String getRequestorNm() {
return this.requestorNm;
}

public void setRequestorNm(String requestorNm) {
this.requestorNm = requestorNm;
}

public String getRequestDt() {
return this.requestDt;
}

public void setRequestDt(String requestDt) {
this.requestDt = requestDt;
}

public String getRoleNm() {
return this.roleNm;
}

public void setRoleNm(String roleNm) {
this.roleNm = roleNm;
}

// The following is extra code specified in the hbm.xml files
public Integer getIdentity() {
return null;
}

public void setIdentity(Integer identity) {
}
// end of extra code specified in the hbm.xml files

}

--------------------------------------------------
package com.myco.integration.database.dataobjects;

// Generated May 29, 2008 10:29:12 AM by Hibernate Tools 3.2.1.GA

import com.myco.integration.database.DataObject;
import java.util.HashSet;
import java.util.Set;

public class Recipient implements DataObject, java.io.Serializable {

public static final String IDENTITY = "identity";

public static final String RCPT_ID = "rcptId";

public static final String INSTITUTION_NAME = "rcptNm";

public static final String RCPT_SERVICER_IN = "rcptServicerIn";

private Integer identity;

private Long recipientId;
private String rcptId;
private String rcptTypeCd;
private String rcptTypeNm;
private String rcptNm;
private String rcptLastNm;
private String rcptFirstNm;
private String rcptMidNm;
private String rcptStatusCd;
private String rcptStatusNm;
private String displayRcptId;
private Character rcptServicerIn;
private Character rcptIpacIn;
private Long addrId;
private Long recipientParentId;
private Set paymentReturns = new HashSet(0);
private Set offsetSchedules = new HashSet(0);
private Set paymentControls = new HashSet(0);
private Set cfdaSubprgBankAccts = new HashSet(0);
private Set bankAccounts = new HashSet(0);
private Set awardRcptRoles = new HashSet(0);
private Set payeeServicersForServicerRecipientId = new HashSet(0);
private Set awardDetailRcptRoles = new HashSet(0);
private Set gapsG5Interims = new HashSet(0);
private Set refundBankAccounts = new HashSet(0);
private Set VBankAccounts = new HashSet(0);
private Set payeeServicersForPayeeRecipientId = new HashSet(0);

public Recipient() {
}

public Recipient(Long recipientId, String rcptId, String rcptNm) {
this.recipientId = recipientId;
this.rcptId = rcptId;
this.rcptNm = rcptNm;
}

public Recipient(Long recipientId, String rcptId, String rcptTypeCd,
String rcptTypeNm, String rcptNm, String rcptLastNm,
String rcptFirstNm, String rcptMidNm, String rcptStatusCd,
String rcptStatusNm, String displayRcptId,
Character rcptServicerIn, Character rcptIpacIn, Long addrId,
Long recipientParentId, Set paymentReturns, Set offsetSchedules,
Set paymentControls, Set cfdaSubprgBankAccts, Set bankAccounts,
Set awardRcptRoles, Set payeeServicersForServicerRecipientId,
Set awardDetailRcptRoles, Set gapsG5Interims,
Set refundBankAccounts, Set VBankAccounts,
Set payeeServicersForPayeeRecipientId) {
this.recipientId = recipientId;
this.rcptId = rcptId;
this.rcptTypeCd = rcptTypeCd;
this.rcptTypeNm = rcptTypeNm;
this.rcptNm = rcptNm;
this.rcptLastNm = rcptLastNm;
this.rcptFirstNm = rcptFirstNm;
this.rcptMidNm = rcptMidNm;
this.rcptStatusCd = rcptStatusCd;
this.rcptStatusNm = rcptStatusNm;
this.displayRcptId = displayRcptId;
this.rcptServicerIn = rcptServicerIn;
this.rcptIpacIn = rcptIpacIn;
this.addrId = addrId;
this.recipientParentId = recipientParentId;
this.paymentReturns = paymentReturns;
this.offsetSchedules = offsetSchedules;
this.paymentControls = paymentControls;
this.cfdaSubprgBankAccts = cfdaSubprgBankAccts;
this.bankAccounts = bankAccounts;
this.awardRcptRoles = awardRcptRoles;
this.payeeServicersForServicerRecipientId = payeeServicersForServicerRecipientId;
this.awardDetailRcptRoles = awardDetailRcptRoles;
this.gapsG5Interims = gapsG5Interims;
this.refundBankAccounts = refundBankAccounts;
this.VBankAccounts = VBankAccounts;
this.payeeServicersForPayeeRecipientId = payeeServicersForPayeeRecipientId;
}

public Long getRecipientId() {
return this.recipientId;
}

public void setRecipientId(Long recipientId) {
this.recipientId = recipientId;
}

public String getRcptId() {
return this.rcptId;
}

public void setRcptId(String rcptId) {
this.rcptId = rcptId;
}

public String getRcptTypeCd() {
return this.rcptTypeCd;
}

public void setRcptTypeCd(String rcptTypeCd) {
this.rcptTypeCd = rcptTypeCd;
}

public String getRcptTypeNm() {
return this.rcptTypeNm;
}

public void setRcptTypeNm(String rcptTypeNm) {
this.rcptTypeNm = rcptTypeNm;
}

public String getRcptNm() {
return this.rcptNm;
}

public void setRcptNm(String rcptNm) {
this.rcptNm = rcptNm;
}

public String getRcptLastNm() {
return this.rcptLastNm;
}

public void setRcptLastNm(String rcptLastNm) {
this.rcptLastNm = rcptLastNm;
}

public String getRcptFirstNm() {
return this.rcptFirstNm;
}

public void setRcptFirstNm(String rcptFirstNm) {
this.rcptFirstNm = rcptFirstNm;
}

public String getRcptMidNm() {
return this.rcptMidNm;
}

public void setRcptMidNm(String rcptMidNm) {
this.rcptMidNm = rcptMidNm;
}

public String getRcptStatusCd() {
return this.rcptStatusCd;
}

public void setRcptStatusCd(String rcptStatusCd) {
this.rcptStatusCd = rcptStatusCd;
}

public String getRcptStatusNm() {
return this.rcptStatusNm;
}

public void setRcptStatusNm(String rcptStatusNm) {
this.rcptStatusNm = rcptStatusNm;
}

public String getDisplayRcptId() {
return this.displayRcptId;
}

public void setDisplayRcptId(String displayRcptId) {
this.displayRcptId = displayRcptId;
}

public Character getRcptServicerIn() {
return this.rcptServicerIn;
}

public void setRcptServicerIn(Character rcptServicerIn) {
this.rcptServicerIn = rcptServicerIn;
}

public Character getRcptIpacIn() {
return this.rcptIpacIn;
}

public void setRcptIpacIn(Character rcptIpacIn) {
this.rcptIpacIn = rcptIpacIn;
}

public Long getAddrId() {
return this.addrId;
}

public void setAddrId(Long addrId) {
this.addrId = addrId;
}

public Long getRecipientParentId() {
return this.recipientParentId;
}

public void setRecipientParentId(Long recipientParentId) {
this.recipientParentId = recipientParentId;
}

public Set getPaymentReturns() {
return this.paymentReturns;
}

public void setPaymentReturns(Set paymentReturns) {
this.paymentReturns = paymentReturns;
}

public Set getOffsetSchedules() {
return this.offsetSchedules;
}

public void setOffsetSchedules(Set offsetSchedules) {
this.offsetSchedules = offsetSchedules;
}

public Set getPaymentControls() {
return this.paymentControls;
}

public void setPaymentControls(Set paymentControls) {
this.paymentControls = paymentControls;
}

public Set getCfdaSubprgBankAccts() {
return this.cfdaSubprgBankAccts;
}

public void setCfdaSubprgBankAccts(Set cfdaSubprgBankAccts) {
this.cfdaSubprgBankAccts = cfdaSubprgBankAccts;
}

public Set getBankAccounts() {
return this.bankAccounts;
}

public void setBankAccounts(Set bankAccounts) {
this.bankAccounts = bankAccounts;
}

public Set getAwardRcptRoles() {
return this.awardRcptRoles;
}

public void setAwardRcptRoles(Set awardRcptRoles) {
this.awardRcptRoles = awardRcptRoles;
}

public Set getPayeeServicersForServicerRecipientId() {
return this.payeeServicersForServicerRecipientId;
}

public void setPayeeServicersForServicerRecipientId(
Set payeeServicersForServicerRecipientId) {
this.payeeServicersForServicerRecipientId = payeeServicersForServicerRecipientId;
}

public Set getAwardDetailRcptRoles() {
return this.awardDetailRcptRoles;
}

public void setAwardDetailRcptRoles(Set awardDetailRcptRoles) {
this.awardDetailRcptRoles = awardDetailRcptRoles;
}

public Set getGapsG5Interims() {
return this.gapsG5Interims;
}

public void setGaps mycoInterims(Set gaps mycoInterims) {
this.gaps mycoInterims = gaps mycoInterims;
}

public Set getRefundBankAccounts() {
return this.refundBankAccounts;
}

public void setRefundBankAccounts(Set refundBankAccounts) {
this.refundBankAccounts = refundBankAccounts;
}

public Set getVBankAccounts() {
return this.VBankAccounts;
}

public void setVBankAccounts(Set VBankAccounts) {
this.VBankAccounts = VBankAccounts;
}

public Set getPayeeServicersForPayeeRecipientId() {
return this.payeeServicersForPayeeRecipientId;
}

public void setPayeeServicersForPayeeRecipientId(
Set payeeServicersForPayeeRecipientId) {
this.payeeServicersForPayeeRecipientId = payeeServicersForPayeeRecipientId;
}

public Integer getIdentity() {
return identity;
}

public void setIdentity(Integer identity) {
this.identity = identity;
}

}



Mapping documents:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated May 29, 2008 10:29:12 AM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="com.myco.integration.database.dataobjects.Award" table="AWARD">
<meta attribute="extra-import" inherit="false">com.myco.integration.database.DataObject</meta>
<meta attribute="implements" inherit="false">DataObject</meta>
<meta attribute="class-description" inherit="false">@author </meta>
<meta attribute="class-code" inherit="false">public Integer getIdentity(){return null;} public void setIdentity(Integer identity) { }</meta>
<id name="grantId" type="java.lang.Long">
<column name="GRANT_ID" precision="22" scale="0" />
<generator class="assigned" />
</id>
<property name="awardStatusCd" type="string">
<column name="AWARD_STATUS_CD" length="2" />
</property>
<property name="awardStatusNm" type="string">
<column name="AWARD_STATUS_NM" length="25" />
</property>
<property name="payeeReferenceNm" type="string">
<column name="PAYEE_REFERENCE_NM" length="25" />
</property>
<property name="perfPerdBeginDt" type="date">
<column name="PERF_PERD_BEGIN_DT" length="7" />
</property>
<property name="perfPerdEndDt" type="date">
<column name="PERF_PERD_END_DT" length="7" />
</property>
<property name="liquidPerdDt" type="date">
<column name="LIQUID_PERD_DT" length="7" />
</property>
<property name="suspendPerdDt" type="date">
<column name="SUSPEND_PERD_DT" length="7" />
</property>
<property name="closeoutPerdDt" type="date">
<column name="CLOSEOUT_PERD_DT" length="7" />
</property>
<property name="displayAwardStr" type="string">
<column name="DISPLAY_AWARD_STR" length="15" />
</property>
<property name="payReqLimitAmt" type="big_decimal">
<column name="PAY_REQ_LIMIT_AMT" precision="14" />
</property>
<set name="awardFlags" inverse="true">
<key>
<column name="GRANT_ID" precision="22" scale="0" not-null="true" unique="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardFlag" />
</set>
<set name="awardBalanceses" inverse="true">
<key>
<column name="GRANT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardBalances" />
</set>
<set name="awardRcptRoles" inverse="true">
<key>
<column name="GRANT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardRcptRole" />
</set>
<set name="grntAppls" inverse="true">
<key>
<column name="GRANT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.GrntAppl" />
</set>
<set name="awardDetailRcptRoles" inverse="true">
<key>
<column name="GRANT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardDetailRcptRole" />
</set>
</class>
</hibernate-mapping>

---------------------------------------------------------

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated May 29, 2008 9:25:41 AM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="com.myco.integration.database.dataobjects.AwardRcptRole" table="AWARD_RCPT_ROLE">
<meta attribute="extra-import" inherit="false">com.myco.integration.database.DataObject</meta>
<meta attribute="implements" inherit="false">DataObject</meta>
<meta attribute="class-description" inherit="false">@author </meta>
<meta attribute="class-code" inherit="false">public Integer getIdentity(){return null;} public void setIdentity(Integer identity) { }</meta>
<composite-id name="id" class="com.myco.integration.database.dataobjects.AwardRcptRoleId">
<key-property name="recipientId" type="java.lang.Long">
<column name="RECIPIENT_ID" precision="22" scale="0" />
</key-property>
<key-property name="roleCd" type="string">
<column name="ROLE_CD" length="2" />
</key-property>
</composite-id>
<many-to-one name="award" class="com.myco.integration.database.dataobjects.Award" fetch="select">
<column name="GRANT_ID" precision="22" scale="0" />
</many-to-one>
<many-to-one name="recipient" class="com.myco.integration.database.dataobjects.Recipient" update="false" insert="false" fetch="select">
<column name="RECIPIENT_ID" precision="22" scale="0" />
</many-to-one>
<property name="effectiveStartDt" type="date">
<column name="EFFECTIVE_START_DT" length="7" not-null="true" />
</property>
<property name="effectiveEndDt" type="date">
<column name="EFFECTIVE_END_DT" length="7" />
</property>
<property name="requestorNm" type="string">
<column name="REQUESTOR_NM" length="50" />
</property>
<property name="requestDt" type="string">
<column name="REQUEST_DT" length="9" />
</property>
<property name="roleNm" type="string">
<column name="ROLE_NM" length="25" not-null="true" />
</property>
</class>
</hibernate-mapping>
---------------------------------------------------------------

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated May 29, 2008 10:29:12 AM by Hibernate Tools 3.2.1.GA -->
<hibernate-mapping>
<class name="com.myco.integration.database.dataobjects.Recipient" table="RECIPIENT">
<meta attribute="extra-import" inherit="false">com.myco.integration.database.DataObject</meta>
<meta attribute="implements" inherit="false">DataObject</meta>
<meta attribute="class-description" inherit="false">@author </meta>
<meta attribute="class-code" inherit="false">public Integer getIdentity(){return null;} public void setIdentity(Integer identity) { }</meta>
<id name="recipientId" type="java.lang.Long">
<column name="RECIPIENT_ID" precision="22" scale="0" />
<generator class="assigned" />
</id>
<property name="rcptId" type="string">
<column name="RCPT_ID" length="11" not-null="true" />
</property>
<property name="rcptTypeCd" type="string">
<column name="RCPT_TYPE_CD" length="2" />
</property>
<property name="rcptTypeNm" type="string">
<column name="RCPT_TYPE_NM" length="14" />
</property>
<property name="rcptNm" type="string">
<column name="RCPT_NM" length="90" not-null="true" />
</property>
<property name="rcptLastNm" type="string">
<column name="RCPT_LAST_NM" length="25" />
</property>
<property name="rcptFirstNm" type="string">
<column name="RCPT_FIRST_NM" length="25" />
</property>
<property name="rcptMidNm" type="string">
<column name="RCPT_MID_NM" length="25" />
</property>
<property name="rcptStatusCd" type="string">
<column name="RCPT_STATUS_CD" length="1" />
</property>
<property name="rcptStatusNm" type="string">
<column name="RCPT_STATUS_NM" length="21" />
</property>
<property name="displayRcptId" type="string">
<column name="DISPLAY_RCPT_ID" length="11" />
</property>
<property name="rcptServicerIn" type="java.lang.Character">
<column name="RCPT_SERVICER_IN" length="1" />
</property>
<property name="rcptIpacIn" type="java.lang.Character">
<column name="RCPT_IPAC_IN" length="1" />
</property>
<property name="addrId" type="java.lang.Long">
<column name="ADDR_ID" precision="22" scale="0" />
</property>
<property name="recipientParentId" type="java.lang.Long">
<column name="RECIPIENT_PARENT_ID" precision="22" scale="0" />
</property>
<set name="paymentReturns" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.PaymentReturn" />
</set>
<set name="offsetSchedules" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.OffsetSchedule" />
</set>
<set name="paymentControls" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.PaymentControl" />
</set>
<set name="cfdaSubprgBankAccts" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.CfdaSubprgBankAcct" />
</set>
<set name="bankAccounts" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.BankAccount" />
</set>
<set name="awardRcptRoles" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardRcptRole" />
</set>
<set name="payeeServicersForServicerRecipientId" inverse="true">
<key>
<column name="SERVICER_RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.PayeeServicer" />
</set>
<set name="awardDetailRcptRoles" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.AwardDetailRcptRole" />
</set>
<set name="gapsmycoInterims" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.GapsmycoInterim" />
</set>
<set name="refundBankAccounts" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.RefundBankAccount" />
</set>
<set name="VBankAccounts" inverse="true">
<key>
<column name="RECIPIENT_ID" precision="22" scale="0" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.VBankAccount" />
</set>
<set name="payeeServicersForPayeeRecipientId" inverse="true">
<key>
<column name="PAYEE_RECIPIENT_ID" precision="22" scale="0" not-null="true" />
</key>
<one-to-many class="com.myco.integration.database.dataobjects.PayeeServicer" />
</set>
</class>
</hibernate-mapping>


Query:

Recipient r = new Recipient();
r.setRecipientId(recipientId);

AwardRcptRole arr = new AwardRcptRole();
arr.setRecipient(r);

Award a = new Award();
a.setAwardStatusCd("OP");
HashSet awardRcptRoles = new HashSet();
awardRcptRoles.add(arr);
a.setAwardRcptRoles(awardRcptRoles);

DatabaseWorkUnit workUnit = (DatabaseWorkUnit)
workContext.attach(DatabaseWorkUnit.class);
Example example = Example.create(a);
Criterion criterion = (Criterion)example;
List objectsOP = workUnit.findObjects(Award.class, criterion);
log.debug("List of open awards" + objectsOP.size());

ends up with sql

Hibernate:
select
this_.GRANT_ID as GRANT1_1_0_,
this_.AWARD_STATUS_CD as AWARD2_1_0_,
this_.AWARD_STATUS_NM as AWARD3_1_0_,
this_.PAYEE_REFERENCE_NM as PAYEE4_1_0_,
this_.PERF_PERD_BEGIN_DT as PERF5_1_0_,
this_.PERF_PERD_END_DT as PERF6_1_0_,
this_.LIQUID_PERD_DT as LIQUID7_1_0_,
this_.SUSPEND_PERD_DT as SUSPEND8_1_0_,
this_.CLOSEOUT_PERD_DT as CLOSEOUT9_1_0_,
this_.DISPLAY_AWARD_STR as DISPLAY10_1_0_,
this_.PAY_REQ_LIMIT_AMT as PAY11_1_0_
from
AWARD this_
where
(
this_.AWARD_STATUS_CD=?
)

Hibernate is not taking the Recipient information 1713 or 1707.. Where clause should have Award this_, AwardRcptRole a, Recipient b where this_AWARD_STATUS_CD=? and b.RECIPIENT_ID = 1713

Please advise.[/b]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.