From: Roland Häder Date: Sat, 28 Oct 2017 18:10:54 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c0ac483438232075bc1c5640a373e49e36dd2c76;p=jproduct-core.git Continued: - cleared no longer used project JARs - added new dependency as a product may have a manufacturing/producing company assigned, if such data is available on the product itself Signed-off-by: Roland Häder --- diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar new file mode 100644 index 0000000..edbddfa Binary files /dev/null and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar deleted file mode 100644 index 0b7e2f0..0000000 Binary files a/lib/jcontacts-core.jar and /dev/null differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar deleted file mode 100644 index e9744a4..0000000 Binary files a/lib/jcoreee.jar and /dev/null differ diff --git a/lib/jcustomer-core.jar b/lib/jcustomer-core.jar deleted file mode 100644 index f738001..0000000 Binary files a/lib/jcustomer-core.jar and /dev/null differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 5aa176c..de3ed3b 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -30,17 +30,13 @@ dist.jar=${dist.dir}/jproduct-core.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= -file.reference.jcontacts-core.jar=lib/jcontacts-core.jar -file.reference.jcoreee.jar=lib/jcoreee.jar -file.reference.jcustomer-core.jar=lib/jcustomer-core.jar +file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar includes=** jar.archive.disabled=${jnlp.enabled} jar.compress=false jar.index=${jnlp.enabled} javac.classpath=\ - ${file.reference.jcoreee.jar}:\ - ${file.reference.jcontacts-core.jar}:\ - ${file.reference.jcustomer-core.jar}:\ + ${file.reference.jcontacts-business-core.jar}:\ ${libs.javaee-api-7.0.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation @@ -94,8 +90,6 @@ run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} source.encoding=UTF-8 -source.reference.jcontacts-core.jar=../jcontacts-core/src/ -source.reference.jcoreee.jar=../jcoreee/src/ -source.reference.jcustomer-core.jar=../jcustomer-core/src/ +source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/ src.dir=src test.src.dir=test diff --git a/src/org/mxchange/jproduct/model/product/GenericProduct.java b/src/org/mxchange/jproduct/model/product/GenericProduct.java index f98e247..d3e2f9d 100644 --- a/src/org/mxchange/jproduct/model/product/GenericProduct.java +++ b/src/org/mxchange/jproduct/model/product/GenericProduct.java @@ -33,6 +33,8 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; +import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; import org.mxchange.jproduct.model.category.Category; import org.mxchange.jproduct.model.category.ProductCategory; @@ -101,6 +103,13 @@ public class GenericProduct implements Product { @Column (name = "product_id", nullable = false, updatable = false) private Long productId; + /** + * The company that has manufactured/produced this product + */ + @JoinColumn(name = "product_manufacturer_id", referencedColumnName = "company_data_id") + @OneToOne(targetEntity = BusinessBasicData.class, cascade = CascadeType.REFRESH) + private BasicData productManfacturer; + /** * Net price of product */ @@ -110,7 +119,7 @@ public class GenericProduct implements Product { /** * Tax rate (0-1, by 1=100%) */ - @Column (name = "product_gross_price") + @Column (name = "product_tax_rate") private Float productTaxRate; /** @@ -239,6 +248,16 @@ public class GenericProduct implements Product { this.productId = productId; } + @Override + public BasicData getProductManfacturer () { + return this.productManfacturer; + } + + @Override + public void setProductManfacturer (final BasicData productManfacturer) { + this.productManfacturer = productManfacturer; + } + @Override public Float getProductNetPrice () { return this.productNetPrice; diff --git a/src/org/mxchange/jproduct/model/product/Product.java b/src/org/mxchange/jproduct/model/product/Product.java index 4c54466..0dfcf7a 100644 --- a/src/org/mxchange/jproduct/model/product/Product.java +++ b/src/org/mxchange/jproduct/model/product/Product.java @@ -18,6 +18,7 @@ package org.mxchange.jproduct.model.product; import java.io.Serializable; import java.util.Date; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jproduct.model.category.Category; /** @@ -83,6 +84,20 @@ public interface Product extends Serializable { */ void setProductId (final Long productId); + /** + * Getter for manufacturing/producing company + *

+ * @return Manufacturing/producing company + */ + BasicData getProductManfacturer (); + + /** + * Setter for manufacturing/producing company + *

+ * @param productManfacturer Manufacturing/producing company + */ + void setProductManfacturer (final BasicData productManfacturer); + /** * Getter for product's net price *