Examples of JPADomain


Examples of org.apache.james.domainlist.jpa.model.JPADomain

    public boolean containsDomain(String domain) {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        final EntityTransaction transaction = entityManager.getTransaction();
        try {
            transaction.begin();
            JPADomain jpaDomain = (JPADomain) entityManager.createNamedQuery("findDomainByName").setParameter("name", domain).getSingleResult();
            transaction.commit();
            return (jpaDomain != null) ? true : false;
        } catch (PersistenceException e) {
            getLogger().debug("Failed to find domain", e);
            if (transaction.isActive()) {
View Full Code Here

Examples of org.apache.james.domainlist.jpa.model.JPADomain

    protected boolean addDomainInternal(String domain) {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        final EntityTransaction transaction = entityManager.getTransaction();
        try {
            transaction.begin();
            JPADomain jpaDomain = new JPADomain(domain);
            entityManager.persist(jpaDomain);
            transaction.commit();
            return true;
        } catch (PersistenceException e) {
            getLogger().debug("Failed to save domain", e);
View Full Code Here

Examples of org.apache.james.domainlist.jpa.model.JPADomain

    public boolean containsDomain(String domain) throws DomainListException {
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        final EntityTransaction transaction = entityManager.getTransaction();
        try {
            transaction.begin();
            JPADomain jpaDomain = (JPADomain) entityManager.createNamedQuery("findDomainByName").setParameter("name", domain).getSingleResult();
            transaction.commit();
            return (jpaDomain != null);
        } catch (NoResultException e) {
            getLogger().debug("No domain found", e);
            transaction.commit();
View Full Code Here

Examples of org.apache.james.domainlist.jpa.model.JPADomain

        }
        EntityManager entityManager = entityManagerFactory.createEntityManager();
        final EntityTransaction transaction = entityManager.getTransaction();
        try {
            transaction.begin();
            JPADomain jpaDomain = new JPADomain(lowerCasedDomain);
            entityManager.persist(jpaDomain);
            transaction.commit();
        } catch (PersistenceException e) {
            getLogger().error("Failed to save domain", e);
            if (transaction.isActive()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.