Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Entity entity = null;
- try {
- entity = query.getSingleResult();
- } catch (NoResultException ignore) {
- return null;
- }
- return entity;
- List<Entity> entities = null;
- entities = query.getResultList();
- if (entities.size() > 0) {
- return entities.get(0);
- }
- return null;
Add Comment
Please, Sign In to add comment