From: Roland Haeder Date: Fri, 9 Oct 2015 12:18:46 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c1ef0f18b25e0e81b107c721e9b9f98144381203;p=addressbook-mailer-ejb.git Continued: - added persistence.xml and EclipseLink provider - added really important jars (their entities must be registered in persistence.xml, too) - First EJB business method added (stub) - updated jars Signed-off-by:Roland Häder --- diff --git a/lib/eclipselink/eclipselink.jar b/lib/eclipselink/eclipselink.jar new file mode 100644 index 0000000..2b0a810 Binary files /dev/null and b/lib/eclipselink/eclipselink.jar differ diff --git a/lib/eclipselink/javax.persistence-2.1.0-doc.zip b/lib/eclipselink/javax.persistence-2.1.0-doc.zip new file mode 100644 index 0000000..fd55e6e Binary files /dev/null and b/lib/eclipselink/javax.persistence-2.1.0-doc.zip differ diff --git a/lib/eclipselink/javax.persistence_2.1.0.v201304241213.jar b/lib/eclipselink/javax.persistence_2.1.0.v201304241213.jar new file mode 100644 index 0000000..841d2e1 Binary files /dev/null and b/lib/eclipselink/javax.persistence_2.1.0.v201304241213.jar differ diff --git a/lib/eclipselink/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar b/lib/eclipselink/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar new file mode 100644 index 0000000..001316b Binary files /dev/null and b/lib/eclipselink/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar differ diff --git a/lib/eclipselinkmodelgen/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar b/lib/eclipselinkmodelgen/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar new file mode 100644 index 0000000..0135c65 Binary files /dev/null and b/lib/eclipselinkmodelgen/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar differ diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar new file mode 100644 index 0000000..1d48fff Binary files /dev/null and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcontacts-core.jar b/lib/jcontacts-core.jar new file mode 100644 index 0000000..56d1541 Binary files /dev/null and b/lib/jcontacts-core.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index b39cb8c..955e4a9 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/juser-core.jar b/lib/juser-core.jar new file mode 100644 index 0000000..0923bea Binary files /dev/null and b/lib/juser-core.jar differ diff --git a/lib/juser-lib.jar b/lib/juser-lib.jar index a1cdc14..e0d78fe 100644 Binary files a/lib/juser-lib.jar and b/lib/juser-lib.jar differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties index 6d0afb5..cc80b9d 100644 --- a/lib/nblibraries.properties +++ b/lib/nblibraries.properties @@ -2,3 +2,15 @@ libs.CopyLibs.classpath=\ ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar libs.CopyLibs.displayName=CopyLibs Task libs.CopyLibs.prop-version=2.0 +libs.eclipselink.classpath=\ + ${base}/eclipselink/eclipselink.jar;\ + ${base}/eclipselink/javax.persistence_2.1.0.v201304241213.jar;\ + ${base}/eclipselink/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar +libs.eclipselink.displayName=EclipseLink (JPA 2.1) +libs.eclipselink.javadoc=\ + ${base}/eclipselink/javax.persistence-2.1.0-doc.zip +libs.eclipselink.prop-maven-dependencies=\n org.eclipse.persistence:eclipselink:2.5.2:jar\n +libs.eclipselinkmodelgen.classpath=\ + ${base}/eclipselinkmodelgen/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar +libs.eclipselinkmodelgen.displayName=EclipseLink-ModelGen (JPA 2.1) +libs.eclipselinkmodelgen.prop-maven-dependencies=org.eclipse.persistence:org.eclipse.persistence.jpa.modelgen.processor:2.5.2:jar diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 75d0db9..3cd8ea2 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -828,22 +828,34 @@ exists or setup the property manually. For example like this: + + + + + + - + - + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 4203e6b..ae249aa 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=99c0adbf +build.xml.data.CRC32=a3556951 build.xml.script.CRC32=7d41e0fd build.xml.stylesheet.CRC32=5910fda3@1.51.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=99c0adbf -nbproject/build-impl.xml.script.CRC32=9f98b4d1 +nbproject/build-impl.xml.data.CRC32=a3556951 +nbproject/build-impl.xml.script.CRC32=8db758bb nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.51.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index e0224b9..8ce3e8f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,5 +1,6 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=true +annotation.processing.processor.options=-Aeclipselink.canonicalmodel.use_static_factory=false annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output @@ -20,7 +21,10 @@ dist.jar=${dist.dir}/${jar.name} dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar +file.reference.jcontacts-core.jar=lib\\jcontacts-core.jar file.reference.jcoreee.jar=lib\\jcoreee.jar +file.reference.juser-core.jar=lib/juser-core.jar file.reference.juser-lib.jar=lib/juser-lib.jar includes=** j2ee.compile.on.save=true @@ -39,12 +43,17 @@ jars.in.ejbjar=false javac.classpath=\ ${file.reference.jcoreee.jar}:\ ${file.reference.juser-lib.jar}:\ + ${file.reference.juser-core.jar}:\ + ${file.reference.jcontacts-core.jar}:\ + ${file.reference.jcontacts-business-core.jar}:\ ${reference.addressbook-lib.jar} javac.compilerargs=-Xlint:unchecked -Xlint:deprecation javac.debug=true javac.deprecation=true javac.processorpath=\ - ${javac.classpath} + ${javac.classpath}:\ + ${libs.eclipselink.classpath}:\ + ${libs.eclipselinkmodelgen.classpath} javac.source=1.7 javac.target=1.7 javac.test.classpath=\ @@ -77,7 +86,10 @@ run.test.classpath=\ # (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value): runmain.jvmargs= source.encoding=UTF-8 +source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/ +source.reference.jcontacts-core.jar=../jcontacts-core/src/ source.reference.jcoreee.jar=../jcoreee/src/ +source.reference.juser-core.jar=../juser-core/src/ source.reference.juser-lib.jar=../juser-lib/src/ source.root=src src.dir=${source.root}/java diff --git a/nbproject/project.xml b/nbproject/project.xml index 07a88f3..70677cb 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -7,6 +7,9 @@ 1.6.5 file.reference.jcoreee.jar file.reference.juser-lib.jar + file.reference.juser-core.jar + file.reference.jcontacts-core.jar + file.reference.jcontacts-business-core.jar reference.addressbook-lib.jar diff --git a/src/conf/persistence.xml b/src/conf/persistence.xml new file mode 100644 index 0000000..e2f3b2d --- /dev/null +++ b/src/conf/persistence.xml @@ -0,0 +1,21 @@ + + + + jdbc/contacts + org.mxchange.addressbook.model.addressbook.UserAddressbook + org.mxchange.addressbook.model.addressbook.entry.UserAddressbookEntry + org.mxchange.jcontacts.contact.UserContact + org.mxchange.jcontactsbusiness.CompanyContact + org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData + org.mxchange.jcontactsbusiness.branch.CompanyBranchOffice + org.mxchange.jcontactsbusiness.department.CompanyDepartment + org.mxchange.jcontactsbusiness.employee.CompanyEmployee + org.mxchange.jcontactsbusiness.headquarters.CompanyHeadQuartersData + org.mxchange.jcontactsbusiness.logo.CompanyLogo + org.mxchange.jusercore.model.user.LoginUser + false + + + + + diff --git a/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java b/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java new file mode 100644 index 0000000..245c3a7 --- /dev/null +++ b/src/java/org/mxchange/addressbook/model/addressbook/AddressbookSessionBean.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2015 Roland Haeder + * + * 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 + * 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.addressbook.model.addressbook; + +import javax.ejb.EJB; +import javax.ejb.Stateless; +import org.mxchange.jcoreee.database.BaseDatabaseBean; +import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote; + +/** + * A stateless bean handling addressbooks + *

