From 26a7be21e6b7edba3f3535198e6847d2785cb536 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 9 Apr 2016 20:32:17 +0200 Subject: [PATCH] Turned master (EE)+ejb project into separate master (triangle) and EJB project --- INSTALL.txt | 46 - PizzaService-ejb/build.xml | 68 - ...-modules-java-j2seproject-copylibstask.jar | Bin 22977 -> 0 bytes PizzaService-ejb/lib/nblibraries.properties | 15 - PizzaService-ejb/nbproject/ant-deploy.xml | 111 - PizzaService-ejb/nbproject/build-impl.xml | 1278 ----------- .../nbproject/genfiles.properties | 8 - PizzaService-ejb/nbproject/project.properties | 108 - PizzaService-ejb/nbproject/project.xml | 40 - PizzaService-ejb/src/conf/MANIFEST.MF | 2 - PizzaService-ejb/src/java/log4j2.xml | 29 - build.xml | 31 +- install/install.sql | 116 - {PizzaService-ejb/lib => lib}/cdi-api.jar | Bin .../lib => lib}/eclipselink/eclipselink.jar | Bin .../javax.persistence_2.1.0.v201304241213.jar | Bin ...tence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar | Bin ...e.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar | Bin .../lib => lib}/jcontacts-core.jar | Bin .../lib => lib}/jcore-logger-lib.jar | Bin {PizzaService-ejb/lib => lib}/jcore.jar | Bin {PizzaService-ejb/lib => lib}/jcoreee.jar | Bin .../lib => lib}/jcountry-core.jar | Bin .../lib => lib}/jcountry-lib.jar | Bin {PizzaService-ejb/lib => lib}/jphone-core.jar | Bin {PizzaService-ejb/lib => lib}/jphone-lib.jar | Bin {PizzaService-ejb/lib => lib}/jshop-core.jar | Bin .../lib => lib}/jshop-ee-lib.jar | Bin lib/juser-core.jar | Bin 0 -> 38957 bytes lib/juser-lib.jar | Bin 0 -> 5111 bytes lib/nblibraries.properties | 11 + nbproject/build-impl.xml | 1906 +++++++++++------ nbproject/genfiles.properties | 12 +- nbproject/project.properties | 128 +- nbproject/project.xml | 101 +- .../src => src}/conf/persistence.xml | 2 + src/java/log4j2.xml | 21 +- .../data/PizzaCountrySingletonBean.java | 0 .../PizzaSmsProviderSingletonBean.java | 0 .../login/PizzaUserLoginSessionBean.java | 142 ++ .../PizzaUserRegistrationSessionBean.java | 116 + .../model/user/PizzaUserSessionBean.java | 487 +++++ 42 files changed, 2192 insertions(+), 2586 deletions(-) delete mode 100644 INSTALL.txt delete mode 100644 PizzaService-ejb/build.xml delete mode 100644 PizzaService-ejb/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar delete mode 100644 PizzaService-ejb/lib/nblibraries.properties delete mode 100644 PizzaService-ejb/nbproject/ant-deploy.xml delete mode 100644 PizzaService-ejb/nbproject/build-impl.xml delete mode 100644 PizzaService-ejb/nbproject/genfiles.properties delete mode 100644 PizzaService-ejb/nbproject/project.properties delete mode 100644 PizzaService-ejb/nbproject/project.xml delete mode 100644 PizzaService-ejb/src/conf/MANIFEST.MF delete mode 100644 PizzaService-ejb/src/java/log4j2.xml delete mode 100644 install/install.sql rename {PizzaService-ejb/lib => lib}/cdi-api.jar (100%) rename {PizzaService-ejb/lib => lib}/eclipselink/eclipselink.jar (100%) rename {PizzaService-ejb/lib => lib}/eclipselink/javax.persistence_2.1.0.v201304241213.jar (100%) rename {PizzaService-ejb/lib => lib}/eclipselink/org.eclipse.persistence.jpa.jpql_2.5.2.v20140319-9ad6abd.jar (100%) rename {PizzaService-ejb/lib => lib}/eclipselinkmodelgen/org.eclipse.persistence.jpa.modelgen_2.5.2.v20140319-9ad6abd.jar (100%) rename {PizzaService-ejb/lib => lib}/jcontacts-core.jar (100%) rename {PizzaService-ejb/lib => lib}/jcore-logger-lib.jar (100%) rename {PizzaService-ejb/lib => lib}/jcore.jar (100%) rename {PizzaService-ejb/lib => lib}/jcoreee.jar (100%) rename {PizzaService-ejb/lib => lib}/jcountry-core.jar (100%) rename {PizzaService-ejb/lib => lib}/jcountry-lib.jar (100%) rename {PizzaService-ejb/lib => lib}/jphone-core.jar (100%) rename {PizzaService-ejb/lib => lib}/jphone-lib.jar (100%) rename {PizzaService-ejb/lib => lib}/jshop-core.jar (100%) rename {PizzaService-ejb/lib => lib}/jshop-ee-lib.jar (100%) create mode 100644 lib/juser-core.jar create mode 100644 lib/juser-lib.jar rename {PizzaService-ejb/src => src}/conf/persistence.xml (91%) rename {PizzaService-ejb/src => src}/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java (100%) rename {PizzaService-ejb/src => src}/java/org/mxchange/jphone/phonenumbers/smsprovider/PizzaSmsProviderSingletonBean.java (100%) create mode 100644 src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java create mode 100644 src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java create mode 100644 src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java diff --git a/INSTALL.txt b/INSTALL.txt deleted file mode 100644 index 5dce97b..0000000 --- a/INSTALL.txt +++ /dev/null @@ -1,46 +0,0 @@ -Installation instructions: -========================== - -0) Create an empty database and setup proper permissions - -1) (Import install/install.sql into your new database) Currently DROP+CREATE - -2) Setup a JDBC pool. I took the simple driver: - -Pool name: ShopPool -Resource type: java.sql.Driver -Driver: MySQL -Driver class: com.mysql.jdbc.Driver - -URL: jdbc:mysql://localhost/your_database -user: your_login -password: your_password - -3) Setup a JDBC resource: - -JNDI name: jdbc/shop -Pool name: ShopPool - -4) Setup a JMS connection factory: - -JNDI name: jms/shopConnectionFactory -Resource type: javax.jms.QueueConnectionFactory - -5) Setup a JMS destination resource: - -JNDI name: jms/shopCheckoutQueue -Physical destination name: checkout -Resource type: javax.jms.Queue - -You should be done now. And always try to give informative descriptions, not -just only "shop" or "factory". - -Of course, you need to build and deploy the EAR/WAR files. ;-) - -6) In juser-core project you will find a JAR named "commons-codec-1.10.jar" you - need to copy this to your $GLASSFISH_DOMAIN/lib/ path to make password - encryption working. Please setup sufficient access rights (CHMOD 0644 is - enough). - - If you forgot this file to copy and you have copied it now, please restart - the Glassfish server so the JAR can be found and loaded. diff --git a/PizzaService-ejb/build.xml b/PizzaService-ejb/build.xml deleted file mode 100644 index 0e24c24..0000000 --- a/PizzaService-ejb/build.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - Builds, tests, and runs the project PizzaService-ejb. - - - diff --git a/PizzaService-ejb/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/PizzaService-ejb/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar deleted file mode 100644 index eaf6790a221ad1983616f4c98377bd9876bc6224..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 22977 zcmb_k4}4SA^*=XF`_eQmC0HOR`m6}0ZQ6kCdPZ)ZG3ttDwW+yXt!ZelYgL#s;m)HqgqUhZqfoes#G=gR1Apfi)tv*9gM}bs1|^H z`2t$6FS;?NM!Lpt19UaVd$gz;_VsEpwbwVOc4{LKAU_yo3i>c`!A+VP83;pXbW+-( zAO1)`v!IPXeL3bFOG(L;_<%f%F2O( zfeKTVD_HaWfk4RH-51(4uc9a38$wBRI^5aW9}ER5!6If)tdhIr1y8*5ytOSAYMaK? zrdsII8HLI`cEK)iHslL;_xrjvwL7v&i-v>YZWZF)8;r3Hg!qAbp^bM!fGJNWZ>XdW09`-07S7I4DyHi0|w`eYU(NtQW*s;O_4b0XD(_muZFOo z-Bc}052Pe9qdu$erkn?~SgIKaXtn^txw~MyMLuIJQK%$UU{iM@kE62SWWr|xOU>nOs(r}^r z`a#VXJyTuJ=7Rgma;+ORX%x;ZHcVYu*S|=#BsLe=fUg~WYDUpu7;4^Th>8j>m~&)> zEK(m1#)Bwfs5FGn;HX&_sI0Zy`on5t&>xM&24VerW94dn*k7TJCf>BVRr6KU0hSE4 z*xdD7ojB9t!OFpS>WZZgfwWpYnyjd36Z)7;N|PVf znE*r}uIcy#P*>Ri#t{;M@j>n4^|i3H(y&D^2pU^4NO{DfIUvPUL!|0rmQqw{ER!m& zu4k&4rZiH{gaMG|rJ|T+llvWrsB8?AB>F&13^c*Y`+Fj+%orr279<$b<`4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|gLwNT_zw2t?bmp-NxO%bNCWQ?u)|LFBN(gE>tXSLfhtPbX#J+4>?xX6 zmJlyDV(}nVbt+z@roM$hV)5A418>=P%BW!}QCME{47(8azZz67qC&A4G%lf1v6RZi za>-#8Efj*oKSQsuIE9pPUkEkl(6iu(FljVO9gb2?c37sWe%vCbwvml$7dtJxoQZ3P{85WR$9q(XS$f3G=bd#u3^!o86X!ryG=fL?7BPlR^_e zv^gm^J$m)Ibqn`x#H`2vm!QHy9H(Q0kN67yJ?Y|Q0IG50#FAoM`Gp%_jOeT-#WJ9; zc-d0t;-kG@=Rx204ae0|M^Cz z&+4;z+Y+|T!+CoFdX8wO;FH-zO?D{xU%VUxv=STxUNac z+aX`pB*XL%@v5fJ=c1<1;hLs{x}?eL#R5ZLk}P$q_*-loB+I)+mK2-epvC%?F=5>I zu!Q3x|JO)T^DLvda?ECU5|4cz?Qoz$j2l|a_cma$wG`Kt2rTBDW8UA2rJUt2`BM`8 zHrG_uO!v8_>XqR&S=I6@6l>#*AytDtB-X#z@xe>V@oMm8tEoRMRnr%t<5lI$S5tr9 zkyXu$9L7Vzm$9b)&K?Ve48|G{&+HTuyxlM^9!q%gxSZk3T2p_oP8g>t<1G238W?$b zYpMY+_FV_D{?}uwEmygYWYfsYbW$x&ntV_#vhGQp(0?#Dvb~YN$V;_Xee^-MC(kYQ xAO2WWkEMU)7An=;N2?F2xzvWLWpy_1;;`X#(VN(TKemQ9#4R - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PizzaService-ejb/nbproject/build-impl.xml b/PizzaService-ejb/nbproject/build-impl.xml deleted file mode 100644 index b66085e..0000000 --- a/PizzaService-ejb/nbproject/build-impl.xml +++ /dev/null @@ -1,1278 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set build.generated.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - -The Java EE server classpath is not correctly set up - server home directory is missing. -Either open the project in the IDE and assign the server or setup the server classpath manually. -For example like this: - ant -Dj2ee.server.home=<app_server_installation_directory> - - -The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. -Either open the project in the IDE and assign the server or setup the server classpath manually. -For example like this: - ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) -or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - No tests executed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The libs.CopyLibs.classpath property is not set up. -This property must point to -org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part -of NetBeans IDE installation and is usually located at -<netbeans_installation>/java<version>/ant/extra folder. -Either open the project in the IDE and make sure CopyLibs library -exists or setup the property manually. For example like this: - ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set main.class - - - - - Must set fix.includes - - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - This target only works when run from inside the NetBeans IDE. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - Must select some files in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - Must select one file in the IDE or set test.class - Must select some method in the IDE or set test.method - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/PizzaService-ejb/nbproject/genfiles.properties b/PizzaService-ejb/nbproject/genfiles.properties deleted file mode 100644 index 19eb5bc..0000000 --- a/PizzaService-ejb/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=0427eba4 -build.xml.script.CRC32=cabe2e92 -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=6890d152 -nbproject/build-impl.xml.script.CRC32=5087c2fa -nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.55.1 diff --git a/PizzaService-ejb/nbproject/project.properties b/PizzaService-ejb/nbproject/project.properties deleted file mode 100644 index d455a03..0000000 --- a/PizzaService-ejb/nbproject/project.properties +++ /dev/null @@ -1,108 +0,0 @@ -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 -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form,**/.nbattrs -build.dir=build -build.ear.classes.dir=${build.dir}/classes -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=${javac.classpath}:${build.classes.dir} -debug.test.classpath=\ - ${run.test.classpath} -dist.dir=dist -dist.ear.jar=${dist.dir}/${jar.name} -dist.jar=${dist.dir}/${jar.name} -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.cdi-api.jar=lib/cdi-api.jar -file.reference.jcontacts-core.jar=lib/jcontacts-core.jar -file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar -file.reference.jcoreee.jar=lib/jcoreee.jar -file.reference.jcountry-core.jar=lib/jcountry-core.jar -file.reference.jcountry-lib.jar=lib/jcountry-lib.jar -file.reference.jphone-core.jar=lib/jphone-core.jar -file.reference.jphone-lib.jar=lib/jphone-lib.jar -file.reference.jshop-core.jar=lib/jshop-core.jar -file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.jar -includes=** -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/bean-validator.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/weld-osgi-bundle.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 -j2ee.platform.wsimport.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 -j2ee.platform.wsit.classpath= -j2ee.server.type=gfv3ee6 -jar.compress=false -jar.name=PizzaService-ejb.jar -jars.in.ejbjar=true -javac.classpath=\ - ${file.reference.jcountry-core.jar}:\ - ${file.reference.jcountry-lib.jar}:\ - ${file.reference.jcoreee.jar}:\ - ${file.reference.jcore-logger-lib.jar}:\ - ${reference.PizzaService-lib.jar}:\ - ${file.reference.jcontacts-core.jar}:\ - ${file.reference.jphone-core.jar}:\ - ${file.reference.jphone-lib.jar}:\ - ${file.reference.jshop-core.jar}:\ - ${file.reference.jshop-ee-lib.jar}:\ - ${file.reference.cdi-api.jar} -javac.debug=true -javac.deprecation=true -javac.processorpath=\ - ${javac.classpath} -javac.source=1.8 -javac.target=1.8 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=true -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.preview=true -javadoc.private=true -javadoc.splitindex=true -javadoc.use=true -javadoc.version=true -javadoc.windowtitle=Pizza-Service EJBs -meta.inf=${source.root}/conf -meta.inf.excludes=sun-cmp-mappings.xml -platform.active=default_platform -project.license=agpl30 -project.pizzaservice-lib=../../pizzaservice-lib -project.PizzaService-lib=../../../public_html/pizzaservice-lib -reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar -resource.dir=setup -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -# Space-separated list of JVM arguments used when running a class with a main method or a unit test -# (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-core.jar=../jcontacts-core/src/ -source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ -source.reference.jcoreee.jar=../../jcoreee/src/ -source.reference.jcountry-core.jar=../jcountry-core/src/ -source.reference.jcountry-lib.jar=../jcountry-lib/src/ -source.reference.jphone-core.jar=../jphone-core/src/ -source.reference.jphone-lib.jar=../jphone-lib/src/ -source.reference.jshop-core.jar=../../jshop-core/src/ -source.reference.jshop-ee-lib.jar=../../jshop-ee-lib/src/ -source.root=src -src.dir=${source.root}/java -test.src.dir=test diff --git a/PizzaService-ejb/nbproject/project.xml b/PizzaService-ejb/nbproject/project.xml deleted file mode 100644 index 3a5f797..0000000 --- a/PizzaService-ejb/nbproject/project.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - org.netbeans.modules.j2ee.ejbjarproject - - - PizzaService-ejb - 1.6.5 - file.reference.jcountry-core.jar - file.reference.jcountry-lib.jar - file.reference.jcoreee.jar - file.reference.jcore-logger-lib.jar - reference.PizzaService-lib.jar - file.reference.jcontacts-core.jar - file.reference.jphone-core.jar - file.reference.jphone-lib.jar - file.reference.jshop-core.jar - file.reference.jshop-ee-lib.jar - file.reference.cdi-api.jar - - - - - - - - - lib/nblibraries.properties - - - - PizzaService-lib - jar - - jar - clean - jar - - - - diff --git a/PizzaService-ejb/src/conf/MANIFEST.MF b/PizzaService-ejb/src/conf/MANIFEST.MF deleted file mode 100644 index 59499bc..0000000 --- a/PizzaService-ejb/src/conf/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/PizzaService-ejb/src/java/log4j2.xml b/PizzaService-ejb/src/java/log4j2.xml deleted file mode 100644 index 8d9a645..0000000 --- a/PizzaService-ejb/src/java/log4j2.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/build.xml b/build.xml index 85ea050..0e24c24 100644 --- a/build.xml +++ b/build.xml @@ -7,8 +7,8 @@ - - Builds, tests, and runs the project PizzaService. + + Builds, tests, and runs the project PizzaService-ejb. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set build.dir - Must set build.generated.dir - Must set dist.dir - Must set build.classes.excludes - Must set dist.jar - - - - The libs.CopyLibs.classpath property is not set up. - This property must point to - org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part - of NetBeans IDE installation and is usually located at + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set build.generated.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + +The Java EE server classpath is not correctly set up - server home directory is missing. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Dj2ee.server.home=<app_server_installation_directory> + + +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}. +Either open the project in the IDE and assign the server or setup the server classpath manually. +For example like this: + ant -Duser.properties.file=<path_to_property_file> (where you put the property "j2ee.platform.classpath" in a .properties file) +or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties file is used) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +The libs.CopyLibs.classpath property is not set up. +This property must point to +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part +of NetBeans IDE installation and is usually located at <netbeans_installation>/java<version>/ant/extra folder. - Either open the project in the IDE and make sure CopyLibs library - exists or setup the property manually. For example like this: - ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Browser not found, cannot launch the deployed application. Try to set the BROWSER environment variable. - - - Launching ${browse.url} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Either open the project in the IDE and make sure CopyLibs library +exists or setup the property manually. For example like this: + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set main.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index a23d1f8..73bdb0c 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=fdc75897 -build.xml.script.CRC32=8e3e9528 -build.xml.stylesheet.CRC32=a5d15b16@1.49.1 +build.xml.data.CRC32=0427eba4 +build.xml.script.CRC32=cabe2e92 +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=6fa7b0ea -nbproject/build-impl.xml.script.CRC32=82732cff -nbproject/build-impl.xml.stylesheet.CRC32=5eea63a6@1.49.1 +nbproject/build-impl.xml.data.CRC32=3b2a403d +nbproject/build-impl.xml.script.CRC32=eb9d30fc +nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.55.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 44851f1..3b9f031 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,13 +1,40 @@ +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 +build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form,**/.nbattrs build.dir=build +build.ear.classes.dir=${build.dir}/classes build.generated.dir=${build.dir}/generated -client.urlPart= -debug.classpath=${javac.classpath}::${jar.content.additional}:${run.classpath} -display.browser=true +build.generated.sources.dir=${build.dir}/generated-sources +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=${javac.classpath}:${build.classes.dir} +debug.test.classpath=\ + ${run.test.classpath} dist.dir=dist +dist.ear.jar=${dist.dir}/${jar.name} dist.jar=${dist.dir}/${jar.name} +dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= -j2ee.appclient.mainclass.args=${j2ee.appclient.tool.args} +excludes= +file.reference.cdi-api.jar=lib/cdi-api.jar +file.reference.jcontacts-core.jar=lib/jcontacts-core.jar +file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar +file.reference.jcore.jar=lib/jcore.jar +file.reference.jcoreee.jar=lib/jcoreee.jar +file.reference.jcountry-core.jar=lib/jcountry-core.jar +file.reference.jcountry-lib.jar=lib/jcountry-lib.jar +file.reference.jphone-core.jar=lib/jphone-core.jar +file.reference.jphone-lib.jar=lib/jphone-lib.jar +file.reference.jshop-core.jar=lib/jshop-core.jar +file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.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 j2ee.deploy.on.save=true j2ee.platform=1.7 @@ -19,33 +46,72 @@ j2ee.platform.wsimport.classpath=${j2ee.server.home}/modules/webservices-osgi.ja j2ee.platform.wsit.classpath= j2ee.server.type=gfv3ee6 jar.compress=false -jar.content.additional=\ - ${reference.jcore-logger-ejb.dist-ear}:\ - ${reference.PizzaService-ejb.dist-ear}:\ - ${reference.jshop-receipt-ejb.dist-ear}:\ - ${reference.jcore-logger-ejb.dist-ear}:\ - ${reference.jshop-ejb.dist-ear}:\ - ${reference.jcountry-ejb.dist-ear} -jar.name=PizzaService.ear +jar.name=PizzaService-ejb.jar +jars.in.ejbjar=true +javac.classpath=\ + ${file.reference.jcore.jar}:\ + ${file.reference.jcoreee.jar}:\ + ${file.reference.jcountry-core.jar}:\ + ${file.reference.jcountry-lib.jar}:\ + ${file.reference.jcore-logger-lib.jar}:\ + ${reference.PizzaService-lib.jar}:\ + ${file.reference.jcontacts-core.jar}:\ + ${file.reference.juser-core.jar}:\ + ${file.reference.juser-lib.jar}:\ + ${file.reference.jphone-core.jar}:\ + ${file.reference.jphone-lib.jar}:\ + ${file.reference.jshop-core.jar}:\ + ${file.reference.jshop-ee-lib.jar}:\ + ${file.reference.cdi-api.jar} javac.debug=true -javac.deprecation=false -javac.source=1.6 -javac.target=1.6 -meta.inf=src/conf -no.dependencies=false +javac.deprecation=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.7 +javac.target=1.7 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=true +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.preview=true +javadoc.private=true +javadoc.splitindex=true +javadoc.use=true +javadoc.version=true +javadoc.windowtitle=Pizza-Service EJBs +meta.inf=${source.root}/conf +meta.inf.excludes=sun-cmp-mappings.xml platform.active=default_platform -project.jcore-logger-ejb=../jcore-logger-ejb -project.jcore-logger-ejb=../jcore-logger-ejb -project.jcountry-ejb=../../NetBeansProjects/jcountry-ejb -project.jshop-ejb=../jshop-ejb -project.jshop-receipt-ejb=../jshop-receipt-ejb -project.PizzaService-ejb=PizzaService-ejb -reference.jcore-logger-ejb.dist-ear=${project.jcore-logger-ejb}/dist/jcore-logger-ejb.jar -reference.jcore-logger-ejb.dist-ear=${project.jcore-logger-ejb}/dist/jcore-logger-ejb.jar -reference.jcountry-ejb.dist-ear=${project.jcountry-ejb}/dist/jcountry-ejb.jar -reference.jshop-ejb.dist-ear=${project.jshop-ejb}/dist/jshop-ejb.jar -reference.jshop-receipt-ejb.dist-ear=${project.jshop-receipt-ejb}/dist/jshop-receipt-ejb.jar -reference.PizzaService-ejb.dist-ear=${project.PizzaService-ejb}/dist/PizzaService-ejb.jar +project.license=agpl30 +project.pizzaservice-lib=../../pizzaservice-lib +project.PizzaService-lib=../../../public_html/pizzaservice-lib +reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar resource.dir=setup -run.classpath= -source.root=. +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +# Space-separated list of JVM arguments used when running a class with a main method or a unit test +# (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-core.jar=../jcontacts-core/src/ +source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ +source.reference.jcore.jar=../jcore/src/ +source.reference.jcoreee.jar=../../jcoreee/src/ +source.reference.jcountry-core.jar=../jcountry-core/src/ +source.reference.jcountry-lib.jar=../jcountry-lib/src/ +source.reference.jphone-core.jar=../jphone-core/src/ +source.reference.jphone-lib.jar=../jphone-lib/src/ +source.reference.jshop-core.jar=../../jshop-core/src/ +source.reference.jshop-ee-lib.jar=../../jshop-ee-lib/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 +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml index 764f761..61f3efe 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -1,81 +1,42 @@ - org.netbeans.modules.j2ee.earproject + org.netbeans.modules.j2ee.ejbjarproject - - PizzaService + + PizzaService-ejb 1.6.5 - - - - ${reference.jcore-logger-ejb.dist-ear} - / - - - ${reference.PizzaService-ejb.dist-ear} - / - - - ${reference.jshop-receipt-ejb.dist-ear} - / - - - ${reference.jcore-logger-ejb.dist-ear} - / - - - ${reference.jshop-ejb.dist-ear} - / - - - ${reference.jcountry-ejb.dist-ear} - / - - + file.reference.jcore.jar + file.reference.jcoreee.jar + file.reference.jcountry-core.jar + file.reference.jcountry-lib.jar + file.reference.jcore-logger-lib.jar + reference.PizzaService-lib.jar + file.reference.jcontacts-core.jar + file.reference.juser-core.jar + file.reference.juser-lib.jar + file.reference.jphone-core.jar + file.reference.jphone-lib.jar + file.reference.jshop-core.jar + file.reference.jshop-ee-lib.jar + file.reference.cdi-api.jar + + + + + + - .\lib\nblibraries.properties + lib/nblibraries.properties - + - PizzaService-ejb - j2ee_ear_archive - - dist-ear - clean-ear - dist-ear - - - jcore-logger-ejb - j2ee_ear_archive - - dist-ear - clean-ear - dist-ear - - - jcountry-ejb - j2ee_ear_archive - - dist-ear - clean-ear - dist-ear - - - jshop-ejb - j2ee_ear_archive - - dist-ear - clean-ear - dist-ear - - - jshop-receipt-ejb - j2ee_ear_archive - - dist-ear - clean-ear - dist-ear + PizzaService-lib + jar + + jar + clean + jar diff --git a/PizzaService-ejb/src/conf/persistence.xml b/src/conf/persistence.xml similarity index 91% rename from PizzaService-ejb/src/conf/persistence.xml rename to src/conf/persistence.xml index ad81acb..ce8f031 100644 --- a/PizzaService-ejb/src/conf/persistence.xml +++ b/src/conf/persistence.xml @@ -14,6 +14,8 @@ org.mxchange.jshopcore.model.order.ShopOrder org.mxchange.jshopcore.model.order.items.OrderItem org.mxchange.jshopcore.model.product.GenericProduct + org.mxchange.jusercore.model.email_address.EmailAddressChange + org.mxchange.jusercore.model.user.LoginUser false diff --git a/src/java/log4j2.xml b/src/java/log4j2.xml index 12e0868..8d9a645 100644 --- a/src/java/log4j2.xml +++ b/src/java/log4j2.xml @@ -3,32 +3,27 @@ Copyright (C) 2016 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. +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 General Public License for more details. +GNU Affero General Public License for more details. -You should have received a copy of the GNU General Public License +You should have received a copy of the GNU Affero General Public License along with this program. If not, see . --> - + - - - + + - - - - diff --git a/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java b/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java similarity index 100% rename from PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java rename to src/java/org/mxchange/jcountry/data/PizzaCountrySingletonBean.java diff --git a/PizzaService-ejb/src/java/org/mxchange/jphone/phonenumbers/smsprovider/PizzaSmsProviderSingletonBean.java b/src/java/org/mxchange/jphone/phonenumbers/smsprovider/PizzaSmsProviderSingletonBean.java similarity index 100% rename from PizzaService-ejb/src/java/org/mxchange/jphone/phonenumbers/smsprovider/PizzaSmsProviderSingletonBean.java rename to src/java/org/mxchange/jphone/phonenumbers/smsprovider/PizzaSmsProviderSingletonBean.java diff --git a/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java b/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java new file mode 100644 index 0000000..482b0a8 --- /dev/null +++ b/src/java/org/mxchange/jusercore/model/login/PizzaUserLoginSessionBean.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 . + */ +package org.mxchange.jusercore.model.login; + +import java.text.MessageFormat; +import javax.ejb.EJB; +import javax.ejb.Stateless; +import org.mxchange.jcoreee.database.BaseDatabaseBean; +import org.mxchange.jusercore.container.login.LoginContainer; +import org.mxchange.jusercore.exceptions.UserNotFoundException; +import org.mxchange.jusercore.exceptions.UserPasswordMismatchException; +import org.mxchange.jusercore.exceptions.UserStatusLockedException; +import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException; +import org.mxchange.jusercore.model.register.UserRegistrationSessionBeanRemote; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserSessionBeanRemote; +import org.mxchange.jusercore.model.user.UserUtils; +import org.mxchange.jusercore.model.user.status.UserAccountStatus; + +/** + * A session bean for user logins + *

