@Test public void testPrePersist() throws Exception { Order order = new Order(); assertThat(order.getUpdateDate()).isNull(); order.prePersist(); assertThat(order.getUpdateDate()).isNotNull(); }
@PrePersist public void prePersist() { final Date date = new Date(); this.creationDate = date; this.updateDate = date; }
Order { @PrePersist public void prePersist() { final Date date = new Date(); this.creationDate = date; this.updateDate = date; } }
Order { @PrePersist public void prePersist() { final Date date = new Date(); this.creationDate = date; this.updateDate = date; } Order();  Order( Set<OrderItem> items, Address deliveryAddress, Address billingAddress);  Order(User user, Set<OrderItem> items, Address deliveryAddress, Address billingAddress, OrderStatus status); }
Order { @PrePersist public void prePersist() { final Date date = new Date(); this.creationDate = date; this.updateDate = date; } Order();  Order( Set<OrderItem> items, Address deliveryAddress, Address billingAddress);  Order(User user, Set<OrderItem> items, Address deliveryAddress, Address billingAddress, OrderStatus status); @PrePersist void prePersist(); @PreUpdate void preUpdate(); @PostLoad @PostPersist @PostUpdate void computeOrderReference(); PaymentInfo getPaymentInfo(); void setPaymentInfo(PaymentInfo paymentInfo); User getUser(); void setUser(User user); Address getDeliveryAddress(); void setDeliveryAddress(Address deliveryAddress); Address getBillingAddress(); void setBillingAddress(Address billingAddress); Long getId(); void setId(Long id); OrderStatus getStatus(); void setStatus(OrderStatus status); Date getCreationDate(); void setCreationDate(Date creationDate); Date getUpdateDate(); Double getPrice(); void setPrice(Double price); void setUpdateDate(Date updateDate); String getTransactionId(); void setTransactionId(String transactionId); String getParcelTrackingKey(); void setParcelTrackingKey(String parcelTrackingKey); Date getDeliveryDate(); void setDeliveryDate(Date deliveryDate); Date getPaymentDate(); void setPaymentDate(Date paymentDate); Set<OrderItem> getItems(); void setItems(Set<OrderItem> items); Set<OrderDiscount> getOrderDiscounts(); void setOrderDiscounts(Set<OrderDiscount> orderDiscounts); Double getDeliveryFee(); void setDeliveryFee(Double deliveryFee); String getReference(); void setReference(String reference); Double getVat(); void setVat(Double vat); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Order { @PrePersist public void prePersist() { final Date date = new Date(); this.creationDate = date; this.updateDate = date; } Order();  Order( Set<OrderItem> items, Address deliveryAddress, Address billingAddress);  Order(User user, Set<OrderItem> items, Address deliveryAddress, Address billingAddress, OrderStatus status); @PrePersist void prePersist(); @PreUpdate void preUpdate(); @PostLoad @PostPersist @PostUpdate void computeOrderReference(); PaymentInfo getPaymentInfo(); void setPaymentInfo(PaymentInfo paymentInfo); User getUser(); void setUser(User user); Address getDeliveryAddress(); void setDeliveryAddress(Address deliveryAddress); Address getBillingAddress(); void setBillingAddress(Address billingAddress); Long getId(); void setId(Long id); OrderStatus getStatus(); void setStatus(OrderStatus status); Date getCreationDate(); void setCreationDate(Date creationDate); Date getUpdateDate(); Double getPrice(); void setPrice(Double price); void setUpdateDate(Date updateDate); String getTransactionId(); void setTransactionId(String transactionId); String getParcelTrackingKey(); void setParcelTrackingKey(String parcelTrackingKey); Date getDeliveryDate(); void setDeliveryDate(Date deliveryDate); Date getPaymentDate(); void setPaymentDate(Date paymentDate); Set<OrderItem> getItems(); void setItems(Set<OrderItem> items); Set<OrderDiscount> getOrderDiscounts(); void setOrderDiscounts(Set<OrderDiscount> orderDiscounts); Double getDeliveryFee(); void setDeliveryFee(Double deliveryFee); String getReference(); void setReference(String reference); Double getVat(); void setVat(Double vat); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final String ORDER_REF_SEPARATOR; }