I have 2 classes linking to Tables PickHead(OrderHeaders) and Custmastr.
I have created the mapping documents successfully and can retrieve data from each table. But I want to join the tables in a query like.
========================
select p.packslip, c.cust_name
from pickhead p, custmstr c
where p.cust_num = c.cust_num
order by c.cust_name
======================
How would I do this in HQL and retrieve the data sucessfully? Could I get a link to the documentation which has a similar example.
Thank you in advance for help
Here are my classes
===============
public class OrderID {
private String rowID;
private String ordID;
private String ordPicked;
private String ordShipped;
private String custID;
public String getCustID() {
return custID;
}
public String getOrdID() {
return ordID;
}
public String getOrdPicked() {
return ordPicked;
}
public String getOrdShipped() {
return ordShipped;
}
public String getRowID() {
return rowID;
}
public void setCustID(String string) {
custID = string;
}
public void setOrdID(String string) {
ordID = string;
}
public void setOrdPicked(String string) {
ordPicked = string;
}
public void setOrdShipped(String string) {
ordShipped = string;
}
public void setRowID(String string) {
rowID = string;
}
}
public class CustomerInfo {
private String rowID;
private String custID;
private String custName;
public String getCustID() {
return custID;
}
public String getCustName() {
return custName;
}
public String getRowID() {
return rowID;
}
public void setCustID(String string) {
custID = string;
}
public void setCustName(String string) {
custName = string;
}
public void setRowID(String string) {
rowID = string;
}
}
|