+ * @author Roland Haeder + */ +@Stateless (name = "login", mappedName = "ejb/stateless-pizza-login", description = "A bean handling the user login") +public class PizzaUserLoginSessionBean extends BaseDatabaseBean implements UserLoginSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 21_785_978_127_581_965L; + + /** + * Registration bean + */ + @EJB + private UserRegistrationSessionBeanRemote registerBean; + + /** + * User bean + */ + @EJB + private UserSessionBeanRemote userBean; + + @Override + public User validateUserAccountStatus (final LoginContainer container) throws UserNotFoundException, UserStatusLockedException, UserStatusUnconfirmedException, UserPasswordMismatchException { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: container={0} - CALLED!", container)); //NOI18N + + // Check some beans + assert(this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N + assert(this.registerBean instanceof UserRegistrationSessionBeanRemote) : "this.registerBean is not set"; //NOI18N + + // user should not be null + if (null == container) { + // Abort here + throw new NullPointerException("container is null"); //NOI18N + } else if (container.getUser() == null) { + // NPE again + throw new NullPointerException("container.user is null"); //NOI18N + } else if (container.getUserPassword() == null) { + // And yet again NPE + throw new NullPointerException("container.userPassword is null"); //NOI18N + } else if (container.getUserPassword().isEmpty()) { + // Empty password is not allowed, hardcoded. + throw new IllegalArgumentException("container.userPassword is empty"); //NOI18N + } + + // Is the account there? + if (!this.registerBean.isUserNameRegistered(container.getUser())) { + // Not registered + throw new UserNotFoundException(container.getUser()); + } + + // Get user instance from persistance + User updatedUser = this.userBean.fillUserData(container.getUser()); + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("loginUser: updatedUser={0}", updatedUser)); //NOI18N + + // Is the user account unconfirmed? + if (updatedUser.getUserAccountStatus().equals(UserAccountStatus.UNCONFIRMED)) { + // Is unconfirmed + throw new UserStatusUnconfirmedException(container.getUser()); + } else if (updatedUser.getUserAccountStatus().equals(UserAccountStatus.LOCKED)) { + // Is locked + throw new UserStatusLockedException(container.getUser()); + } else if (!this.isPasswordMatching(container, updatedUser)) { + // Not matcing passwords + throw new UserPasswordMismatchException(container.getUser()); + } + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("loginUser: updatedUser={0} - EXIT!", updatedUser)); //NOI18N + + // Return it + return updatedUser; + } + + /** + * Checks if password matches of both instances. Both user instances must + * not match, the first one is the one from the calling bean/controller, the + * second is the from database. + *

+ * @param container Container instance holding the user instance and + * unencrypted password + * @param updatedUser User instance found for given user name + *

+ * @return Whether the password matches + */ + private boolean isPasswordMatching (final LoginContainer container, final User updatedUser) { + // First math both instances + if (null == container) { + // Throw NPE + throw new NullPointerException("container is null"); //NOI18N + } else if (null == updatedUser) { + // Throw NPE + throw new NullPointerException("updatedUser is null"); //NOI18N + } else if (container.getUser().equals(updatedUser)) { + // Both same instance! + throw new IllegalArgumentException(MessageFormat.format("container.user matches updatedUser: {0}", container.getUser())); //NOI18N + } + + // Is it the same same password? + return UserUtils.ifPasswordMatches(container, updatedUser); + } + +} diff --git a/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java b/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java new file mode 100644 index 0000000..63c01d0 --- /dev/null +++ b/src/java/org/mxchange/jusercore/model/register/PizzaUserRegistrationSessionBean.java @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 . + */ +package org.mxchange.jusercore.model.register; + +import java.text.MessageFormat; +import javax.ejb.EJB; +import javax.ejb.Stateless; +import org.mxchange.jcoreee.database.BaseDatabaseBean; +import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; +import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; +import org.mxchange.jusercore.model.user.User; +import org.mxchange.jusercore.model.user.UserSessionBeanRemote; + +/** + * A session bean for user registration + *

+ * @author Roland Haeder + */ +@Stateless (name = "register", mappedName = "ejb/stateless-pizza-register", description = "A bean handling the user registration") +public class PizzaUserRegistrationSessionBean extends BaseDatabaseBean implements UserRegistrationSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 12_348_958_986_818_627L; + + /** + * User bean + */ + @EJB + private UserSessionBeanRemote userBean; + + @Override + public boolean isEmailAddressRegistered (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressRegistered: user={0} - CALLED!", user)); //NOI18N + + // Check bean + assert(this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Call other bean + return this.userBean.isEmailAddressReqistered(user); + } + + @Override + public boolean isUserNameRegistered (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("isUserNameRegistered: user={0} - CALLED!", user)); //NOI18N + + // Check bean + assert(this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Call other bean + return this.userBean.isUserNameReqistered(user); + } + + @Override + public User registerUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("registerUser: user={0} - CALLED!", user)); //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Check if user is registered + if (this.isUserNameRegistered(user)) { + // Abort here + throw new UserNameAlreadyRegisteredException(user); + } else if (this.isEmailAddressRegistered(user)) { + // Abort here + throw new EmailAddressAlreadyRegisteredException(user); + } + + // Persist it + this.getEntityManager().persist(user); + + // Flush to get id back + this.getEntityManager().flush(); + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("registerUser: user={0},user.id={1} - EXIT!", user, user.getUserId())); //NOI18N + + // Return it + return user; + } + +} diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java new file mode 100644 index 0000000..772efa0 --- /dev/null +++ b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java @@ -0,0 +1,487 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 . + */ +package org.mxchange.jusercore.model.user; + +import java.text.MessageFormat; +import java.util.GregorianCalendar; +import java.util.List; +import javax.ejb.EJBException; +import javax.ejb.Stateless; +import javax.persistence.NoResultException; +import javax.persistence.PersistenceException; +import javax.persistence.Query; +import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcoreee.database.BaseDatabaseBean; +import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber; +import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; +import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; +import org.mxchange.jusercore.model.user.profilemodes.ProfileMode; +import org.mxchange.jusercore.model.user.status.UserAccountStatus; + +/** + * A user bean + *

+ * @author Roland Haeder + */ +@Stateless (name = "user", mappedName = "ejb/stateless-pizza-user", description = "A bean handling the user data") +public class PizzaUserSessionBean extends BaseDatabaseBean implements UserSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 542_145_347_916L; + + /** + * Default constructor + */ + public PizzaUserSessionBean () { + } + + @Override + @SuppressWarnings ("unchecked") + public List allMemberPublicVisibleUsers () { + // Trace message + this.getLoggerBeanLocal().logTrace("allMemberPublicVisibleUsers: CALLED!"); //NOI18N + + // Get named query + Query query = this.getEntityManager().createNamedQuery("AllMemberPublicUsers", List.class); //NOI18N + + // Set parameters + query.setParameter("status", UserAccountStatus.CONFIRMED); //NOI18N + query.setParameter("members", ProfileMode.MEMBERS); //NOI18N + query.setParameter("public", ProfileMode.PUBLIC); //NOI18N + + // Get result + List users = query.getResultList(); + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("allMemberPublicVisibleUsers: users.size()={0} - EXIT!", users.size())); //NOI18N + + // Return full list + return users; + } + + @Override + @SuppressWarnings ("unchecked") + public List allPublicUsers () { + // Trace message + this.getLoggerBeanLocal().logTrace("allPublicUsers: CALLED!"); //NOI18N + + // Get named query + Query query = this.getEntityManager().createNamedQuery("AllPublicUsers", List.class); //NOI18N + + // Set parameters + query.setParameter("status", UserAccountStatus.CONFIRMED); //NOI18N + query.setParameter("mode", ProfileMode.PUBLIC); //NOI18N + + // Get result + List users = query.getResultList(); + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("allPublicUsers: users.size()={0} - EXIT!", users.size())); //NOI18N + + // Return full list + return users; + } + + @Override + public User fillUserData (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("fillUserData: user={0} - CALLED!", user)); //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Try to locate it + Query query = this.getEntityManager().createNamedQuery("SearchUserName", LoginUser.class); //NOI18N + + // Set parameter + query.setParameter("param", user.getUserName()); //NOI18N + + // Initialize variable + User foundUser = null; + + // Try it + try { + // Try to get single result + foundUser = (User) query.getSingleResult(); + } catch (final NoResultException ex) { + // Log it + this.getLoggerBeanLocal().logException(ex); + } + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("fillUserData: foundUser={0} - EXIT!", foundUser)); //NOI18N + + // Return prepared instance + return foundUser; + } + + @Override + @SuppressWarnings ("unchecked") + public List getEmailAddressList () { + // Get query + Query query = this.getEntityManager().createNamedQuery("AllEmailAddresses", String.class); //NOI18N + + // Get result list + List emailAddressList = query.getResultList(); + + // Return it + return emailAddressList; + } + + @Override + @SuppressWarnings ("unchecked") + public List getUserNameList () { + // Get query + Query query = this.getEntityManager().createNamedQuery("AllUserNames", String.class); //NOI18N + + // Get result list + List userNameList = query.getResultList(); + + // Return it + return userNameList; + } + + @Override + public boolean ifUserExists (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserExists: user={0} - CALLED!", user)); //NOI18N + + // userId should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } else if (user.getUserId() == null) { + // Abort here + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Invalid number + throw new IllegalArgumentException(MessageFormat.format("userId is not valid: {0}", user.getUserId())); //NOI18N + } + + // Generate query + Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N + + // Set parameter + query.setParameter("id", user.getUserId()); //NOI18N + + // Try this + try { + User dummy = (User) query.getSingleResult(); + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserExists: dummy.id={0} found.", dummy.getUserId())); //NOI18N + } catch (final NoResultException ex) { + // Log it + this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserExists: getSingleResult() returned no result: {0}", ex)); //NOI18N + + // User name does not exist + return false; + } catch (final PersistenceException ex) { + // Something bad happened + this.getLoggerBeanLocal().logWarning(MessageFormat.format("More than one user {0} found.", user, ex)); //NOI18N + + // Throw again + throw ex; + } + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserExists: Found user {0} - EXIT!", user)); //NOI18N + + // Found it + return true; + } + + @Override + public boolean ifUserIdExists (final Long userId) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserIdExists: userId={0} - CALLED!", userId)); //NOI18N + + // userId should not be null + if (null == userId) { + // Abort here + throw new NullPointerException("userId is null"); //NOI18N + } else if (userId < 1) { + // Invalid number + throw new IllegalArgumentException(MessageFormat.format("userId is not valid: {0}", userId)); //NOI18N + } + + // Generate query + Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N + + // Set parameter + query.setParameter("id", userId); //NOI18N + + // Try this + try { + User dummy = (User) query.getSingleResult(); + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserIdExists: dummy.id={0} found.", dummy.getUserId())); //NOI18N + } catch (final NoResultException ex) { + // Log it + this.getLoggerBeanLocal().logDebug(MessageFormat.format("ifUserIdExists: getSingleResult() returned no result: {0}", ex)); //NOI18N + + // User name does not exist + return false; + } catch (final PersistenceException ex) { + // Something bad happened + this.getLoggerBeanLocal().logWarning(MessageFormat.format("More than one user id {0} found.", userId, ex)); //NOI18N + + // Throw again + throw ex; + } + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("ifUserIdExists: Found user id {0} - EXIT!", userId)); //NOI18N + + // Found it + return true; + } + + @Override + public boolean isEmailAddressReqistered (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("isEmailAddressReqistered: user={0} - CALLED!", user)); //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Generate query + Query query = this.getEntityManager().createNamedQuery("SearchEmailAddress", LoginUser.class); //NOI18N + + // Set parameter + query.setParameter("param", user.getUserContact().getContactEmailAddress()); //NOI18N + + // Search for it + try { + User dummy = (User) query.getSingleResult(); + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("isEmailAddressReqistered: dummy.id={0} found.", dummy.getUserId())); //NOI18N + } catch (final NoResultException ex) { + // Log it + this.getLoggerBeanLocal().logDebug(MessageFormat.format("isEmailAddressReqistered: getSingleResult() returned no result: {0}", ex)); //NOI18N + + // Email address does not exist + return false; + } catch (final PersistenceException ex) { + // Something bad happened + this.getLoggerBeanLocal().logWarning(MessageFormat.format("More than one email address {0} found.", user.getUserContact().getContactEmailAddress()), ex); //NOI18N + + // Throw again + throw ex; + } + + // Found it + return true; + } + + @Override + public boolean isUserNameReqistered (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("isUserNameReqistered: user={0} - CALLED!", user)); //NOI18N + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } + + // Generate query + Query query = this.getEntityManager().createNamedQuery("SearchUserName", LoginUser.class); //NOI18N + + // Set parameter + query.setParameter("param", user.getUserName()); //NOI18N + + // Try this + try { + User dummy = (User) query.getSingleResult(); + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("isUserNameReqistered: dummy.id={0} found.", dummy.getUserId())); //NOI18N + } catch (final NoResultException ex) { + // Log it + this.getLoggerBeanLocal().logDebug(MessageFormat.format("isUserNameReqistered: getSingleResult() returned no result: {0}", ex)); //NOI18N + + // User name does not exist + return false; + } catch (final PersistenceException ex) { + // Something bad happened + this.getLoggerBeanLocal().logWarning(MessageFormat.format("More than one email address {0} found.", user.getUserContact().getContactEmailAddress()), ex); //NOI18N + + // Throw again + throw ex; + } + + // Found it + return true; + } + + @Override + public void updateUserPersonalData (final User user) { + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("updateUserPersonalData: user={0} - CALLED!", user)); + + // user should not be null + if (null == user) { + // Abort here + throw new NullPointerException("user is null"); //NOI18N + } else if (user.getUserId() == null) { + // Throw NPE again + throw new NullPointerException("user.userId is null"); //NOI18N + } else if (user.getUserId() < 1) { + // Not valid + throw new IllegalArgumentException(MessageFormat.format("user.userId={0} is not valid.", user.getUserId())); //NOI18N + } else if (user.getUserAccountStatus() == null) { + // Throw NPE again + throw new NullPointerException("user.userAccountStatus is null"); //NOI18N + } else if (!this.ifUserExists(user)) { + // User does not exist + throw new EJBException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N + } + + // Find the instance + User foundUser = this.getEntityManager().find(user.getClass(), user.getUserId()); + + // Should be found! + assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N + + // Merge user + User detachedUser = this.getEntityManager().merge(foundUser); + + // Should be found! + assert (detachedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", user.getUserId()); //NOI18N + + // Copy all data + detachedUser.copyAll(user); + + // Set as updated + detachedUser.setUserUpdated(new GregorianCalendar()); + detachedUser.getUserContact().setContactUpdated(new GregorianCalendar()); + + // Get contact from it and find it + Contact foundContact = this.getEntityManager().find(user.getUserContact().getClass(), user.getUserContact().getContactId()); + + // Should be found + assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", user.getUserContact().getContactId()); //NOI18N + + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: contact.contactId={0}", foundContact.getContactId())); + + // Merge contact instance + Contact detachedContact = this.getEntityManager().merge(foundContact); + + // Copy all + detachedContact.copyAll(user.getUserContact()); + + // Set it back in user + user.setUserContact(detachedContact); + + // Should be found! + assert (detachedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not merged, but should be.", user.getUserContact().getContactId()); //NOI18N + + // Get cellphone instance + DialableCellphoneNumber cellphone = detachedContact.getContactCellphoneNumber(); + + // Is there a cellphone instance set? + if (cellphone instanceof DialableCellphoneNumber) { + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); + + // Then find it, too + DialableCellphoneNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId()); + + // Should be there + assert (foundCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); + + // Then merge it, too + DialableCellphoneNumber detachedCellphone = this.getEntityManager().merge(foundCellphone); + + // Should be there + assert (detachedCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); + + // Copy all + detachedCellphone.copyAll(user.getUserContact().getContactCellphoneNumber()); + + // Set it back + detachedContact.setContactCellphoneNumber(detachedCellphone); + } + + // Get cellphone instance + DialableFaxNumber fax = detachedContact.getContactFaxNumber(); + + // Is there a fax instance set? + if (fax instanceof DialableFaxNumber) { + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: fax.phoneId={0} is being updated ...", fax.getPhoneId())); + + // Then find it, too + DialableFaxNumber foundFax = this.getEntityManager().find(fax.getClass(), fax.getPhoneId()); + + // Should be there + assert (foundFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", foundFax.getPhoneId()); + + // Then merge it, too + DialableFaxNumber detachedFax = this.getEntityManager().merge(foundFax); + + // Should be there + assert (detachedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", detachedFax.getPhoneId()); + + // Copy all + detachedFax.copyAll(user.getUserContact().getContactFaxNumber()); + + // Set it back + detachedContact.setContactFaxNumber(detachedFax); + } + + // Get cellphone instance + DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber(); + + // Is there a fax instance set? + if (landLine instanceof DialableLandLineNumber) { + // Debug message + this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: landLine.phoneId={0} is being updated ...", landLine.getPhoneId())); + + // Then find it, too + DialableLandLineNumber foundLandLine = this.getEntityManager().find(landLine.getClass(), landLine.getPhoneId()); + + // Should be there + assert (foundLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", foundLandLine.getPhoneId()); + + // Then merge it, too + DialableLandLineNumber detachedLandLine = this.getEntityManager().merge(foundLandLine); + + // Should be there + assert (detachedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", detachedLandLine.getPhoneId()); + + // Copy all + detachedLandLine.copyAll(user.getUserContact().getContactLandLineNumber()); + + // Set it back + detachedContact.setContactLandLineNumber(detachedLandLine); + } + } + +} -- 2.39.5