| @Column(name = "expired_date") | @Column(name = "expired_date") | ||||
| private Instant expiredDate; | private Instant expiredDate; | ||||
| @Column(name = "tb_example_stamp_id", insertable = false, updatable = false) | |||||
| private Long tbExampleStampId; | |||||
| @Column(name = "created_date") | @Column(name = "created_date") | ||||
| private Instant createdDate; | private Instant createdDate; | ||||
| @OrderBy("id ASC") | @OrderBy("id ASC") | ||||
| private Set<TBCodeDetails> tbCodeDetails = new HashSet<>(); | private Set<TBCodeDetails> tbCodeDetails = new HashSet<>(); | ||||
| // @ManyToOne(fetch = FetchType.EAGER) | |||||
| // @JsonIgnoreProperties("") | |||||
| // @JoinColumn(name = "tb_product_label_id") | |||||
| // private TBProductLabel tbProductLabel; | |||||
| // @ManyToMany | |||||
| // @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) | |||||
| // @JoinTable(name = "tb_code_stamp", | |||||
| // joinColumns = @JoinColumn(name = "tb_code_id"/*, referencedColumnName = "id"*/), | |||||
| // inverseJoinColumns = @JoinColumn(name = "tb_example_stamp_id"/*, referencedColumnName = "id"*/)) | |||||
| // private Set<TBExampleStamp> tbExampleStamps = new HashSet<>(); | |||||
| public Long getId() { | public Long getId() { | ||||
| return id; | return id; | ||||
| this.tbCropId = tbCropId; | this.tbCropId = tbCropId; | ||||
| } | } | ||||
| // public TBProductLabel getTbProductLabel() { | |||||
| // public TBProductLabel getTbProductLabel() { | |||||
| // return tbProductLabel; | // return tbProductLabel; | ||||
| // } | // } | ||||
| // | // | ||||
| // public void setTbProductLabel(TBProductLabel tbProductLabel) { | // public void setTbProductLabel(TBProductLabel tbProductLabel) { | ||||
| // this.tbProductLabel = tbProductLabel; | // this.tbProductLabel = tbProductLabel; | ||||
| // } | // } | ||||
| public Long getTbExampleStampId() { | |||||
| return tbExampleStampId; | |||||
| } | |||||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||||
| this.tbExampleStampId = tbExampleStampId; | |||||
| } | |||||
| } | } |
| private Long tBCropId; | private Long tBCropId; | ||||
| private Long tbProductLabelId; | |||||
| private Long tbExampleStampId; | |||||
| private String pathImage; | private String pathImage; | ||||
| this.expiredDate = expiredDate; | this.expiredDate = expiredDate; | ||||
| } | } | ||||
| public Long getTbProductLabelId() { | |||||
| return tbProductLabelId; | |||||
| public Long getTbExampleStampId() { | |||||
| return tbExampleStampId; | |||||
| } | } | ||||
| public void setTbProductLabelId(Long tbProductLabelId) { | |||||
| this.tbProductLabelId = tbProductLabelId; | |||||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||||
| this.tbExampleStampId = tbExampleStampId; | |||||
| } | } | ||||
| } | } |
| import vn.azteam.tpf.domain.TBCodeDetails; | import vn.azteam.tpf.domain.TBCodeDetails; | ||||
| import vn.azteam.tpf.domain.TBCodeStatusEnum; | import vn.azteam.tpf.domain.TBCodeStatusEnum; | ||||
| import vn.azteam.tpf.domain.TBCrop; | import vn.azteam.tpf.domain.TBCrop; | ||||
| import vn.azteam.tpf.domain.TBExampleStamp; | |||||
| import java.io.Serializable; | import java.io.Serializable; | ||||
| import java.time.Instant; | import java.time.Instant; | ||||
| private Long deletedById; | private Long deletedById; | ||||
| private Long tbProductLabelId; | |||||
| private Long tbExampleStampId; | |||||
| private Set<TBCodeDetailsDTO> tbCodeDetails = new HashSet<>(); | private Set<TBCodeDetailsDTO> tbCodeDetails = new HashSet<>(); | ||||
| this.tbCodeDetails = tbCodeDetails; | this.tbCodeDetails = tbCodeDetails; | ||||
| } | } | ||||
| public Long getTbProductLabelId() { | |||||
| return tbProductLabelId; | |||||
| public Long getTbExampleStampId() { | |||||
| return tbExampleStampId; | |||||
| } | } | ||||
| public void setTbProductLabelId(Long tbProductLabelId) { | |||||
| this.tbProductLabelId = tbProductLabelId; | |||||
| public void setTbExampleStampId(Long tbExampleStampId) { | |||||
| this.tbExampleStampId = tbExampleStampId; | |||||
| } | } | ||||
| } | } |
| tBCodeDTO.setCreatedDate(Instant.now()); | tBCodeDTO.setCreatedDate(Instant.now()); | ||||
| tBCodeDTO.setCreatedById(currentUser.getUserId()); | tBCodeDTO.setCreatedById(currentUser.getUserId()); | ||||
| tBCodeDTO.setStatus(TBCodeStatusEnum.NEW); | tBCodeDTO.setStatus(TBCodeStatusEnum.NEW); | ||||
| if (tBCodeCreationDTO.getTbProductLabelId() != null) { | |||||
| tBCodeDTO.setTbProductLabelId(tBCodeCreationDTO.getTbProductLabelId()); | |||||
| if (tBCodeCreationDTO.getTbExampleStampId() != null) { | |||||
| tBCodeDTO.setTbExampleStampId(tBCodeCreationDTO.getTbExampleStampId()); | |||||
| } | } | ||||
| TBCodeDTO result = null; | TBCodeDTO result = null; |