return query.getResultList();
}
- @Override
- @SuppressWarnings ("unchecked")
- public List<Addressbook> getUsersList (final User loggedInUser) {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("getUsersList: loggedInUser={0} - CALLED!", loggedInUser)); //NOI18N
-
- // Is the user instance null?
- if (null == loggedInUser) {
- // Abort here
- throw new NullPointerException("loggedInUser is null"); //NOI18N
- }
-
- // Get query instance
- Query query = this.getEntityManager().createNamedQuery("AllUsersAddressbooks", List.class); //NOI18N
-
- // Set parameter
- query.setParameter("param", loggedInUser); //NOI18N
-
- // Get full list from JPA
- List<Addressbook> addressbooks = query.getResultList();
-
- // Return it
- return addressbooks;
- }
-
@Override
public Addressbook createAddressbook (final Addressbook addressbook) throws AddressbookNameAlreadyUsedException {
// Is it not null?
// Return it updated
return addressbook;
}
+
+ @Override
+ @SuppressWarnings ("unchecked")
+ public List<Addressbook> getUsersList (final User loggedInUser) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("getUsersList: loggedInUser={0} - CALLED!", loggedInUser)); //NOI18N
+
+ // Is the user instance null?
+ if (null == loggedInUser) {
+ // Abort here
+ throw new NullPointerException("loggedInUser is null"); //NOI18N
+ }
+
+ // Get query instance
+ Query query = this.getEntityManager().createNamedQuery("AllUsersAddressbooks", List.class); //NOI18N
+
+ // Set parameter
+ query.setParameter("param", loggedInUser); //NOI18N
+
+ // Get full list from JPA
+ List<Addressbook> addressbooks = query.getResultList();
+
+ // Return it
+ return addressbooks;
+ }
@Override
public boolean isAddressbookIdUsed (final Long addressbookId) {