agave-systems/systems-core/src/main/java/org/iplantc/service/systems/dao/SystemRoleDao.java
/**
	 * Saves or updates a {@link SystemRole}. 
	 * @param pem
	 * @throws RolePersistenceException
	 */
Saves or updates a  SystemRole.
@param pem
@throws RolePersistenceException
Saves or updates a SystemRole . @param pem @throws RolePersistenceException
public static void persist(SystemRole pem) throws RolePersistenceException
	{
		if (pem == null)
			throw new RolePersistenceException("Permission cannot be null");
		try
		{
			HibernateUtil.beginTransaction();
			Session session = HibernateUtil.getSession();
			session.saveOrUpdate(pem);
			session.flush();
		}
		catch (HibernateException ex) {
			try {
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception e) {}
			throw new RolePersistenceException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction();} catch (Exception e) {}
		}
	}
public static void persist ( SystemRole pem ) throws RolePersistenceException { if ( pem == null ) throw new RolePersistenceException ( "Permission cannot be null" ) ; try { HibernateUtil . beginTransaction ( ) ; Session session = HibernateUtil . getSession ( ) ; session . saveOrUpdate ( pem ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception e ) { } throw new RolePersistenceException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception e ) { } } }
Saves or updates a {@link SystemRole}.
Saves or updates a { @link SystemRole } .