From d3f71973e2b363d96c1be922e32f1f660ab188f7 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 25 Sep 2015 10:21:41 +0200 Subject: [PATCH] =?utf8?q?Continued:=20-=20renamed=20many=20fields/attribu?= =?utf8?q?tes=20to=20nicer=20names=20including=20database=20columns,=20get?= =?utf8?q?ters/setters=20-=20updated=20jar=20Signed-off-by:Roland=20H?= =?utf8?q?=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/jcoreee.jar | Bin 17542 -> 17745 bytes .../CategoryTitleAlreadyUsedException.java | 2 +- .../ProductTitleAlreadyUsedException.java | 2 +- .../model/basket/items/BaseItem.java | 6 +- .../jshopcore/model/category/Category.java | 4 +- .../model/category/ProductCategory.java | 20 ++-- .../jshopcore/model/order/Orderable.java | 4 +- .../jshopcore/model/order/ShopOrder.java | 12 +-- .../model/product/GenericProduct.java | 102 +++++++++--------- .../jshopcore/model/product/Product.java | 30 +++--- 10 files changed, 91 insertions(+), 91 deletions(-) diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 7b5dcd35bc09e8d300d9a88d15fc9ecce1151152..1b1ad2a1e6da411ce125c30ebcb4f0de5b875363 100644 GIT binary patch delta 2942 zcmai0TWnO<6@#!cj$dPA8$0;@20!p~z{Vbr!GJN?n5V(m1{>o5#&Mv5r0w7| zO=F;G+(Sz8Q7Ne$CvBvv>HJhwsZ<3iA8pg5Qv1=UA!()jL`cm?)dmI8wT~asq>?+D zd(S@S?(gMX&;il&KUzE9}>tFLs@nyLby3DFI<)F32l((#QQ=WI# z>Xgm|o#e_g^|x6cu2y=)WiNm4U2YGX(sFluIbOHx&;Oc?^|>#)eO2&a69TB#e@JY# znzXI@ePJj>kcw_Srb4OW|L(`N1y{H!d0KR`yHLNc3b&rJk%F)noi^ROY;4C4FS-?W zin&W(yA^tDBx8>aA9`)4i4i8YYvWLP@nUcdynCWgX0*|{pl6{ z6Bu@oi4lcS{l34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ik21+8~^zEbG;JYW7qlou4Z zO8AYjZK5+@X=AZF1^U-JmWbwG3+PfJqDQVL{Ndm5+^0_-Z5;q@|(Y2 z8?Er<#X>LeSf$B}HGJMQ;{g3LwR#<4N8_h7l8#gfFLP0|(Ufb*7H+XmfP(R&rU&BA zzn|ph088@;2X8b$4H>&S?;gT;5y9f#voudiZ#!uFXsV}7JLmqH{NGI6^W=JIzS*mt zuT?xkKk*jP`ONBBxw`%4xk?#YG|MTmp+-jZQh9kZZ>je;v41k>_@`gCzVZ^^vgDQ2 zeD7JBPc_nVs*SF;+z;@+gu#D``_IyROOQs>4O-M^GG!Xb8$EvW`Kay=#(ng5tcW)E LdW%kV$-Msol!^q4 diff --git a/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java index e9a1230..33db0d6 100644 --- a/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java +++ b/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java @@ -38,6 +38,6 @@ public class CategoryTitleAlreadyUsedException extends Exception { */ public CategoryTitleAlreadyUsedException (final Category category) { // Call super constructor - super(MessageFormat.format("Title {0} is already used.", category.getTitle())); //NOI18N + super(MessageFormat.format("Title {0} is already used.", category.getCategoryTitle())); //NOI18N } } diff --git a/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java index 278e681..0a1989a 100644 --- a/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java +++ b/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java @@ -38,6 +38,6 @@ public class ProductTitleAlreadyUsedException extends Exception { */ public ProductTitleAlreadyUsedException (final Product product) { // Call super constructor - super(MessageFormat.format("Title {0} is already used.", product.getTitle())); //NOI18N + super(MessageFormat.format("Title {0} is already used.", product.getProductTitle())); //NOI18N } } diff --git a/src/org/mxchange/jshopcore/model/basket/items/BaseItem.java b/src/org/mxchange/jshopcore/model/basket/items/BaseItem.java index d0e7901..e2ac620 100644 --- a/src/org/mxchange/jshopcore/model/basket/items/BaseItem.java +++ b/src/org/mxchange/jshopcore/model/basket/items/BaseItem.java @@ -44,7 +44,7 @@ public abstract class BaseItem implements AddableBasketItem, Comparable item.getProduct().getId()) { + } else if (this.getProduct().getProductId() > item.getProduct().getProductId()) { // This id is larger than compared to return -1; } @@ -68,14 +68,14 @@ public abstract class BaseItem implements AddableBasketItem, Comparable { * Title of category */ @Basic (optional = false) - @Column (name = "title", length = 100, nullable = false, unique = true) - private String title; + @Column (name = "category_title", length = 100, nullable = false, unique = true) + private String categoryTitle; /** * Constructor which accepts all database fields * * @param categoryId Id number of database record - * @param title Category title + * @param categoryTitle Category categoryTitle * @param parentCategory Parent category */ - public ProductCategory (final Long categoryId, final String title, final Category parentCategory) { + public ProductCategory (final Long categoryId, final String categoryTitle, final Category parentCategory) { // Set all here this.categoryId = categoryId; - this.title = title; + this.categoryTitle = categoryTitle; this.parentCategory = parentCategory; } @@ -107,7 +107,7 @@ public class ProductCategory implements Category, Comparable { public void copyAll (final Category category) { // Copy all data this.setParentCategory(category.getParentCategory()); - this.setTitle(category.getTitle()); + this.setCategoryTitle(category.getCategoryTitle()); } @Override @@ -131,12 +131,12 @@ public class ProductCategory implements Category, Comparable { } @Override - public String getTitle () { - return this.title; + public String getCategoryTitle () { + return this.categoryTitle; } @Override - public void setTitle (final String title) { - this.title = title; + public void setCategoryTitle (final String categoryTitle) { + this.categoryTitle = categoryTitle; } } diff --git a/src/org/mxchange/jshopcore/model/order/Orderable.java b/src/org/mxchange/jshopcore/model/order/Orderable.java index 4722d45..d490f6a 100644 --- a/src/org/mxchange/jshopcore/model/order/Orderable.java +++ b/src/org/mxchange/jshopcore/model/order/Orderable.java @@ -48,14 +48,14 @@ public interface Orderable extends Serializable { * * @return Created timestamp */ - public Calendar getCreated (); + public Calendar getOrderCreated (); /** * Setter for created timestamp * * @param created Created timestamp */ - public void setCreated (final Calendar created); + public void setOrderCreated (final Calendar created); /** * Getter for customer instance diff --git a/src/org/mxchange/jshopcore/model/order/ShopOrder.java b/src/org/mxchange/jshopcore/model/order/ShopOrder.java index addcf8d..57f25ce 100644 --- a/src/org/mxchange/jshopcore/model/order/ShopOrder.java +++ b/src/org/mxchange/jshopcore/model/order/ShopOrder.java @@ -60,8 +60,8 @@ public class ShopOrder implements Orderable { */ @Basic (optional = false) @Temporal (TemporalType.TIMESTAMP) - @Column (name = "created", nullable = false) - private Calendar created; + @Column (name = "order_created", nullable = false) + private Calendar orderCreated; /** * Customer instance @@ -95,13 +95,13 @@ public class ShopOrder implements Orderable { } @Override - public Calendar getCreated () { - return this.created; + public Calendar getOrderCreated () { + return this.orderCreated; } @Override - public void setCreated (final Calendar created) { - this.created = created; + public void setOrderCreated (final Calendar orderCreated) { + this.orderCreated = orderCreated; } @Override diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java index e794f21..99ba27c 100644 --- a/src/org/mxchange/jshopcore/model/product/GenericProduct.java +++ b/src/org/mxchange/jshopcore/model/product/GenericProduct.java @@ -44,15 +44,15 @@ public class GenericProduct implements Product, Comparable { /** * Availability of product */ - @Column (name = "available", nullable = false) - private Boolean available; + @Column (name = "product_availability", nullable = false) + private Boolean productAvailability; /** - * Product category + * Product productCategory */ @Basic (optional = false) @Column (name = "category_id", length = 20, nullable = false) - private Category category; + private Category productCategory; /** * Id number of product @@ -60,21 +60,21 @@ public class GenericProduct implements Product, Comparable { @Id @GeneratedValue (strategy = GenerationType.IDENTITY) @Column(name = "product_id", length = 20, nullable = false, updatable = false) - private Long id; + private Long productId; /** * Price of product */ @Basic (optional = false) - @Column (name = "price", nullable = false) - private Float price; + @Column (name = "product_price", nullable = false) + private Float productPrice; /** * Title of product */ @Basic (optional = false) - @Column (name = "title", length = 100, nullable = false) - private String title; + @Column (name = "product_title", length = 100, nullable = false) + private String productTitle; /** * Default constructor @@ -85,97 +85,97 @@ public class GenericProduct implements Product, Comparable { /** * Constructor will all required data * - * @param id Id number of product - * @param title Name of product - * @param price Price - * @param category Category instance - * @param available Availability (selectable by customer) + * @param productId Id number of product + * @param productTitle Name of product + * @param productPrice Price + * @param productCategory Category instance + * @param productAvailability Availability (selectable by customer) */ - public GenericProduct (final Long id, final String title, final Float price, final Category category, final Boolean available) { + public GenericProduct (final Long productId, final String productTitle, final Float productPrice, final Category productCategory, final Boolean productAvailability) { // Set all here - this.id = id; - this.title = title; - this.price = price; - this.category = category; - this.available = available; + this.productId = productId; + this.productTitle = productTitle; + this.productPrice = productPrice; + this.productCategory = productCategory; + this.productAvailability = productAvailability; } @Override public int compareTo (final Product product) { - // category should not be null + // productCategory should not be null if (null == product) { throw new NullPointerException("product is null"); //NOI18N } - // Is the id the same? - if (Objects.equals(this.getId(), product.getId())) { - // Same id, means same category + // Is the productId the same? + if (Objects.equals(this.getProductId(), product.getProductId())) { + // Same productId, means same productCategory return 0; - } else if (this.getId() > product.getId()) { - // This id is larger than compared to + } else if (this.getProductId() > product.getProductId()) { + // This productId is larger than compared to return 1; } - // The other id is larger + // The other productId is larger return -1; } @Override public void copyAll (final Product product) { // Copy all - this.setAvailable(product.getAvailable()); - this.setCategory(product.getCategory()); - this.setPrice(product.getPrice()); - this.setTitle(product.getTitle()); + this.setProductAvailability(product.getProductAvailability()); + this.setProductCategory(product.getProductCategory()); + this.setProductPrice(product.getProductPrice()); + this.setProductTitle(product.getProductTitle()); } @Override - public Boolean getAvailable () { - return this.available; + public Boolean getProductAvailability () { + return this.productAvailability; } @Override - public void setAvailable (final Boolean available) { - this.available = available; + public void setProductAvailability (final Boolean productAvailability) { + this.productAvailability = productAvailability; } @Override - public Category getCategory () { - return this.category; + public Category getProductCategory () { + return this.productCategory; } @Override - public void setCategory (final Category category) { - this.category = category; + public void setProductCategory (final Category productCategory) { + this.productCategory = productCategory; } @Override - public Long getId () { - return this.id; + public Long getProductId () { + return this.productId; } @Override - public void setId (final Long id) { - this.id = id; + public void setProductId (final Long productId) { + this.productId = productId; } @Override - public Float getPrice () { - return this.price; + public Float getProductPrice () { + return this.productPrice; } @Override - public void setPrice (final Float price) { - this.price = price; + public void setProductPrice (final Float productPrice) { + this.productPrice = productPrice; } @Override - public String getTitle () { - return this.title; + public String getProductTitle () { + return this.productTitle; } @Override - public void setTitle (final String title) { - this.title = title; + public void setProductTitle (final String productTitle) { + this.productTitle = productTitle; } } diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java index 5f00876..140dd70 100644 --- a/src/org/mxchange/jshopcore/model/product/Product.java +++ b/src/org/mxchange/jshopcore/model/product/Product.java @@ -38,68 +38,68 @@ public interface Product extends Serializable { * * @return Product availability */ - public Boolean getAvailable (); + public Boolean getProductAvailability (); /** * Setter for product availability * - * @param available Product availability + * @param productAvailability Product availability */ - public void setAvailable (final Boolean available); + public void setProductAvailability (final Boolean productAvailability); /** * Getter for product category id * * @return Product category id */ - public Category getCategory (); + public Category getProductCategory (); /** * Setter for product category * - * @param category Product category + * @param productCategory Product category */ - public void setCategory (final Category category); + public void setProductCategory (final Category productCategory); /** * Getter for id number, suitable for form fields. * * @return Id number of product */ - public Long getId (); + public Long getProductId (); /** * Id number of product * - * @param id the id number to set + * @param productId the id number to set */ - public void setId (final Long id); + public void setProductId (final Long productId); /** * Getter for raw price. * * @return Single price of product */ - public Float getPrice (); + public Float getProductPrice (); /** * Price of product * - * @param price the price to set + * @param productPrice the price to set */ - public void setPrice (final Float price); + public void setProductPrice (final Float productPrice); /** * Getter for title. * * @return Title of product */ - public String getTitle (); + public String getProductTitle (); /** * Title of product * - * @param title the title to set + * @param productTitle the title to set */ - public void setTitle (final String title); + public void setProductTitle (final String productTitle); } -- 2.39.2