-
-
Save anonymous/46e62e55c87f72424a0728cf865bcb8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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