Package javax.persistence

Examples of javax.persistence.EntityExistsException


        }

        AttributableUtil attrUtil = getAttributableUtil(kind);

        if (schemaDAO.find(schemaTO.getName(), attrUtil.schemaClass()) != null) {
            throw new EntityExistsException(attrUtil.schemaClass().getSimpleName()
                    + " '" + schemaTO.getName() + "'");
        }

        AbstractSchema schema = attrUtil.newSchema();
        binder.create(schemaTO, schema);
View Full Code Here


            sccee.addException(sce);
            throw sccee;
        }

        if (resourceDAO.find(resourceTO.getName()) != null) {
            throw new EntityExistsException("Resource '" + resourceTO.getName() + "'");
        }

        ExternalResource resource = resourceDAO.save(binder.create(resourceTO));

        response.setStatus(HttpServletResponse.SC_CREATED);
View Full Code Here

        }

        AttributableUtil attrUtil = getAttributableUtil(kind);

        if (derSchemaDAO.find(derSchemaTO.getName(), attrUtil.derSchemaClass()) != null) {
            throw new EntityExistsException(attrUtil.schemaClass().getSimpleName()
                    + " '" + derSchemaTO.getName() + "'");
        }

        AbstractDerSchema derivedSchema = derSchemaDAO.save(binder.create(derSchemaTO, attrUtil.newDerSchema()));
View Full Code Here

            sccee.addException(sce);
            throw sccee;
        }

        if (resourceDAO.find(resourceTO.getName()) != null) {
            throw new EntityExistsException("Resource '" + resourceTO.getName() + "'");
        }

        ExternalResource resource = resourceDAO.save(binder.create(resourceTO));

        response.setStatus(HttpServletResponse.SC_CREATED);
View Full Code Here

        }

        AttributableUtil attrUtil = getAttributableUtil(kind);

        if (derSchemaDAO.find(derSchemaTO.getName(), attrUtil.derSchemaClass()) != null) {
            throw new EntityExistsException(attrUtil.schemaClass().getSimpleName()
                    + " '" + derSchemaTO.getName() + "'");
        }

        AbstractDerSchema derivedSchema = derSchemaDAO.save(binder.create(derSchemaTO, attrUtil.newDerSchema()));
View Full Code Here

            sccee.addException(sce);
            throw sccee;
        }

        if (resourceDAO.find(resourceTO.getName()) != null) {
            throw new EntityExistsException("Resource '" + resourceTO.getName() + "'");
        }

        ExternalResource resource = resourceDAO.save(binder.create(resourceTO));

        auditManager.audit(Category.resource, ResourceSubCategory.create, Result.success,
View Full Code Here

        }

        AttributableUtil attrUtil = getAttributableUtil(kind);

        if (virSchemaDAO.find(virSchemaTO.getName(), attrUtil.virSchemaClass()) != null) {
            throw new EntityExistsException(attrUtil.schemaClass().getSimpleName()
                    + " '" + virSchemaTO.getName() + "'");
        }

        AbstractVirSchema virSchema = virSchemaDAO.save(binder.create(virSchemaTO, attrUtil.newVirSchema()));
        response.setStatus(HttpServletResponse.SC_CREATED);
View Full Code Here

        }

        AttributableUtil attrUtil = getAttributableUtil(kind);

        if (schemaDAO.find(schemaTO.getName(), attrUtil.schemaClass()) != null) {
            throw new EntityExistsException(attrUtil.schemaClass().getSimpleName()
                    + " '" + schemaTO.getName() + "'");
        }

        AbstractSchema schema = attrUtil.newSchema();
        binder.create(schemaTO, schema);
View Full Code Here

      EntityNotFoundException converted = new EntityNotFoundException( e.getMessage() );
      handlePersistenceException( converted );
      return converted;
    }
        else if ( e instanceof org.hibernate.NonUniqueObjectException ) {
            EntityExistsException converted = new EntityExistsException( e.getMessage() );
            handlePersistenceException( converted );
            return converted;
        }
    else if ( e instanceof org.hibernate.NonUniqueResultException ) {
      NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
View Full Code Here

      PersistenceException converted = wrapLockException( (HibernateException) e, null );
      throwPersistenceException( converted );
    }
    else if ( e instanceof ConstraintViolationException ) {
      //FIXME this is bad cause ConstraintViolationException happens in other circumstances
      throwPersistenceException( new EntityExistsException( e ) );
    }
    else if ( e instanceof org.hibernate.QueryTimeoutException ) {
      javax.persistence.QueryTimeoutException converted = new javax.persistence.QueryTimeoutException(
          e.getMessage(), e
      );
View Full Code Here

TOP

Related Classes of javax.persistence.EntityExistsException

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.