Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2016 18:58
Show Gist options
  • Save anonymous/46e62e55c87f72424a0728cf865bcb8e to your computer and use it in GitHub Desktop.
Save anonymous/46e62e55c87f72424a0728cf865bcb8e to your computer and use it in GitHub Desktop.
package com.prod.domain;
import com.fasterxml.jackson.annotation.*;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
@Entity
@JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@poid")
public class ProductionOrder implements Serializable {
@Enumerated(EnumType.STRING)
public Status status;
@Id
@GeneratedValue
private Long id;
@ManyToOne
@JoinColumn(name = "ITEM_ID")
@JsonIdentityReference(alwaysAsId = true)
private Item item;
private int plannedQty;
private Date plannedDate;
private String description;
public ProductionOrder() {
}
public ProductionOrder(int plannedQty, Date plannedDate) {
this.plannedQty = plannedQty;
this.plannedDate = plannedDate;
}
public ProductionOrder(Status status, Item item, int plannedQty) {
this.status = status;
this.item = item;
this.plannedQty = plannedQty;
}
public ProductionOrder(Status status, Item item, int plannedQty, Date plannedDate) {
this.status = status;
this.item = item;
this.plannedQty = plannedQty;
this.plannedDate = plannedDate;
}
public ProductionOrder(Status status, Item item, int plannedQty, Date plannedDate, String description) {
this.status = status;
this.item = item;
this.plannedQty = plannedQty;
this.plannedDate = plannedDate;
this.description = description;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public int getPlannedQty() {
return plannedQty;
}
public void setPlannedQty(int plannedQty) {
this.plannedQty = plannedQty;
}
public Date getPlannedDate() {
return plannedDate;
}
public void setPlannedDate(Date plannedDate) {
this.plannedDate = plannedDate;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public enum Status {
CREATED,
PLANNED,
DONE
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment