SHARE
TWEET

Untitled

a guest Oct 7th, 2019 12 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package au.com.parcelpoint.domain.batch;
  2.  
  3. import au.com.parcelpoint.domain.DomainObject;
  4. import javax.persistence.*;
  5. import java.util.List;
  6.  
  7. /**
  8.  * Persistent entity for Job descriptor.
  9.  *
  10.  * @author Jeff Chen
  11.  */
  12. @Entity
  13. @Table(name = "job")
  14. public class JobEntity extends DomainObject {
  15.  
  16.     @Id
  17.     @GeneratedValue(strategy = GenerationType.IDENTITY)
  18.     @Basic(optional = false)
  19.     @Column(name = "id", nullable = false)
  20.     private Long id;
  21.  
  22.     @Column(name = "name")
  23.     private String name;
  24.  
  25.     @Column(name = "status", nullable = false)
  26.     @Enumerated(EnumType.STRING)
  27.     private Status status = Status.OPEN;
  28.  
  29.     @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  30.     @JoinColumn(name = "job_id",
  31.                 referencedColumnName = "id")
  32.     @OrderBy("createdOn ASC")
  33.     private List<BatchEntity> batches;
  34.  
  35.     @Column(name = "retailer_id")
  36.     private Long retailerId;
  37.  
  38.     public Long getId() {
  39.         return id;
  40.     }
  41.  
  42.     public void setId(Long id) {
  43.         this.id = id;
  44.     }
  45.  
  46.     public String getName() {
  47.         return name;
  48.     }
  49.  
  50.     public void setName(String name) {
  51.         this.name = name;
  52.     }
  53.  
  54.     public Status getStatus() {
  55.         return status;
  56.     }
  57.  
  58.     public void setStatus(Status status) {
  59.         this.status = status;
  60.     }
  61.  
  62.     public List<BatchEntity> getBatches() {
  63.         return batches;
  64.     }
  65.  
  66.     public void setBatches(List<BatchEntity> batches) {
  67.         this.batches = batches;
  68.     }
  69.  
  70.     public Long getRetailerId() {
  71.         return retailerId;
  72.     }
  73.  
  74.     public void setRetailerId(Long retailerId) {
  75.         this.retailerId = retailerId;
  76.     }
  77.  
  78.     public enum Status { OPEN, CLOSED }
  79. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top