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;
}
// Generate query
- Query query = this.getEntityManager().createNamedQuery("SearchUser", LoginUser.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchUserId", LoginUser.class); //NOI18N
// Set parameter
- query.setParameter("user", user); //NOI18N
+ query.setParameter("id", user.getUserId()); //NOI18N
// Try this
try {
throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
} else if (!this.ifUserExists(user)) {
// User does not exist
- throw new PersistenceException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
+ throw new EJBException(MessageFormat.format("User with id {0} does not exist.", user.getUserId())); //NOI18N
}
// Find the instance