Search in sources :

Example 6 with IPersonAttributesGroupTestGroupDefinition

use of org.apereo.portal.groups.pags.dao.IPersonAttributesGroupTestGroupDefinition in project uPortal by Jasig.

the class JpaPersonAttributesGroupTestGroupDefinitionDao method deletePersonAttributesGroupTestGroupDefinition.

@PortalTransactional
@Override
public void deletePersonAttributesGroupTestGroupDefinition(IPersonAttributesGroupTestGroupDefinition definition) {
    Validate.notNull(definition, "definition can not be null");
    final IPersonAttributesGroupTestGroupDefinition persistentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(definition)) {
        persistentDefinition = definition;
    } else {
        persistentDefinition = entityManager.merge(definition);
    }
    entityManager.remove(persistentDefinition);
}
Also used : EntityManager(javax.persistence.EntityManager) IPersonAttributesGroupTestGroupDefinition(org.apereo.portal.groups.pags.dao.IPersonAttributesGroupTestGroupDefinition)

Example 7 with IPersonAttributesGroupTestGroupDefinition

use of org.apereo.portal.groups.pags.dao.IPersonAttributesGroupTestGroupDefinition in project uPortal by Jasig.

the class JpaPersonAttributesGroupTestGroupDefinitionDao method updatePersonAttributesGroupTestGroupDefinition.

@PortalTransactional
@Override
public IPersonAttributesGroupTestGroupDefinition updatePersonAttributesGroupTestGroupDefinition(IPersonAttributesGroupTestGroupDefinition personAttributesGroupTestGroupDefinition) {
    Validate.notNull(personAttributesGroupTestGroupDefinition, "personAttributesGroupTestGroupDefinition can not be null");
    final IPersonAttributesGroupTestGroupDefinition persistentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(personAttributesGroupTestGroupDefinition)) {
        persistentDefinition = personAttributesGroupTestGroupDefinition;
    } else {
        persistentDefinition = entityManager.merge(personAttributesGroupTestGroupDefinition);
    }
    this.getEntityManager().persist(persistentDefinition);
    return persistentDefinition;
}
Also used : EntityManager(javax.persistence.EntityManager) IPersonAttributesGroupTestGroupDefinition(org.apereo.portal.groups.pags.dao.IPersonAttributesGroupTestGroupDefinition)

Aggregations

IPersonAttributesGroupTestGroupDefinition (org.apereo.portal.groups.pags.dao.IPersonAttributesGroupTestGroupDefinition)7 IPersonAttributesGroupDefinition (org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 EntityManager (javax.persistence.EntityManager)2 PersonAttributesGroupDefinitionImpl (org.apereo.portal.groups.pags.dao.jpa.PersonAttributesGroupDefinitionImpl)2 IPerson (org.apereo.portal.security.IPerson)2 RuntimeAuthorizationException (org.apereo.portal.security.RuntimeAuthorizationException)2 EntityIdentifier (org.apereo.portal.EntityIdentifier)1 IEntityGroup (org.apereo.portal.groups.IEntityGroup)1 QName (org.dom4j.QName)1