agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/dao/RemoteFilePermissionDao.java
/**
	 * Bulk deletes all logical file permissions for the specified username and 
	 * list of logical file ids
	 * 
	 * @param username
	 * @param logicalFileId
	 * @return
	 * @throws RemoteDataException
	 */
Bulk deletes all logical file permissions for the specified username and
list of logical file ids

@param username
@param logicalFileId
@return
@throws RemoteDataException
Bulk deletes all logical file permissions for the specified username and list of logical file ids @param username @param logicalFileId @return @throws RemoteDataException
public static void bulkDeleteByUsernameAndlogicalFileId(String username, List<BigInteger> logicalFileIds) 
	throws PermissionException
	{
		if (!ServiceUtils.isValid(username)) {
			throw new PermissionException("Username cannot be null");
		}
		if (logicalFileIds == null || logicalFileIds.isEmpty()) {
			return;
		}
		try
		{
			Session session = getSession();
			String hql = "DELETE FROM `remotefilepermissions` \n"
					+ "WHERE logical_file_id IN ( '"  
					+ StringUtils.join(logicalFileIds,"', '") 
					+ "' ) AND \n"
					+ "		username = :username AND \n"
					+ "		tenant_id = :tenantid";
			session.createSQLQuery(hql)
					.setString("username", username)
					.setString("tenantid", TenancyHelper.getCurrentTenantId())
					.executeUpdate();
			System.out.println(hql.replace(":username", username).replace(":tenantid", TenancyHelper.getCurrentTenantId()));
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception e) {}
			throw new PermissionException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception e) {}
		}
	}
public static void bulkDeleteByUsernameAndlogicalFileId ( String username , List < BigInteger > logicalFileIds ) throws PermissionException { if ( ! ServiceUtils . isValid ( username ) ) { throw new PermissionException ( "Username cannot be null" ) ; } if ( logicalFileIds == null || logicalFileIds . isEmpty ( ) ) { return ; } try { Session session = getSession ( ) ; String hql = "DELETE FROM `remotefilepermissions` \n" + "WHERE logical_file_id IN ( '" + StringUtils . join ( logicalFileIds , "', '" ) + "' ) AND \n" + "		username = :username AND \n" + "		tenant_id = :tenantid" ; session . createSQLQuery ( hql ) . setString ( "username" , username ) . setString ( "tenantid" , TenancyHelper . getCurrentTenantId ( ) ) . executeUpdate ( ) ; System . out . println ( hql . replace ( ":username" , username ) . replace ( ":tenantid" , TenancyHelper . getCurrentTenantId ( ) ) ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception e ) { } throw new PermissionException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception e ) { } } }
Bulk deletes all logical file permissions for the specified username and
 list of logical file ids
Bulk deletes all logical file permissions for the specified username and list of logical file ids