I still have not had anyluck with this, i am new to hibernate so if it's something really simple i am missing please don't be frustrated with me just point me in the right direction.
Code:
package order_mod;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang.builder.ToStringBuilder;
/** @author order_mod CodeGenerator */
public class Onorder implements Serializable {
/** identifier field */
private Integer autono;
/** nullable persistent field */
private String plu;
/** identifier field */
private Integer orderno;
/** nullable persistent field */
private String itemno;
/** persistent field */
private int locno;
/** persistent field */
private String description;
/** nullable persistent field */
private Integer vendorno;
/** nullable persistent field */
private Double projectedcost;
/** nullable persistent field */
private Double actualcost;
/** nullable persistent field */
private Date dateordered;
/** nullable persistent field */
private Date datereceived;
/** nullable persistent field */
private Integer modified;
/** nullable persistent field */
private Integer modifiedby;
/** nullable persistent field */
private Integer orderqty;
/** persistent field */
private order_mod.Order order;
/** full constructor */
public Onorder(Integer autono, String plu, Integer orderno, String itemno, int locno, String description, Integer vendorno, Double projectedcost, Double actualcost, Date dateordered, Date datereceived, Integer modified, Integer modifiedby, Integer orderqty, order_mod.Order order){
this.autono = autono;
this.plu = plu;
this.orderno = orderno;
this.itemno = itemno;
this.locno = locno;
this.description = description;
this.vendorno = vendorno;
this.projectedcost = projectedcost;
this.actualcost = actualcost;
this.dateordered = dateordered;
this.datereceived = datereceived;
this.modified = modified;
this.modifiedby = modifiedby;
this.orderqty = orderqty;
this.order = order;
//this.productscorp = productscorp;
}
/** default constructor */
public Onorder() {
}
/** minimal constructor */
public Onorder(Integer autono, int locno, String description, order_mod.Order order)
this.autono = autono;
this.locno = locno;
this.description = description;
this.order = order;
}
public Integer getAutono() {
return this.autono;
}
public void setAutono(Integer autono) {
this.autono = autono;
}
public String getPlu() {
return this.plu;
}
public void setPlu(String plu) {
this.plu = plu;
}
public Integer getOrderno() {
return this.orderno;
}
public void setOrderno(Integer orderno) {
this.orderno = orderno;
}
public String getItemno() {
return this.itemno;
}
public void setItemno(String itemno) {
this.itemno = itemno;
}
public int getLocno() {
return this.locno;
}
public void setLocno(int locno) {
this.locno = locno;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getVendorno() {
return this.vendorno;
}
public void setVendorno(Integer vendorno) {
this.vendorno = vendorno;
}
public Double getProjectedcost() {
return this.projectedcost;
}
public void setProjectedcost(Double projectedcost) {
this.projectedcost = projectedcost;
}
public Double getActualcost() {
return this.actualcost;
}
public void setActualcost(Double actualcost) {
this.actualcost = actualcost;
}
public Date getDateordered() {
return this.dateordered;
}
public void setDateordered(Date dateordered) {
this.dateordered = dateordered;
}
public Date getDatereceived() {
return this.datereceived;
}
public void setDatereceived(Date datereceived) {
this.datereceived = datereceived;
}
public Integer getModified() {
return this.modified;
}
public void setModified(Integer modified) {
this.modified = modified;
}
public Integer getModifiedby() {
return this.modifiedby;
}
public void setModifiedby(Integer modifiedby) {
this.modifiedby = modifiedby;
}
public Integer getOrderqty() {
return this.orderqty;
}
public void setOrderqty(Integer orderqty) {
this.orderqty = orderqty;
}
public order_mod.Order getOrder() {
return this.order;
}
public void setOrder(order_mod.Order order) {
this.order = order;
}
public String toString() {
return new ToStringBuilder(this)
.append("autono", getAutono())
.toString();
}
}
Code:
package order_mod;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
import org.apache.commons.lang.builder.ToStringBuilder;
import java.util.List;
import java.util.HashSet;
/** @author Hibernate CodeGenerator */
public class Order implements Serializable {
/** identifier field */
private Integer orderno;
/** nullable persistent field */
private Integer locno;
/** nullable persistent field */
private Integer vendorno;
/** nullable persistent field */
private String vendorname;
/** nullable persistent field */
private Integer status;
/** nullable persistent field */
private Double totalcost;
/** nullable persistent field */
private Double shippingcost;
/** nullable persistent field */
private Date datecreated;
/** nullable persistent field */
private Date dateplaced;
/** nullable persistent field */
private Integer createdby;
/** nullable persistent field */
private Integer modifiedby;
/** nullable persistent field */
private Integer modifiedlast;
/** nullable persistent field */
private Integer modified;
/** persistent field */
private Set onorders;
/** full constructor */
public Order(Integer orderno, Integer locno, Integer vendorno, String vendorname, Integer status, Double totalcost, Double shippingcost, Date datecreated, Date dateplaced, Integer createdby, Integer modifiedby, Integer modifiedlast, Integer modified, Set onorders) {
this.orderno = orderno;
this.locno = locno;
this.vendorno = vendorno;
this.vendorname = vendorname;
this.status = status;
this.totalcost = totalcost;
this.shippingcost = shippingcost;
this.datecreated = datecreated;
this.dateplaced = dateplaced;
this.createdby = createdby;
this.modifiedby = modifiedby;
this.modifiedlast = modifiedlast;
this.modified = modified;
this.onorders = onorders;
}
/** default constructor */
public Order() {
}
/** minimal constructor */
public Order(Integer orderno, Set onorders) {
this.orderno = orderno;
this.onorders = onorders;
}
public Integer getOrderno() {
return this.orderno;
}
public void setOrderno(Integer orderno) {
this.orderno = orderno;
}
public Integer getLocno() {
return this.locno;
}
public void setLocno(Integer locno) {
this.orderno = locno;
}
public Integer getVendorno() {
return this.vendorno;
}
public void setVendorno(Integer vendorno) {
this.vendorno = vendorno;
}
public String getVendorname() {
return this.vendorname;
}
public void setVendorname(String vendorname) {
this.vendorname = vendorname;
}
public Integer getStatus() {
return this.status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Double getTotalcost() {
return this.totalcost;
}
public void setTotalcost(Double totalcost) {
this.totalcost = totalcost;
}
public Double getShippingcost() {
return this.shippingcost;
}
public void setShippingcost(Double shippingcost) {
this.shippingcost = shippingcost;
}
public Date getDatecreated() {
return this.datecreated;
}
public void setDatecreated(Date datecreated) {
this.datecreated = datecreated;
}
public Date getDateplaced() {
return this.dateplaced;
}
public void setDateplaced(Date dateplaced) {
this.dateplaced = dateplaced;
}
public Integer getCreatedby() {
return this.createdby;
}
public void setCreatedby(Integer createdby) {
this.createdby = createdby;
}
public Integer getModifiedby() {
return this.modifiedby;
}
public void setModifiedby(Integer modifiedby) {
this.modifiedby = modifiedby;
}
public Integer getModifiedlast() {
return this.modifiedlast;
}
public void setModifiedlast(Integer modifiedlast) {
this.modifiedlast = modifiedlast;
}
public Integer getModified() {
return this.modified;
}
public void setModified(Integer modified) {
this.modified = modified;
}
public Set getOnorders() {
return this.onorders;
}
public void setOnorders(Set onorders) {
this.onorders = onorders;
}
public void addOnorder(Onorder onorder){
try{
if((onorders == null)){
onorders = new HashSet();
}else if((onorders.size()<0) || (onorders.isEmpty())){
onorders = new HashSet();
}
onorders.add(onorder);
}catch(Exception e){
System.err.println("order_mod.Order.addOnorder():" + e.toString());
e.printStackTrace();
}
}
public String toString() {
return new ToStringBuilder(this)
.append("orderno", getOrderno())
.toString();
}
}