+ * @author Roland Haeder + */ +@Stateless (name = "addressbook", mappedName = "ejb/stateless-addressbook", description = "A stateless bean for handling addressbooks") +public class AddressbookSessionBean extends BaseDatabaseBean implements AddressbookSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 129_857_871_287_691L; + + /** + * Login bean + */ + @EJB + private UserLoginSessionBeanRemote loginBean; +} diff --git a/src/java/org/mxchange/addressbook/model/addressbooks/AddressbookSessionBean.java b/src/java/org/mxchange/addressbook/model/addressbooks/AddressbookSessionBean.java deleted file mode 100644 index 191c4b1..0000000 --- a/src/java/org/mxchange/addressbook/model/addressbooks/AddressbookSessionBean.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2015 Roland Haeder - * - * 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 - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package org.mxchange.addressbook.model.addressbooks; - -import javax.ejb.EJB; -import javax.ejb.Stateless; -import org.mxchange.jcoreee.database.BaseDatabaseBean; -import org.mxchange.jusercore.model.login.UserLoginSessionBeanRemote; - -/** - * A stateless bean handling addressbooks - *

- * @author Roland Haeder - */ -@Stateless (name = "addressbook", mappedName = "ejb/stateless-addressbook", description = "A stateless bean for handling addressbooks") -public class AddressbookSessionBean extends BaseDatabaseBean implements AddressbookSessionBeanRemote { - - /** - * Serial number - */ - private static final long serialVersionUID = 129_857_871_287_691L; - - /** - * Login bean - */ - @EJB - private UserLoginSessionBeanRemote loginBean; -}