I have two tables
1. LoanCustomerDetail - having relation with LoanDetail table
2. CustomerObject - temporary table
I need to get list of LoanCustomerDetail objects ,based on the customerNo's from the CustomerObject,which has no relation with LoanCustomerDetail object.
For this I need to write a HQL to list all loanCustomerDetail object,
Is it possible to use HQL for this criteria or do we have to go with SQL ?
Code:
/**
* @hibernate.class table="LOAN_CUST_DETAIL"
*/
public class LoanCustomerDetail {
public Long loanCustId;
public String customerNo;
public String loanId;
/**
* @hibernate.property column="CUST_NUM"
* @return Returns the customerNo.
*/
public String getCustomerNo() {
return customerNo;
}
/**
* @param customerNo The customerNo to set.
*/
public void setCustomerNo(String customerNo) {
this.customerNo = customerNo;
}
/**
* @hibernate.id generator-class="native" column="LOAN_CUST_ID"
* @return Returns the loanCustId.
*/
public Long getLoanCustId() {
return loanCustId;
}
/**
* @param loanCustId The loanCustId to set.
*/
public void setLoanCustId(Long loanCustId) {
this.loanCustId = loanCustId;
}
/**
* @hibernate.property column="LOAN_ID"
* @return Returns the loanId.
*/
public String getLoanId() {
return loanId;
}
/**
* @param loanId The loanId to set.
*/
public void setLoanId(String loanId) {
this.loanId = loanId;
}
}
Code:
/**
*
* @hibernate.class table="CUST_OBJ"
*/
public class CustomerObject {
public Long customerId;
public String customerNo;
public String customerName;
/**
* @hibernate.id generator-class="native" column="CUST_ID"
* @return Returns the customerId.
*/
public Long getCustomerId() {
return customerId;
}
/**
* @param customerId The customerId to set.
*/
public void setCustomerId(Long customerId) {
this.customerId = customerId;
}
/**
* @hibernate.property column="CUST_NAME"
* @return Returns the customerName.
*/
public String getCustomerName() {
return customerName;
}
/**
* @param customerName The customerName to set.
*/
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
/**
* @hibernate.property column="CUST_NUM"
* @return Returns the customerNo.
*/
public String getCustomerNo() {
return customerNo;
}
/**
* @param customerNo The customerNo to set.
*/
public void setCustomerNo(String customerNo) {
this.customerNo = customerNo;
}
}
Thanks in advance