]> git.mxchange.org Git - pizzaservice-mailer-ejb.git/commitdiff
renamed after project's name
authorRoland Haeder <roland@mxchange.org>
Sun, 17 Apr 2016 10:40:08 +0000 (12:40 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 17 Apr 2016 10:40:08 +0000 (12:40 +0200)
src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookPhoneSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java [deleted file]

diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/AddressbookPhoneSessionBean.java
new file mode 100644 (file)
index 0000000..17a100a
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jphone.phonenumbers.phone;
+
+import java.text.MessageFormat;
+import javax.ejb.Stateless;
+import javax.persistence.NoResultException;
+import javax.persistence.Query;
+import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
+import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
+import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
+
+/**
+ * A general phone EJB
+ * <p>
+ * @author Roland Haeder<roland@mxchange.org>
+ */
+@Stateless (name = "phone", mappedName = "ejb/stateless-addressbook-phone", description = "A bean handling phone data")
+public class AddressbookPhoneSessionBean extends BaseDatabaseBean implements PhoneSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 134_945_698_127_601L;
+
+       /**
+        * Default constructor
+        */
+       public AddressbookPhoneSessionBean () {
+       }
+
+       @Override
+       public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
+               // The id number should be valid
+               if (null == cellphoneId) {
+                       // Throw NPE
+                       throw new NullPointerException("cellphoneId is null"); //NOI18N
+               } else if (cellphoneId < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("cellphoneId={0} is not valid.", cellphoneId)); //NOI18N
+               }
+
+               // Now find it
+               Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", CellphoneNumber.class); //NOI18N
+
+               // Set parameter
+               query.setParameter("cellphoneId", cellphoneId); //NOI18N
+
+               // Init instance
+               DialableCellphoneNumber cellphone = null;
+
+               // Try to get a result
+               try {
+                       // Get a single result
+                       cellphone = (DialableCellphoneNumber) query.getSingleResult();
+               } catch (NoResultException ex) {
+                       // The entry was not found, so throw it again
+                       throw new PhoneEntityNotFoundException(cellphoneId, ex);
+               }
+
+               // Return found instance
+               return cellphone;
+       }
+
+}
diff --git a/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java b/src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java
deleted file mode 100644 (file)
index b903705..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jphone.phonenumbers.phone;
-
-import java.text.MessageFormat;
-import javax.ejb.Stateless;
-import javax.persistence.NoResultException;
-import javax.persistence.Query;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
-import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
-
-/**
- * A general phone EJB
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-@Stateless (name = "phone", mappedName = "ejb/stateless-pizza-phone", description = "A bean handling phone data")
-public class PizzaPhoneSessionBean extends BaseDatabaseBean implements PhoneSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 134_945_698_127_601L;
-
-       /**
-        * Default constructor
-        */
-       public PizzaPhoneSessionBean () {
-       }
-
-       @Override
-       public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
-               // The id number should be valid
-               if (null == cellphoneId) {
-                       // Throw NPE
-                       throw new NullPointerException("cellphoneId is null"); //NOI18N
-               } else if (cellphoneId < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("cellphoneId={0} is not valid.", cellphoneId)); //NOI18N
-               }
-
-               // Now find it
-               Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", CellphoneNumber.class); //NOI18N
-
-               // Set parameter
-               query.setParameter("cellphoneId", cellphoneId); //NOI18N
-
-               // Init instance
-               DialableCellphoneNumber cellphone = null;
-
-               // Try to get a result
-               try {
-                       // Get a single result
-                       cellphone = (DialableCellphoneNumber) query.getSingleResult();
-               } catch (NoResultException ex) {
-                       // The entry was not found, so throw it again
-                       throw new PhoneEntityNotFoundException(cellphoneId, ex);
-               }
-
-               // Return found instance
-               return cellphone;
-       }
-
-}