]> git.mxchange.org Git - jshop-core.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 08:21:41 +0000 (10:21 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 25 Sep 2015 08:21:41 +0000 (10:21 +0200)
- renamed many fields/attributes to nicer names including database columns, getters/setters
- updated jar
Signed-off-by:Roland Häder <roland@mxchange.org>

lib/jcoreee.jar
src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java
src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java
src/org/mxchange/jshopcore/model/basket/items/BaseItem.java
src/org/mxchange/jshopcore/model/category/Category.java
src/org/mxchange/jshopcore/model/category/ProductCategory.java
src/org/mxchange/jshopcore/model/order/Orderable.java
src/org/mxchange/jshopcore/model/order/ShopOrder.java
src/org/mxchange/jshopcore/model/product/GenericProduct.java
src/org/mxchange/jshopcore/model/product/Product.java

index 7b5dcd35bc09e8d300d9a88d15fc9ecce1151152..1b1ad2a1e6da411ce125c30ebcb4f0de5b875363 100644 (file)
Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ
index e9a1230beb347b7b27b37f56b26702fdf18cf99a..33db0d6513260280a0c89d8c486c8e7ba98c78ee 100644 (file)
@@ -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
        }
 }
index 278e6811e37f6aa875be8c0d0f8a3a3f3b8afefb..0a1989a69a680ad632ddd4be2582bdc0c4fba8d6 100644 (file)
@@ -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
        }
 }
index d0e790144df5ce34385a4266353d3bfe88589d74..e2ac6208110d2cd239322b94d51621117db094c6 100644 (file)
@@ -44,7 +44,7 @@ public abstract class BaseItem implements AddableBasketItem, Comparable<AddableB
                if (Objects.equals(this.getProduct(), item.getProduct())) {
                        // Same id, means same item
                        return 0;
-               } else if (this.getProduct().getId() > 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<AddableB
                AddableBasketItem item = (AddableBasketItem) object;
 
                // Item id and type must be the same
-               return ((Objects.equals(item.getProduct().getId(), this.getProduct().getId()))
+               return ((Objects.equals(item.getProduct().getProductId(), this.getProduct().getProductId()))
                                && (Objects.equals(item.getItemType(), this.getItemType())));
        }
 
        @Override
        public int hashCode () {
                int hash = 5;
-               hash = 29 * hash + Objects.hashCode(this.getProduct().getId());
+               hash = 29 * hash + Objects.hashCode(this.getProduct().getProductId());
                hash = 29 * hash + Objects.hashCode(this.getItemType());
                return hash;
        }
index c20acbc54c9e657e4ae9d5c1cd8daf6118335925..5b47563bb2d9b323537782774984ef75ba8b5bbb 100644 (file)
@@ -65,12 +65,12 @@ public interface Category extends Serializable {
         *
         * @return the title
         */
-       public String getTitle ();
+       public String getCategoryTitle ();
 
        /**
         * Title of category
         *
         * @param title the title to set
         */
-       public void setTitle (final String title);
+       public void setCategoryTitle (final String title);
 }
index 65a40c8bf26959643e4a0562e56a23e79217e8a7..3b0923e8f50cba5e749e604d3bf2ec70c262975a 100644 (file)
@@ -60,20 +60,20 @@ public class ProductCategory implements Category, Comparable<Category> {
         * 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<Category> {
        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<Category> {
        }
 
        @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;
        }
 }
index 4722d455c3315f418609cb1963e40430dcb31d3a..d490f6ac50eae4b11f809791f48af601222c2b48 100644 (file)
@@ -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
index addcf8de0058c8069849695d4dc9c2b33df142e7..57f25ce6f8f00798ec679cea53822ce49b055d4f 100644 (file)
@@ -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
index e794f2142e41534e720f3ab04f04321c14b1f3b4..99ba27c699ab783dd8068598329d62317b935f0c 100644 (file)
@@ -44,15 +44,15 @@ public class GenericProduct implements Product, Comparable<Product> {
        /**
         * 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<Product> {
        @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<Product> {
        /**
         * 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;
        }
 }
index 5f0087602632840d26c75498ca73ca7db5b6717f..140dd70c63ed4f5902cee81c2963d17dfbc4382d 100644 (file)
@@ -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);
 }