]> git.mxchange.org Git - jfinancials-ejb.git/blobdiff - src/java/org/mxchange/jcontactsbusiness/model/opening_time/FinancialsOpeningTimesSessionBean.java
Please cherry-pick:
[jfinancials-ejb.git] / src / java / org / mxchange / jcontactsbusiness / model / opening_time / FinancialsOpeningTimesSessionBean.java
index 7e418b5e30cfd5157c032c9a283fb91c4e9c8fc5..b7553ad2c0b728426e90bb4d6b247000b7260e4e 100644 (file)
@@ -19,9 +19,7 @@ package org.mxchange.jcontactsbusiness.model.opening_time;
 import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
-import javax.persistence.NoResultException;
 import javax.persistence.Query;
-import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoundException;
 import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
 
 /**
@@ -56,46 +54,4 @@ public class FinancialsOpeningTimesSessionBean extends BaseFinancialsDatabaseBea
                return list;
        }
 
-       @Override
-       public OpeningTime findOpeningTimesById (final Long departmentId) throws OpeningTimeNotFoundException {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findOpeningTimesById: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Validate parameter
-               if (null == departmentId) {
-                       // Throw NPE
-                       throw new NullPointerException("departmentId is null"); //NOI18N
-               } else if (departmentId < 1) {
-                       // Throw NPE
-                       throw new NullPointerException(MessageFormat.format("departmentId={0}is invalid", departmentId)); //NOI18N
-               }
-
-               // Get query
-               final Query query = this.getEntityManager().createNamedQuery("SearchOpeningTimesById", BusinessOpeningTime.class); //NOI18N
-
-               // Set parameter
-               query.setParameter("departmentId", departmentId); //NOI18N
-
-               // Get single instance
-               final OpeningTime department;
-
-               // Try to find a result
-               try {
-                       // Find a single result
-                       department = (OpeningTime) query.getSingleResult();
-
-                       // Log trace message
-                       this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findOpeningTimesById: Found department={1}", this.getClass().getSimpleName(), department)); //NOI18N
-               } catch (final NoResultException ex) {
-                       // No result found
-                       throw new OpeningTimeNotFoundException(departmentId, ex);
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findOpeningTimesById: department={1} - EXIT!", this.getClass().getSimpleName(), department)); //NOI18N
-
-               // Return it
-               return department;
-       }
-
 }