Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package au.com.parcelpoint.domain.batch;
- import au.com.parcelpoint.domain.DomainObject;
- import javax.persistence.*;
- import java.util.List;
- /**
- * Persistent entity for Job descriptor.
- *
- * @author Jeff Chen
- */
- @Entity
- @Table(name = "job")
- public class JobEntity extends DomainObject {
- @Id
- @GeneratedValue(strategy = GenerationType.IDENTITY)
- @Basic(optional = false)
- @Column(name = "id", nullable = false)
- private Long id;
- @Column(name = "name")
- private String name;
- @Column(name = "status", nullable = false)
- @Enumerated(EnumType.STRING)
- private Status status = Status.OPEN;
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "job_id",
- referencedColumnName = "id")
- @OrderBy("createdOn ASC")
- private List<BatchEntity> batches;
- @Column(name = "retailer_id")
- private Long retailerId;
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public Status getStatus() {
- return status;
- }
- public void setStatus(Status status) {
- this.status = status;
- }
- public List<BatchEntity> getBatches() {
- return batches;
- }
- public void setBatches(List<BatchEntity> batches) {
- this.batches = batches;
- }
- public Long getRetailerId() {
- return retailerId;
- }
- public void setRetailerId(Long retailerId) {
- this.retailerId = retailerId;
- }
- public enum Status { OPEN, CLOSED }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement