Package net.stinfoservices.pacifiq.shared.exception

Examples of net.stinfoservices.pacifiq.shared.exception.CustomException


            Profile nprofile = entityManager.merge(profile);
            entityManager.remove(nprofile);
            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_DELETED"), this.getClass().getSimpleName(),
                    nprofile.getId()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here


                c = result.get(0);
            }

            return (c);
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

            return ((Profile) entityManager
                    .createQuery(
                            "SELECT p FROM " + IModel.DATABASE_PRE + "Uzer u, " + IModel.DATABASE_PRE + "Profile p "
                                    + "where u.id=:userId and u.profile.id=p.id").setParameter("userId", uzer.getId()).getSingleResult());
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

                        result.add(new UzerProfile(uzer, profile));
                    }
                }
            }
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
        try {
            javax.persistence.Query q2 = entityManager.createQuery("SELECT p FROM " + IModel.DATABASE_PRE + "Profile p "
                    + "where p.id not in(select u.profile.id as id from " + IModel.DATABASE_PRE + "Uzer u)");
            for (Object o : q2.getResultList()) {
                if (o instanceof Profile) {
                    Profile profile = (Profile) o;
                    result.add(new UzerProfile(null, profile));
                }
            }
        } catch (Exception ex) {
            throw new CustomException(ex);
        }

        switch (orderBy) {
            case PROFILE_AND_THEN_UZER:
                Collections.sort(result, new UzerProfileComparator());
View Full Code Here

        try {
            Query q = entityManager.createQuery("SELECT count(*) FROM " + IModel.DATABASE_PRE + "Uzer u, " + IModel.DATABASE_PRE + "Profile p "
                    + "where u.profile.id=p.id");
            count += (Long) q.getSingleResult();
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
        try {
            Query q2 = entityManager.createQuery("SELECT count(*) FROM " + IModel.DATABASE_PRE + "Profile p "
                    + "where p.id not in(select u.profile.id as id from " + IModel.DATABASE_PRE + "Uzer u)");
            count += (Long) q2.getSingleResult();
        } catch (Exception ex) {
            throw new CustomException(ex);
        }

        return (count);
    }
View Full Code Here

    @Override
    public void updateName(Long id, String name) throws Exception {
        try {
            documentServiceCore.updateName(id, name);
        } catch (JpaSystemException e) {
            throw new CustomException(MessageFormat.format(
                    documentServiceCore.getMessageResource().getString("EXCEPTION_DOCUMENT_NAME_ALREADY_USED"), name));
        }
    }
View Full Code Here

    @Override
    public Long saveDocument(DocumentDTO document) throws Exception {
        try {
            return documentServiceCore.saveDocument(document);
        } catch (JpaSystemException e) {
            throw new CustomException(MessageFormat.format(
                    documentServiceCore.getMessageResource().getString("EXCEPTION_DOCUMENT_NAME_ALREADY_USED"), document.getName()));
        }
    }
View Full Code Here

        }

        try {
            return (entityManager.find(Item.class, id));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

    @Override
    public List<Item> findAll() throws Exception {
        try {
            return (Collections.unmodifiableList(entityManager.createQuery("SELECT o FROM " + IModel.DATABASE_PRE + "Item o").getResultList()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

    public List<Item> findEntries(int firstResult, int maxResults) throws Exception {
        try {
            return (Collections.unmodifiableList(entityManager.createQuery("SELECT o FROM " + IModel.DATABASE_PRE + "Item o")
                    .setFirstResult(firstResult).setMaxResults(maxResults).getResultList()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.shared.exception.CustomException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.