<copyfiles files="${file.reference.jphone-core.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jphone-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jcontacts-core.jar}" todir="${build.classes.dir}"/>
+ <copyfiles files="${file.reference.jcontacts-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jcontacts-business-core.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jcontacts-business-lib.jar}" todir="${build.classes.dir}"/>
- <copyfiles files="${file.reference.jcontacts-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jproduct-core.jar}" todir="${build.classes.dir}"/>
+ <copyfiles files="${file.reference.jcustomer-core.jar}" todir="${build.classes.dir}"/>
+ <copyfiles files="${file.reference.jcustomer-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jproduct-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.juser-core.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.juser-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.juser-login-core.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.juser-login-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.juser-activity-core.jar}" todir="${build.classes.dir}"/>
+ <copyfiles files="${file.reference.juser-activity-lib.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${file.reference.jmailer-ee.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${reference.jfinancials-core.jar}" todir="${build.classes.dir}"/>
<copyfiles files="${reference.jfinancials-lib.jar}" todir="${build.classes.dir}"/>
<basename file="${file.reference.jphone-core.jar}" property="manifest.file.reference.jphone-core.jar"/>
<basename file="${file.reference.jphone-lib.jar}" property="manifest.file.reference.jphone-lib.jar"/>
<basename file="${file.reference.jcontacts-core.jar}" property="manifest.file.reference.jcontacts-core.jar"/>
+ <basename file="${file.reference.jcontacts-lib.jar}" property="manifest.file.reference.jcontacts-lib.jar"/>
<basename file="${file.reference.jcontacts-business-core.jar}" property="manifest.file.reference.jcontacts-business-core.jar"/>
<basename file="${file.reference.jcontacts-business-lib.jar}" property="manifest.file.reference.jcontacts-business-lib.jar"/>
- <basename file="${file.reference.jcontacts-lib.jar}" property="manifest.file.reference.jcontacts-lib.jar"/>
<basename file="${file.reference.jproduct-core.jar}" property="manifest.file.reference.jproduct-core.jar"/>
+ <basename file="${file.reference.jcustomer-core.jar}" property="manifest.file.reference.jcustomer-core.jar"/>
+ <basename file="${file.reference.jcustomer-lib.jar}" property="manifest.file.reference.jcustomer-lib.jar"/>
<basename file="${file.reference.jproduct-lib.jar}" property="manifest.file.reference.jproduct-lib.jar"/>
<basename file="${file.reference.juser-core.jar}" property="manifest.file.reference.juser-core.jar"/>
<basename file="${file.reference.juser-lib.jar}" property="manifest.file.reference.juser-lib.jar"/>
<basename file="${file.reference.juser-login-core.jar}" property="manifest.file.reference.juser-login-core.jar"/>
<basename file="${file.reference.juser-login-lib.jar}" property="manifest.file.reference.juser-login-lib.jar"/>
<basename file="${file.reference.juser-activity-core.jar}" property="manifest.file.reference.juser-activity-core.jar"/>
+ <basename file="${file.reference.juser-activity-lib.jar}" property="manifest.file.reference.juser-activity-lib.jar"/>
<basename file="${file.reference.jmailer-ee.jar}" property="manifest.file.reference.jmailer-ee.jar"/>
<basename file="${reference.jfinancials-core.jar}" property="manifest.reference.jfinancials-core.jar"/>
<basename file="${reference.jfinancials-lib.jar}" property="manifest.reference.jfinancials-lib.jar"/>
<basename file="${reference.jfinancials-mailer-lib.jar}" property="manifest.reference.jfinancials-mailer-lib.jar"/>
<basename file="${file.reference.cdi-api.jar}" property="manifest.file.reference.cdi-api.jar"/>
<manifest file="${build.ear.classes.dir}/META-INF/MANIFEST.MF" mode="update">
- <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 jar-7 jar-8 jar-9 jar-10 jar-11 jar-12 jar-13 jar-14 jar-15 jar-16 jar-17 jar-18 jar-19 jar-20 jar-21 jar-22 "/>
+ <attribute name="Extension-List" value="jar-1 jar-2 jar-3 jar-4 jar-5 jar-6 jar-7 jar-8 jar-9 jar-10 jar-11 jar-12 jar-13 jar-14 jar-15 jar-16 jar-17 jar-18 jar-19 jar-20 jar-21 jar-22 jar-23 jar-24 jar-25 "/>
<attribute name="jar-1-Extension-Name" value="${manifest.file.reference.jcoreee.jar}"/>
<attribute name="jar-2-Extension-Name" value="${manifest.file.reference.jcore-logger-lib.jar}"/>
<attribute name="jar-3-Extension-Name" value="${manifest.file.reference.jcountry-core.jar}"/>
<attribute name="jar-5-Extension-Name" value="${manifest.file.reference.jphone-core.jar}"/>
<attribute name="jar-6-Extension-Name" value="${manifest.file.reference.jphone-lib.jar}"/>
<attribute name="jar-7-Extension-Name" value="${manifest.file.reference.jcontacts-core.jar}"/>
- <attribute name="jar-8-Extension-Name" value="${manifest.file.reference.jcontacts-business-core.jar}"/>
- <attribute name="jar-9-Extension-Name" value="${manifest.file.reference.jcontacts-business-lib.jar}"/>
- <attribute name="jar-10-Extension-Name" value="${manifest.file.reference.jcontacts-lib.jar}"/>
+ <attribute name="jar-8-Extension-Name" value="${manifest.file.reference.jcontacts-lib.jar}"/>
+ <attribute name="jar-9-Extension-Name" value="${manifest.file.reference.jcontacts-business-core.jar}"/>
+ <attribute name="jar-10-Extension-Name" value="${manifest.file.reference.jcontacts-business-lib.jar}"/>
<attribute name="jar-11-Extension-Name" value="${manifest.file.reference.jproduct-core.jar}"/>
- <attribute name="jar-12-Extension-Name" value="${manifest.file.reference.jproduct-lib.jar}"/>
- <attribute name="jar-13-Extension-Name" value="${manifest.file.reference.juser-core.jar}"/>
- <attribute name="jar-14-Extension-Name" value="${manifest.file.reference.juser-lib.jar}"/>
- <attribute name="jar-15-Extension-Name" value="${manifest.file.reference.juser-login-core.jar}"/>
- <attribute name="jar-16-Extension-Name" value="${manifest.file.reference.juser-login-lib.jar}"/>
- <attribute name="jar-17-Extension-Name" value="${manifest.file.reference.juser-activity-core.jar}"/>
- <attribute name="jar-18-Extension-Name" value="${manifest.file.reference.jmailer-ee.jar}"/>
- <attribute name="jar-19-Extension-Name" value="${manifest.reference.jfinancials-core.jar}"/>
- <attribute name="jar-20-Extension-Name" value="${manifest.reference.jfinancials-lib.jar}"/>
- <attribute name="jar-21-Extension-Name" value="${manifest.reference.jfinancials-mailer-lib.jar}"/>
- <attribute name="jar-22-Extension-Name" value="${manifest.file.reference.cdi-api.jar}"/>
+ <attribute name="jar-12-Extension-Name" value="${manifest.file.reference.jcustomer-core.jar}"/>
+ <attribute name="jar-13-Extension-Name" value="${manifest.file.reference.jcustomer-lib.jar}"/>
+ <attribute name="jar-14-Extension-Name" value="${manifest.file.reference.jproduct-lib.jar}"/>
+ <attribute name="jar-15-Extension-Name" value="${manifest.file.reference.juser-core.jar}"/>
+ <attribute name="jar-16-Extension-Name" value="${manifest.file.reference.juser-lib.jar}"/>
+ <attribute name="jar-17-Extension-Name" value="${manifest.file.reference.juser-login-core.jar}"/>
+ <attribute name="jar-18-Extension-Name" value="${manifest.file.reference.juser-login-lib.jar}"/>
+ <attribute name="jar-19-Extension-Name" value="${manifest.file.reference.juser-activity-core.jar}"/>
+ <attribute name="jar-20-Extension-Name" value="${manifest.file.reference.juser-activity-lib.jar}"/>
+ <attribute name="jar-21-Extension-Name" value="${manifest.file.reference.jmailer-ee.jar}"/>
+ <attribute name="jar-22-Extension-Name" value="${manifest.reference.jfinancials-core.jar}"/>
+ <attribute name="jar-23-Extension-Name" value="${manifest.reference.jfinancials-lib.jar}"/>
+ <attribute name="jar-24-Extension-Name" value="${manifest.reference.jfinancials-mailer-lib.jar}"/>
+ <attribute name="jar-25-Extension-Name" value="${manifest.file.reference.cdi-api.jar}"/>
</manifest>
</target>
<target depends="compile" name="library-inclusion-in-manifest">
<copyfiles files="${file.reference.jphone-core.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jphone-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-core.jar}" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jcontacts-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-business-core.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jcontacts-business-lib.jar}" todir="${dist.ear.dir}/lib"/>
- <copyfiles files="${file.reference.jcontacts-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jproduct-core.jar}" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jcustomer-core.jar}" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.jcustomer-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jproduct-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.juser-core.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.juser-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.juser-login-core.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.juser-login-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.juser-activity-core.jar}" todir="${dist.ear.dir}/lib"/>
+ <copyfiles files="${file.reference.juser-activity-lib.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${file.reference.jmailer-ee.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${reference.jfinancials-core.jar}" todir="${dist.ear.dir}/lib"/>
<copyfiles files="${reference.jfinancials-lib.jar}" todir="${dist.ear.dir}/lib"/>
excludes=
file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar
file.reference.jcontacts-business-lib.jar=lib/jcontacts-business-lib.jar
+file.reference.jcustomer-core.jar=lib/jcustomer-core.jar
+file.reference.jcustomer-lib.jar=lib/jcustomer-lib.jar
file.reference.jfinancials-mailer.jar=lib/jfinancials-mailer.jar
file.reference.cdi-api.jar=lib/cdi-api.jar
file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
file.reference.jproduct-core.jar=lib/jproduct-core.jar
file.reference.jproduct-lib.jar=lib/jproduct-lib.jar
file.reference.juser-activity-core.jar=lib/juser-activity-core.jar
+file.reference.juser-activity-lib.jar=lib/juser-activity-lib.jar
file.reference.juser-core.jar=lib/juser-core.jar
file.reference.juser-lib.jar=lib/juser-lib.jar
file.reference.juser-login-core.jar=lib/juser-login-core.jar
j2ee.compile.on.save=true
j2ee.deploy.on.save=true
j2ee.platform=1.7
-j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
+j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.enterprise-api.jar:${j2ee.server.home}/modules/javax.security.enterprise.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/cdi-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar
j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar
j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar
${file.reference.jphone-core.jar}:\
${file.reference.jphone-lib.jar}:\
${file.reference.jcontacts-core.jar}:\
+ ${file.reference.jcontacts-lib.jar}:\
${file.reference.jcontacts-business-core.jar}:\
${file.reference.jcontacts-business-lib.jar}:\
- ${file.reference.jcontacts-lib.jar}:\
${file.reference.jproduct-core.jar}:\
+ ${file.reference.jcustomer-core.jar}:\
+ ${file.reference.jcustomer-lib.jar}:\
${file.reference.jproduct-lib.jar}:\
${file.reference.juser-core.jar}:\
${file.reference.juser-lib.jar}:\
${file.reference.juser-login-core.jar}:\
${file.reference.juser-login-lib.jar}:\
${file.reference.juser-activity-core.jar}:\
+ ${file.reference.juser-activity-lib.jar}:\
${file.reference.jmailer-ee.jar}:\
${reference.jfinancials-core.jar}:\
${reference.jfinancials-lib.jar}:\
source.encoding=UTF-8
source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/
source.reference.jcontacts-business-lib.jar=../jcontacts-business-lib/src/
+source.reference.jcustomer-core.jar=../jcustomer-core/src/
+source.reference.jcustomer-lib.jar=../jcustomer-lib/src/
source.reference.jfinancials-mailer.jar=../jfinancials-mailer/src/
source.reference.jcontacts-core.jar=../jcontacts-core/src/
source.reference.jcontacts-lib.jar=../jcontacts-lib/src/
source.reference.jproduct-core.jar=../jproduct-core/src/
source.reference.jproduct-lib.jar=../jproduct-lib/src/
source.reference.juser-activity-core.jar=../juser-activity-core/src/
+source.reference.juser-activity-lib.jar=../juser-activity-lib/src/
source.reference.juser-core.jar=../juser-core/src/
source.reference.juser-lib.jar=../juser-lib/src/
source.reference.juser-login-core.jar=../juser-login-core/src/
<included-library dirs="200">file.reference.jphone-core.jar</included-library>
<included-library dirs="200">file.reference.jphone-lib.jar</included-library>
<included-library dirs="200">file.reference.jcontacts-core.jar</included-library>
+ <included-library dirs="200">file.reference.jcontacts-lib.jar</included-library>
<included-library dirs="200">file.reference.jcontacts-business-core.jar</included-library>
<included-library dirs="200">file.reference.jcontacts-business-lib.jar</included-library>
- <included-library dirs="200">file.reference.jcontacts-lib.jar</included-library>
<included-library dirs="200">file.reference.jproduct-core.jar</included-library>
+ <included-library dirs="200">file.reference.jcustomer-core.jar</included-library>
+ <included-library dirs="200">file.reference.jcustomer-lib.jar</included-library>
<included-library dirs="200">file.reference.jproduct-lib.jar</included-library>
<included-library dirs="200">file.reference.juser-core.jar</included-library>
<included-library dirs="200">file.reference.juser-lib.jar</included-library>
<included-library dirs="200">file.reference.juser-login-core.jar</included-library>
<included-library dirs="200">file.reference.juser-login-lib.jar</included-library>
<included-library dirs="200">file.reference.juser-activity-core.jar</included-library>
+ <included-library dirs="200">file.reference.juser-activity-lib.jar</included-library>
<included-library dirs="200">file.reference.jmailer-ee.jar</included-library>
<included-library dirs="200">reference.jfinancials-core.jar</included-library>
<included-library dirs="200">reference.jfinancials-lib.jar</included-library>
<class>org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice</class>
<class>org.mxchange.jcontactsbusiness.model.department.BusinessDepartment</class>
<class>org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee</class>
- <class>org.mxchange.jcontactsbusiness.model.headquarters.BusinessHeadquarters</class>
+ <class>org.mxchange.jcontactsbusiness.model.headquarter.BusinessHeadquarter</class>
<class>org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition</class>
<class>org.mxchange.jcontactsbusiness.model.logo.BusinessLogo</class>
<class>org.mxchange.jcontactsbusiness.model.opening_time.BusinessOpeningTime</class>
<class>org.mxchange.jusercore.model.user.LoginUser</class>
<class>org.mxchange.jusercore.model.user.activity.UserActivityLog</class>
<class>org.mxchange.jusercore.model.user.password_history.UserPasswordHistory</class>
+ <class>org.mxchange.jcustomercore.model.customer.ContactCustomer</class>
+ <class>org.mxchange.jfinancials.model.bonus_card.FinancialBonusCard</class>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
/*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import javax.mail.internet.InternetAddress;
import org.mxchange.jcontacts.model.contact.Contact;
import org.mxchange.jcontacts.model.contact.ContactUtils;
-import org.mxchange.jcontacts.model.contact.UserContact;
import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
+import org.mxchange.jcontactsbusiness.model.department.Department;
import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarters.BusinessHeadquarters;
-import org.mxchange.jcontactsbusiness.model.headquarters.Headquarter;
+import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jcountry.model.data.CountryData;
+import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
import org.mxchange.jphone.utils.PhoneUtils;
-import org.mxchange.jusercore.model.user.LoginUser;
import org.mxchange.jusercore.model.user.User;
import org.mxchange.jusercore.model.user.UserUtils;
* <p>
* @author Roland Häder<roland@mxchange.org>
*/
-public abstract class BaseFinancialsDatabaseBean extends BaseDatabaseBean {
+public abstract class BaseFinancialsDatabaseBean extends BaseEnterpriseBean {
/**
* Serial number
throw new NullPointerException("contact is null"); //NOI18N
} else if (contact.getContactId() == null) {
// Id is set
- throw new NullPointerException("contact.contactId is null"); //NOI18N
+ throw new NullPointerException("contact.branchId is null"); //NOI18N
} else if (contact.getContactId() < 1) {
// Id is set
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is invalid", contact.getContactId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("contact.branchId={0} is invalid", contact.getContactId())); //NOI18N
}
// Try to find it (should be there)
- final Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());
+ final Contact managedContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
// Should be there
assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
}
// Try to find it (should be there)
- final Country managedCountry = this.getEntityManager().find(CountryData.class, country.getCountryId());
+ final Country managedCountry = this.getEntityManager().find(country.getClass(), country.getCountryId());
// Should be there
assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
}
// Try to find it (should be there)
- final BasicData managedBasicData = this.getEntityManager().find(BusinessBasicData.class, basicData.getBasicDataId());
+ final BasicData managedBasicData = this.getEntityManager().find(basicData.getClass(), basicData.getBasicDataId());
// Should be there
assert (managedBasicData instanceof BasicData) : "managedBasicData is null"; //NOI18N
/**
* Get back a managed instance from given branch office
* <p>
- * @param headquarter Unmanaged/detached branch office instance
+ * @param branchOffice Unmanaged/detached branch office instance
* <p>
- * @return Managed basic data instance
+ * @return Managed branch office instance
*/
- protected BranchOffice createManaged (final BranchOffice headquarter) {
+ protected BranchOffice createManaged (final BranchOffice branchOffice) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: branchOffice={1} - CALLED!", this.getClass().getSimpleName(), branchOffice)); //NOI18N
// user should not be null
- if (null == headquarter) {
+ if (null == branchOffice) {
// Abort here
- throw new NullPointerException("headquarter is null"); //NOI18N
- } else if (headquarter.getBranchId() == null) {
+ throw new NullPointerException("branchOffice is null"); //NOI18N
+ } else if (branchOffice.getBranchId() == null) {
// Id is set
- throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
- } else if (headquarter.getBranchId() < 1) {
+ throw new NullPointerException("branchOffice.branchId is null"); //NOI18N
+ } else if (branchOffice.getBranchId() < 1) {
// Id is set
- throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getBranchId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("branchOffice.branchId={0} is invalid", branchOffice.getBranchId())); //NOI18N
}
// Try to find it (should be there)
- final BranchOffice managedBranchOffice = this.getEntityManager().find(BusinessBranchOffice.class, headquarter.getBranchId());
+ final BranchOffice managedBranchOffice = this.getEntityManager().find(branchOffice.getClass(), branchOffice.getBranchId());
// Should be there
- assert (managedBranchOffice instanceof BasicData) : "managedBranchOffice is null"; //NOI18N
+ assert (managedBranchOffice instanceof BranchOffice) : "managedBranchOffice is null"; //NOI18N
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedBranchOffice={1} - EXIT!", this.getClass().getSimpleName(), managedBranchOffice)); //NOI18N
return managedBranchOffice;
}
+ /**
+ * Get back a managed instance from given department
+ * <p>
+ * @param department Unmanaged/detached department instance
+ * <p>
+ * @return Managed department instance
+ */
+ protected Department createManaged (final Department department) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: department={1} - CALLED!", this.getClass().getSimpleName(), department)); //NOI18N
+
+ // user should not be null
+ if (null == department) {
+ // Abort here
+ throw new NullPointerException("department is null"); //NOI18N
+ } else if (department.getDepartmentId() == null) {
+ // Id is set
+ throw new NullPointerException("department.departmentId is null"); //NOI18N
+ } else if (department.getDepartmentId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("department.departmentId={0} is invalid", department.getDepartmentId())); //NOI18N
+ }
+
+ // Try to find it (should be there)
+ final Department managedDepartment = this.getEntityManager().find(department.getClass(), department.getDepartmentId());
+
+ // Should be there
+ assert (managedDepartment instanceof Department) : "managedDepartment is null"; //NOI18N
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedDepartment={1} - EXIT!", this.getClass().getSimpleName(), managedDepartment)); //NOI18N
+
+ // Return it
+ return managedDepartment;
+ }
+
/**
* Get back a managed instance from given employee
* <p>
}
// Try to find it (should be there)
- final Employable managedEmployee = this.getEntityManager().find(BusinessEmployee.class, employee.getEmployeeId());
+ final Employable managedEmployee = this.getEntityManager().find(employee.getClass(), employee.getEmployeeId());
// Should be there
assert (managedEmployee instanceof Employable) : "managedEmployee is null"; //NOI18N
}
/**
- * Get back a managed instance from given headquarters
+ * Get back a managed instance from given headquarter
* <p>
- * @param headquarters Unmanaged/detached headquarters instance
+ * @param headquarter Unmanaged/detached headquarter instance
* <p>
* @return Managed basic data instance
*/
- protected Headquarter createManaged (final Headquarter headquarters) {
+ protected Headquarter createManaged (final Headquarter headquarter) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarters)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
// user should not be null
- if (null == headquarters) {
+ if (null == headquarter) {
// Abort here
throw new NullPointerException("headquarter is null"); //NOI18N
- } else if (headquarters.getHeadquartersId() == null) {
+ } else if (headquarter.getHeadquarterId() == null) {
+ // Id is set
+ throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
+ } else if (headquarter.getHeadquarterId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getHeadquarterId())); //NOI18N
+ }
+
+ // Try to find it (should be there)
+ final Headquarter managedHeadquarter = this.getEntityManager().find(headquarter.getClass(), headquarter.getHeadquarterId());
+
+ // Should be there
+ assert (managedHeadquarter instanceof BasicData) : "managedHeadquarter is null"; //NOI18N
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarter={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarter)); //NOI18N
+
+ // Return it
+ return managedHeadquarter;
+ }
+
+ /**
+ * Get back a managed instance from given job position
+ * <p>
+ * @param jobPosition Unmanaged/detached job position instance
+ * <p>
+ * @return Managed job position instance
+ */
+ protected JobPosition createManaged (final JobPosition jobPosition) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
+
+ // user should not be null
+ if (null == jobPosition) {
+ // Abort here
+ throw new NullPointerException("jobPosition is null"); //NOI18N
+ } else if (jobPosition.getJobPositionId() == null) {
+ // Id is set
+ throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
+ } else if (jobPosition.getJobPositionId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
+ }
+
+ // Try to find it (should be there)
+ final JobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
+
+ // Should be there
+ assert (managedJobPosition instanceof JobPosition) : "managedJobPosition is null"; //NOI18N
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
+
+ // Return it
+ return managedJobPosition;
+ }
+
+ /**
+ * Get back a managed instance from given mobile provider
+ * <p>
+ * @param mobileProvider Unmanaged/detached mobile provider instance
+ * <p>
+ * @return Managed mobile provider instance
+ */
+ protected MobileProvider createManaged (final MobileProvider mobileProvider) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: mobileProvider={1} - CALLED!", this.getClass().getSimpleName(), mobileProvider)); //NOI18N
+
+ // user should not be null
+ if (null == mobileProvider) {
+ // Abort here
+ throw new NullPointerException("mobileProvider is null"); //NOI18N
+ } else if (mobileProvider.getProviderId() == null) {
// Id is set
- throw new NullPointerException("headquarter.headquartersId is null"); //NOI18N
- } else if (headquarters.getHeadquartersId() < 1) {
+ throw new NullPointerException("mobileProvider.providerId is null"); //NOI18N
+ } else if (mobileProvider.getProviderId() < 1) {
// Id is set
- throw new IllegalArgumentException(MessageFormat.format("headquarter.headquartersId={0} is invalid", headquarters.getHeadquartersId())); //NOI18N
+ throw new IllegalArgumentException(MessageFormat.format("mobileProvider.providerId={0} is invalid", mobileProvider.getProviderId())); //NOI18N
}
// Try to find it (should be there)
- final Headquarter managedHeadquarters = this.getEntityManager().find(BusinessHeadquarters.class, headquarters.getHeadquartersId());
+ final MobileProvider managedMobileProvider = this.getEntityManager().find(mobileProvider.getClass(), mobileProvider.getProviderId());
// Should be there
- assert (managedHeadquarters instanceof BasicData) : "managedHeadquarters is null"; //NOI18N
+ assert (managedMobileProvider instanceof MobileProvider) : "managedMobileProvider is null"; //NOI18N
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarters={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarters)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedMobileProvider={1} - EXIT!", this.getClass().getSimpleName(), managedMobileProvider)); //NOI18N
// Return it
- return managedHeadquarters;
+ return managedMobileProvider;
}
/**
}
// Try to find it (should be there)
- final User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
+ final User managedUser = this.getEntityManager().find(user.getClass(), user.getUserId());
// Should be there
assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
return managedUser;
}
+ /**
+ * Get back a managed instance from given receipt
+ * <p>
+ * @param receipt Unmanaged/detached receipt instance
+ * <p>
+ * @return Managed receipt instance
+ */
+ protected BillableReceipt createManaged (final BillableReceipt receipt) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: receipt={1} - CALLED!", this.getClass().getSimpleName(), receipt)); //NOI18N
+
+ // receipt should not be null
+ if (null == receipt) {
+ // Abort here
+ throw new NullPointerException("receipt is null"); //NOI18N
+ } else if (receipt.getReceiptId() == null) {
+ // Id is set
+ throw new NullPointerException("receipt.receiptId is null"); //NOI18N
+ } else if (receipt.getReceiptId() < 1) {
+ // Id is set
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptId={0} is invalid", receipt.getReceiptId())); //NOI18N
+ } else if (receipt.getReceiptBranchOffice() == null) {
+ // Throw NPE again
+ throw new NullPointerException("receipt.receiptBranchOffice is null"); //NOI18N
+ } else if (receipt.getReceiptBranchOffice().getBranchId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("receipt.receiptBranchOffice.contactId is null"); //NOI18N
+ } else if (receipt.getReceiptBranchOffice().getBranchId() < 1) {
+ // Not valid id number
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptBranchOffice.contactId={0} is not valid", receipt.getReceiptBranchOffice().getBranchId())); //NOI18N#
+ }
+
+ // Try to find it (should be there)
+ final BillableReceipt managedReceipt = this.getEntityManager().find(receipt.getClass(), receipt.getReceiptId());
+
+ // Should be there
+ assert (managedReceipt instanceof BillableReceipt) : "managedReceipt is null"; //NOI18N
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedReceipt={1} - EXIT!", this.getClass().getSimpleName(), managedReceipt)); //NOI18N
+
+ // Return it
+ return managedReceipt;
+ }
+
/**
* Sets created timestamp on all opening times.
* <p>
// Validate parameter
if (null == openingTimes) {
// Throw NPE
- throw new NullPointerException("openingTimes is null");
+ throw new NullPointerException("openingTimes is null"); //NOI18N
} else if (openingTimes.isEmpty()) {
// Throw IAE
- throw new IllegalArgumentException("openingTimes is empty");
+ throw new IllegalArgumentException("openingTimes is empty"); //NOI18N
}
// Walk through whole list
// Id should not be set
if (openingTime.getOpeningId() != null) {
// Abort here
- throw new IllegalStateException("openingTime.openingId is not null");
+ throw new IllegalStateException("openingTime.openingId is not null"); //NOI18N
}
// Set created timestamp
throw new NullPointerException("contact is null"); //NOI18N
} else if (contact.getContactId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is unexpected.", contact.getContactId()));
+ throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is unexpected.", contact.getContactId())); //NOI18N
}
// Get all phone instances
throw new NullPointerException("branchOffice is null"); //NOI18N
} else if (branchOffice.getBranchId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("branchOffice.branchId={0} is unexpected.", branchOffice.getBranchId()));
+ throw new IllegalArgumentException(MessageFormat.format("branchOffice.branchId={0} is unexpected.", branchOffice.getBranchId())); //NOI18N
}
// Get all phone instances
/**
* Updates all branch office's phone entry's created timestamps
* <p>
- * @param headquarter Headquarters instance to update
+ * @param headquarter Headquarter instance to update
*/
protected void setAllPhoneEntriesCreated (final Headquarter headquarter) {
// Trace message
if (null == headquarter) {
// Throw NPE again
throw new NullPointerException("headquarter is null"); //NOI18N
- } else if (headquarter.getHeadquartersId() != null) {
+ } else if (headquarter.getHeadquarterId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("headquarter.branchId={0} is unexpected.", headquarter.getHeadquartersId()));
+ throw new IllegalArgumentException(MessageFormat.format("headquarter.branchId={0} is unexpected.", headquarter.getHeadquarterId())); //NOI18N
}
// Get all phone instances
- final DialableLandLineNumber landLineNumber = headquarter.getHeadquartersLandLineNumber();
- final DialableFaxNumber faxNumber = headquarter.getHeadquartersFaxNumber();
+ final DialableLandLineNumber landLineNumber = headquarter.getHeadquarterLandLineNumber();
+ final DialableFaxNumber faxNumber = headquarter.getHeadquarterFaxNumber();
// Debug message
this.getLoggerBeanLocal().logDebug(MessageFormat.format("setAllPhoneEntriesCreated: landLineNumber={0},faxNumber={1}", landLineNumber, faxNumber)); //NOI18N
throw new NullPointerException("basicData is null"); //NOI18N
} else if (basicData.getBasicDataId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is unexpected.", basicData.getBasicDataId()));
+ throw new IllegalArgumentException(MessageFormat.format("basicData.basicDataId={0} is unexpected.", basicData.getBasicDataId())); //NOI18N
}
// Get all phone instances
import java.text.MessageFormat;
import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
import org.mxchange.jproduct.model.category.Category;
+import org.mxchange.jproduct.model.product.Product;
/**
* A general bean for product-related methods that can be generalized.
if (null == category) {
// Throw NPE
throw new NullPointerException("category is null");
- } else if(category.getCategoryI18nKey() == null) {
+ } else if (category.getCategoryI18nKey() == null) {
// Throw it again
throw new NullPointerException("category.categoryTitle is null");
} else if (category.getCategoryI18nKey().isEmpty()) {
// Throw it again
throw new IllegalArgumentException("category.categoryTitle is empty");
- } else if(category.getCategoryId() == null) {
+ } else if (category.getCategoryId() == null) {
// Throw it again
throw new NullPointerException("category.categoryId is null");
- } else if(category.getCategoryId() < 1) {
+ } else if (category.getCategoryId() < 1) {
// Throw it again
throw new IllegalArgumentException(MessageFormat.format("category.categoryId={0} is not valid.", category.getCategoryId()));
}
return managedCategory;
}
+ /**
+ * Creates a managed instance from given product instance
+ * <p>
+ * @param product Unmanaged product instance
+ * <p>
+ * @return Managed instance
+ */
+ protected Product createManaged (final Product product) {
+ // Validate parameter
+ if (null == product) {
+ // Throw NPE
+ throw new NullPointerException("product is null");
+ } else if (product.getProductI18nKey() == null) {
+ // Throw it again
+ throw new NullPointerException("product.productTitle is null");
+ } else if (product.getProductI18nKey().isEmpty()) {
+ // Throw it again
+ throw new IllegalArgumentException("product.productTitle is empty");
+ } else if (product.getProductId() == null) {
+ // Throw it again
+ throw new NullPointerException("product.productId is null");
+ } else if (product.getProductId() < 1) {
+ // Throw it again
+ throw new IllegalArgumentException(MessageFormat.format("product.productId={0} is not valid.", product.getProductId()));
+ }
+
+ // Try to find it
+ final Product managedProduct = this.getEntityManager().find(product.getClass(), product.getProductId());
+
+ // Should be there
+ assert (managedProduct instanceof Product) : "managedProduct is null"; //NOI18N
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedProduct={1} - EXIT!", this.getClass().getSimpleName(), managedProduct)); //NOI18N
+
+ // Return it
+ return managedProduct;
+ }
+
}
--- /dev/null
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jfinancials.model.income;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import javax.ejb.Stateless;
+import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+
+/**
+ * A stateless bean for general purposes for incomes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "financialIncome", description = "A stateless session bean for handling income.")
+public class FinancialIncomeSessionBean extends BaseFinancialsDatabaseBean implements FinancialIncomeSessionBeanRemote {
+
+ /**
+ * Serial number
+ */
+ private static final long serialVersionUID = 659_868_076_723_741L;
+
+ @Override
+ public BillableIncome addIncome (final BillableIncome income) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addIncome(): income={1} - CALLED!", this.getClass().getSimpleName(), income)); //NOI18N
+
+ // Validate parameter
+ if (null == income) {
+ // Throw NPE
+ throw new NullPointerException("income is null"); //NOI18N
+ } else if (income.getIncomeId() != null) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("income.incomeId={0} is not expected.", income.getIncomeId())); //NOI18N
+ } else if (income.getIncomeEnabled() == null) {
+ // Throw it again
+ throw new NullPointerException("income.incomeEnabled is null"); //NOI18N
+ } else if (income.getIncomeInterval() == null) {
+ // Throw it again
+ throw new NullPointerException("income.incomeInterval is null"); //NOI18N
+ } else if (income.getIncomeSingleAmount() == null) {
+ // Throw it again
+ throw new NullPointerException("income.incomeSingleAmount is null"); //NOI18N
+ } else if (income.getIncomeSingleAmount() < 0) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("income.incomeSingleAmount={0} is invalid.", income.getIncomeSingleAmount())); //NOI18N
+ } else if (income.getIncomeTitle() == null) {
+ // Throw NPE
+ throw new NullPointerException("income.incomeTitle is null"); //NOI18N
+ } else if (income.getIncomeTitle().isEmpty()) {
+ // Throw IAE
+ throw new IllegalArgumentException("income.incomeTitle is empty"); //NOI18N
+ } else if (income.getIncomeUser() == null) {
+ // Throw NPE
+ throw new NullPointerException("income.incomeUser is null"); //NOI18N
+ } else if (income.getIncomeUser().getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("income.incomeUser.userId is null"); //NOI18N
+ } else if (income.getIncomeUser().getUserId() < 0) {
+ // Throw IAE
+ throw new IllegalArgumentException(MessageFormat.format("income.incomeUser.userId={0} is invalid.", income.getIncomeUser().getUserId())); //NOI18N
+ }
+
+ // Add created instance
+ income.setIncomeCreated(new Date());
+
+ // Persist it
+ this.getEntityManager().persist(income);
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addIncome(): income.incomeId={1} - EXIT!", this.getClass().getSimpleName(), income.getIncomeId())); //NOI18N
+
+ // Return it
+ return income;
+ }
+
+}
/*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@Override
public BillableReceipt addReceipt (final BillableReceipt receipt) throws ReceiptAlreadyAddedException {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt={1} - CALLED!", this.getClass().getSimpleName(), receipt));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt={1} - CALLED!", this.getClass().getSimpleName(), receipt)); //NOI18N
// Validate parameter
if (null == receipt) {
// Throw NPE
- throw new NullPointerException("receipt is null");
+ throw new NullPointerException("receipt is null"); //NOI18N
} else if (receipt.getReceiptId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt.receiptId={0} is not expected.", receipt.getReceiptId()));
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptId={0} is not expected.", receipt.getReceiptId())); //NOI18N
} else if (receipt.getReceiptIssued() == null) {
// Throw NPE again
- throw new NullPointerException("receipt.receiptIssued is null");
+ throw new NullPointerException("receipt.receiptIssued is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice() == null) {
// Throw it again
- throw new NullPointerException("receipt.receiptBranchOffice is null");
+ throw new NullPointerException("receipt.receiptBranchOffice is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice().getBranchId() == null) {
// Throw it again
- throw new NullPointerException("receipt.receiptBranchOffice.branchId is null");
+ throw new NullPointerException("receipt.receiptBranchOffice.branchId is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice().getBranchId() < 1) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt.receiptBranchOffice.branchId={0} is not valid.", receipt.getReceiptBranchOffice().getBranchId()));
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptBranchOffice.branchId={0} is not valid.", receipt.getReceiptBranchOffice().getBranchId())); //NOI18N
} else if (receipt.getReceiptPaymentType() == null) {
// Throw NPE
- throw new NullPointerException("receipt.receiptPaymentType is null");
+ throw new NullPointerException("receipt.receiptPaymentType is null"); //NOI18N
} else if ((receipt.getReceiptUser() instanceof User) && receipt.getReceiptUser().getUserId() == null) {
// Throw NPE again
- throw new NullPointerException("receipt.receiptUser.userId is null");
+ throw new NullPointerException("receipt.receiptUser.userId is null"); //NOI18N
} else if ((receipt.getReceiptUser() instanceof User) && receipt.getReceiptUser().getUserId() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("receipt.receiptUser.userId={0} is not valid", receipt.getReceiptUser().getUserId()));
+ throw new NullPointerException(MessageFormat.format("receipt.receiptUser.userId={0} is not valid", receipt.getReceiptUser().getUserId())); //NOI18N
} else if (this.receiptBean.isReceiptRegistered(receipt)) {
// Has already been registered
throw new ReceiptAlreadyAddedException(receipt);
this.getEntityManager().persist(receipt);
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), receipt.getReceiptId()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), receipt.getReceiptId())); //NOI18N
// Return it
return receipt;
/*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
@Override
public BillableReceipt addReceipt (final BillableReceipt receipt) throws ReceiptAlreadyAddedException {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt={1} - CALLED!", this.getClass().getSimpleName(), receipt));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt={1} - CALLED!", this.getClass().getSimpleName(), receipt)); //NOI18N
// Validate parameter
if (null == receipt) {
// Throw NPE
- throw new NullPointerException("receipt is null");
+ throw new NullPointerException("receipt is null"); //NOI18N
} else if (receipt.getReceiptId() != null) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt.receiptId={0} is not expected.", receipt.getReceiptId()));
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptId={0} is not expected.", receipt.getReceiptId())); //NOI18N
} else if (receipt.getReceiptIssued() == null) {
// Throw NPE again
- throw new NullPointerException("receipt.receiptIssued is null");
+ throw new NullPointerException("receipt.receiptIssued is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice() == null) {
// Throw it again
- throw new NullPointerException("receipt.receiptBranchOffice is null");
+ throw new NullPointerException("receipt.receiptBranchOffice is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice().getBranchId() == null) {
// Throw it again
- throw new NullPointerException("receipt.receiptBranchOffice.branchId is null");
+ throw new NullPointerException("receipt.receiptBranchOffice.branchId is null"); //NOI18N
} else if (receipt.getReceiptBranchOffice().getBranchId() < 1) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("receipt.receiptBranchOffice.branchId={0} is not valid.", receipt.getReceiptBranchOffice().getBranchId()));
+ throw new IllegalArgumentException(MessageFormat.format("receipt.receiptBranchOffice.branchId={0} is not valid.", receipt.getReceiptBranchOffice().getBranchId())); //NOI18N
} else if (receipt.getReceiptPaymentType() == null) {
// Throw NPE
- throw new NullPointerException("receipt.receiptPaymentType is null");
+ throw new NullPointerException("receipt.receiptPaymentType is null"); //NOI18N
} else if ((receipt.getReceiptUser() instanceof User) && receipt.getReceiptUser().getUserId() == null) {
// Throw NPE again
- throw new NullPointerException("receipt.receiptUser.userId is null");
+ throw new NullPointerException("receipt.receiptUser.userId is null"); //NOI18N
} else if ((receipt.getReceiptUser() instanceof User) && receipt.getReceiptUser().getUserId() < 1) {
// Throw NPE again
- throw new NullPointerException(MessageFormat.format("receipt.receiptUser.userId={0} is not valid", receipt.getReceiptUser().getUserId()));
+ throw new NullPointerException(MessageFormat.format("receipt.receiptUser.userId={0} is not valid", receipt.getReceiptUser().getUserId())); //NOI18N
} else if (this.isReceiptRegistered(receipt)) {
// Has already been registered
throw new ReceiptAlreadyAddedException(receipt);
this.getEntityManager().persist(receipt);
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), receipt.getReceiptId()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addReceipt(): receipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), receipt.getReceiptId())); //NOI18N
// Return it
return receipt;
@SuppressWarnings ("unchecked")
public List<BillableReceipt> allReceipts () {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allReceipts(): CALLED!", this.getClass().getSimpleName()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allReceipts(): CALLED!", this.getClass().getSimpleName())); //NOI18N
// Query all
- final Query query = this.getEntityManager().createNamedQuery("AllReceipts");
+ final Query query = this.getEntityManager().createNamedQuery("AllReceipts"); //NOI18N
// Get all
final List<BillableReceipt> receipts = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allReceipts(): receipts.size()={1} EXIT!", this.getClass().getSimpleName(), receipts.size()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allReceipts(): receipts.size()={1} EXIT!", this.getClass().getSimpleName(), receipts.size())); //NOI18N
// Return it
return receipts;
@SuppressWarnings ("unchecked")
public List<BillableReceipt> allUsersReceipts (final User user) {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsersReceipts(): user={1} - CALLED!", this.getClass().getSimpleName(), user));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsersReceipts(): user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
// Validate parameter
if (null == user) {
// Throw NPE
- throw new NullPointerException("user is null");
+ throw new NullPointerException("user is null"); //NOI18N
} else if (user.getUserId() == null) {
// Throw it again
- throw new NullPointerException("user.userId is null");
+ throw new NullPointerException("user.userId is null"); //NOI18N
} else if (user.getUserId() < 1) {
// Throw IAE
- throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId()));
+ throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid", user.getUserId())); //NOI18N
}
// Query all
- final Query query = this.getEntityManager().createNamedQuery("SearchAllUserReceipts");
+ final Query query = this.getEntityManager().createNamedQuery("SearchAllUserReceipts"); //NOI18N
// Add parameter
- query.setParameter("receiptUser", user);
+ query.setParameter("receiptUser", user); //NOI18N
// Get all
final List<BillableReceipt> receipts = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsersReceipts(): receipts.size()={1} EXIT!", this.getClass().getSimpleName(), receipts.size()));
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allUsersReceipts(): receipts.size()={1} EXIT!", this.getClass().getSimpleName(), receipts.size())); //NOI18N
// Return it
return receipts;
// Yes, then stop searching
isFound = true;
break;
- } else if (Receipts.isSameReceipt(foundReceipt, receipt)){
+ } else if (Receipts.isSameReceipt(foundReceipt, receipt)) {
// Yes, then stop searching
isFound = true;
break;
/*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
-import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
+import org.mxchange.jfinancials.database.product.BaseFinancialsProductDatabaseBean;
import org.mxchange.jfinancials.exceptions.receipt_item.ReceiptItemAlreadyAddedException;
/**
* @author Roland Häder<roland@mxchange.org>
*/
@Stateless (name = "adminFinancialReceiptItem", description = "A stateless session bean for administrative purposes for receipt itemss.")
-public class FinancialAdminReceiptItemSessionBean extends BaseFinancialsDatabaseBean implements FinancialAdminReceiptItemSessionBeanRemote {
+public class FinancialAdminReceiptItemSessionBean extends BaseFinancialsProductDatabaseBean implements FinancialAdminReceiptItemSessionBeanRemote {
/**
* Serial number
/**
* General EJB
*/
- @EJB (lookup = "java:global/jfinancials-ejb/financialReceiptItem!org.mxchange.jfinancials.model.receipt.item.FinancialReceiptItemSessionBeanRemote")
+ @EJB (lookup = "java:global/jfinancials-ejb/financialReceiptItem!org.mxchange.jfinancials.model.receipt_item.FinancialReceiptItemSessionBeanRemote")
private FinancialReceiptItemSessionBeanRemote receiptItemBean;
@Override
} else if (receiptItem.getItemProduct().getProductId() < 1) {
// Throw IAE
throw new IllegalArgumentException(MessageFormat.format("receiptItem.itemProduct.productId={0} is invalid.", receiptItem.getItemProduct().getProductId())); //NOI18N
- } else if (receiptItem.getItemProductQuantity() < 1) {
+ } else if (receiptItem.getItemProductQuantity() == null) {
+ // Throw it again
+ throw new NullPointerException("receiptItem.itemProductQuantity is null"); //NOI18N
+ } else if (receiptItem.getItemProductQuantity().doubleValue() <= 0.0) {
// Throw IAE again
throw new IllegalArgumentException(MessageFormat.format("receiptItem.itemProductQuantity={0} is invalid.", receiptItem.getItemProductQuantity())); //NOI18N
} else if (receiptItem.getItemReceipt() == null) {
throw new ReceiptItemAlreadyAddedException(receiptItem);
}
+ // Make product managed
+ receiptItem.setItemProduct(this.createManaged(receiptItem.getItemProduct()));
+
+ // Make receipt managed
+ receiptItem.setItemReceipt(this.createManaged(receiptItem.getItemReceipt()));
+
+ // Is a manufacturer/producer set?
+ if (receiptItem.getItemManufacturer() instanceof BasicData) {
+ // Then get managed instance from it
+ final BasicData basicData = this.createManaged(receiptItem.getItemManufacturer());
+
+ // Set it back
+ receiptItem.setItemManufacturer(basicData);
+ }
+
// Add created timestamp
receiptItem.setItemCreated(new Date());
// Default is not found
boolean isFound = false;
+ // Is the item type a discount?
+ if (receiptItem.getItemIsDiscount()) {
+ // Yes, then allow it multiple items
+ return false;
+ }
+
/*
* Get all receipt's receipt items. No need to look global as people may
* buy the same item again and again ... ;-)
// Loop through all entries
for (final BillableReceiptItem item : receiptItems) {
// Is it the same item?
- if (ReceiptItems.isSameReceiptItem(item, receiptItem)) {
+ if (ReceiptItems.isSameReceiptItem(item, receiptItem) && (!item.getItemIsRefund())) {
// Found it
isFound = true;
break;
/*
- * Copyright (C) 2017 Roland Häder
+ * Copyright (C) 2017, 2018 Free Software Foundation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
} else if (receiptItem.getItemProduct().getProductId() < 1) {
// Throw IAE
throw new IllegalArgumentException(MessageFormat.format("receiptItem.itemProduct.productId={0} is invalid.", receiptItem.getItemProduct().getProductId())); //NOI18N
- } else if (receiptItem.getItemProductQuantity() < 1) {
+ } else if (receiptItem.getItemProductQuantity() == null) {
+ // Throw it again
+ throw new NullPointerException("receiptItem.itemProductQuantity is null"); //NOI18N
+ } else if (receiptItem.getItemProductQuantity().doubleValue() <= 0.0) {
// Throw IAE again
throw new IllegalArgumentException(MessageFormat.format("receiptItem.itemProductQuantity={0} is invalid.", receiptItem.getItemProductQuantity())); //NOI18N
} else if (receiptItem.getItemReceipt() == null) {