From: Roland Häder Date: Sun, 19 Apr 2020 06:17:39 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=679d45847ca887acf2bfe2a6ac2fe6c117fc585c;p=jproduct-core.git Continued: - renamed productCreated to productEntryCreated - added property productEntryUpdated Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jproduct/model/product/GenericProduct.java b/src/org/mxchange/jproduct/model/product/GenericProduct.java index ec94a22..6ff6e9e 100644 --- a/src/org/mxchange/jproduct/model/product/GenericProduct.java +++ b/src/org/mxchange/jproduct/model/product/GenericProduct.java @@ -107,20 +107,27 @@ public class GenericProduct implements Product { @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH, optional = false) private Category productCategory; + /** + * Currency code for both prices, like EUR or USD + */ + @Basic (optional = false) + @Column (name = "product_currency_code", nullable = false, length = 3) + private String productCurrencyCode; + /** * When this product has been created */ @Basic (optional = false) - @Column (name = "product_created", nullable = false, updatable = false) + @Column (name = "product_entry_created", nullable = false, updatable = false) @Temporal (TemporalType.TIMESTAMP) - private Date productCreated; + private Date productEntryCreated; /** - * Currency code for both prices, like EUR or USD + * When this product has been created */ - @Basic (optional = false) - @Column (name = "product_currency_code", nullable = false, length = 3) - private String productCurrencyCode; + @Column (name = "product_entry_updated", insertable = false) + @Temporal (TemporalType.TIMESTAMP) + private Date productEntryUpdated; /** * Gross price of product @@ -382,26 +389,38 @@ public class GenericProduct implements Product { this.productCategory = productCategory; } + @Override + public String getProductCurrencyCode () { + return this.productCurrencyCode; + } + + @Override + public void setProductCurrencyCode (final String productCurrencyCode) { + this.productCurrencyCode = productCurrencyCode; + } + @Override @SuppressWarnings ("ReturnOfDateField") - public Date getProductCreated () { - return this.productCreated; + public Date getProductEntryCreated () { + return this.productEntryCreated; } @Override @SuppressWarnings ("AssignmentToDateFieldFromParameter") - public void setProductCreated (final Date productCreated) { - this.productCreated = productCreated; + public void setProductEntryCreated (final Date productEntryCreated) { + this.productEntryCreated = productEntryCreated; } @Override - public String getProductCurrencyCode () { - return this.productCurrencyCode; + @SuppressWarnings ("ReturnOfDateField") + public Date getProductEntryUpdated () { + return this.productEntryUpdated; } @Override - public void setProductCurrencyCode (final String productCurrencyCode) { - this.productCurrencyCode = productCurrencyCode; + @SuppressWarnings ("AssignmentToDateFieldFromParameter") + public void setProductEntryUpdated (final Date productEntryUpdated) { + this.productEntryUpdated = productEntryUpdated; } @Override diff --git a/src/org/mxchange/jproduct/model/product/Product.java b/src/org/mxchange/jproduct/model/product/Product.java index 2dce9d7..e14ef94 100644 --- a/src/org/mxchange/jproduct/model/product/Product.java +++ b/src/org/mxchange/jproduct/model/product/Product.java @@ -49,14 +49,28 @@ public interface Product extends Comparable, Serializable { *

* @return Created timestamp */ - Date getProductCreated (); + Date getProductEntryCreated (); /** * Setter for created timestamp *

- * @param productCreated Created timestamp + * @param productEntryCreated Created timestamp */ - void setProductCreated (final Date productCreated); + void setProductEntryCreated (final Date productEntryCreated); + + /** + * Getter for updated timestamp + *

+ * @return Updated timestamp + */ + Date getProductEntryUpdated (); + + /** + * Setter for updated timestamp + *

+ * @param productEntryUpdated Updated timestamp + */ + void setProductEntryUpdated (final Date productEntryCreated); /** * Getter for product availability