2010-10-01 21:52:51 +02:00
|
|
|
package de.hsadmin.mods.pac;
|
|
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
2010-10-06 15:06:01 +02:00
|
|
|
import javax.persistence.Column;
|
|
|
|
import javax.persistence.Entity;
|
|
|
|
import javax.persistence.Id;
|
2010-10-01 21:52:51 +02:00
|
|
|
import javax.persistence.IdClass;
|
2010-10-06 15:06:01 +02:00
|
|
|
import javax.persistence.JoinColumn;
|
|
|
|
import javax.persistence.ManyToOne;
|
|
|
|
import javax.persistence.Table;
|
|
|
|
import javax.persistence.Temporal;
|
|
|
|
import javax.persistence.TemporalType;
|
|
|
|
|
|
|
|
@Entity(name = "PacComponents")
|
|
|
|
@Table(name = "packet_component")
|
2010-10-01 21:52:51 +02:00
|
|
|
@IdClass(PacComponentId.class)
|
2011-03-22 23:02:06 +01:00
|
|
|
public class PacComponent {
|
2010-10-01 21:52:51 +02:00
|
|
|
|
2011-03-22 23:02:06 +01:00
|
|
|
@Id
|
|
|
|
@Column(name="packet_id", insertable=false, updatable=false, columnDefinition = "integer")
|
|
|
|
private long pacId;
|
2010-10-01 21:52:51 +02:00
|
|
|
|
2010-10-06 15:06:01 +02:00
|
|
|
@Id
|
2011-03-22 23:02:06 +01:00
|
|
|
@Column(name="basepacket_id", insertable=false, updatable=false, columnDefinition = "integer")
|
|
|
|
private long basePacId;
|
|
|
|
|
|
|
|
@Id
|
|
|
|
@Column(name="basecomponent_id", insertable=false, updatable=false, columnDefinition = "integer")
|
|
|
|
private long baseComponentId;
|
|
|
|
|
|
|
|
@ManyToOne
|
|
|
|
@JoinColumn(name = "packet_id")
|
2010-10-01 21:52:51 +02:00
|
|
|
private Pac pac;
|
|
|
|
|
2011-03-22 23:02:06 +01:00
|
|
|
@ManyToOne
|
|
|
|
@JoinColumn(name = "basecomponent_id")
|
2010-10-01 21:52:51 +02:00
|
|
|
private BaseComponent baseComponent;
|
|
|
|
|
2011-03-22 23:02:06 +01:00
|
|
|
@ManyToOne
|
|
|
|
@JoinColumn(name = "basepacket_id")
|
2010-10-01 21:52:51 +02:00
|
|
|
private BasePac basePac;
|
|
|
|
|
2010-10-06 15:06:01 +02:00
|
|
|
@Column(name = "quantity", columnDefinition = "integer")
|
2010-10-01 21:52:51 +02:00
|
|
|
private int quantity;
|
|
|
|
|
2010-10-06 15:06:01 +02:00
|
|
|
@Column(name = "created", columnDefinition = "date", nullable = true)
|
|
|
|
@Temporal(TemporalType.DATE)
|
2010-10-01 21:52:51 +02:00
|
|
|
private Date created;
|
|
|
|
|
2010-10-06 15:06:01 +02:00
|
|
|
@Column(name = "cancelled", columnDefinition = "date", nullable = true)
|
|
|
|
@Temporal(TemporalType.DATE)
|
2010-10-01 21:52:51 +02:00
|
|
|
private Date cancelled;
|
|
|
|
|
|
|
|
public PacComponent() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public PacComponent(BasePac basePac, BaseComponent baseComp, Pac pac,
|
|
|
|
int quantity, Date created, Date cancelled) {
|
|
|
|
this.basePac = basePac;
|
|
|
|
this.pac = pac;
|
|
|
|
this.baseComponent = baseComp;
|
|
|
|
this.quantity = quantity;
|
|
|
|
this.created = created;
|
|
|
|
this.cancelled = cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BasePac getBasePac() {
|
|
|
|
return basePac;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setbasePac(BasePac basePac) {
|
|
|
|
this.basePac = basePac;
|
|
|
|
}
|
|
|
|
|
|
|
|
public BaseComponent getBaseComponent() {
|
|
|
|
return baseComponent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setBaseComponent(BaseComponent baseComponent) {
|
|
|
|
this.baseComponent = baseComponent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Pac getPac() {
|
|
|
|
return pac;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPac(Pac pac) {
|
|
|
|
this.pac = pac;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getQuantity() {
|
|
|
|
return quantity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setQuantity(int quantity) {
|
|
|
|
this.quantity = quantity;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCreated() {
|
|
|
|
return created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCreated(Date created) {
|
|
|
|
this.created = created;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getCancelled() {
|
|
|
|
return cancelled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCancelled(Date cancelled) {
|
|
|
|
this.cancelled = cancelled;
|
|
|
|
}
|
|
|
|
|
2011-03-22 23:02:06 +01:00
|
|
|
public void setPacId(long pacId) {
|
|
|
|
this.pacId = pacId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getPacId() {
|
|
|
|
return pacId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setBaseComponentId(long baseComponentId) {
|
|
|
|
this.baseComponentId = baseComponentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getBaseComponentId() {
|
|
|
|
return baseComponentId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setBasePacId(long basePacId) {
|
|
|
|
this.basePacId = basePacId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long getBasePacId() {
|
|
|
|
return basePacId;
|
|
|
|
}
|
|
|
|
|
2010-10-01 21:52:51 +02:00
|
|
|
}
|