agave-systems/systems-core/src/main/java/org/iplantc/service/systems/dao/BatchQueueDao.java
/**
	 * Fetches the {@link BatchQueue} based on the {@code systemId} of the
	 * {@link ExecutionSystem} and the {@code name} of the {@link BatchQueue}.
	 * 
	 * Tenancy is honored on this query, so make sure you load the tenant of
	 * the corresponding {@link ExecutionSystem} if calling this without a
	 * Reqest session.
	 *  
	 * @param systemId id of the owning {@link ExecutionSystem}
	 * @param queueNameOrUuid name or uuid of the queue
	 * @return
	 */
Fetches the  BatchQueue based on the  systemId of the
ExecutionSystem and the  name of the  BatchQueue.

Tenancy is honored on this query, so make sure you load the tenant of
the corresponding  ExecutionSystem if calling this without a
Reqest session.

@param systemId id of the owning  ExecutionSystem
@param queueNameOrUuid name or uuid of the queue
@return
Fetches the BatchQueue based on the systemId of the ExecutionSystem and the name of the BatchQueue . Tenancy is honored on this query so make sure you load the tenant of the corresponding ExecutionSystem if calling this without a Reqest session . @param systemId id of the owning ExecutionSystem @param queueNameOrUuid name or uuid of the queue @return
public BatchQueue findBySystemIdAndName(String systemId, String queueNameOrUuid)
	{
		try
		{
			Session session = getSession();
			String hql =  "from BatchQueue b "
						+ "where (b.name = :name or uuid = :name) "
						+ "     and b.executionSystem.systemId = :systemId "
						+ "		and b.executionSystem.tenantId = :tenantId "
						+ "		and b.executionSystem.available = :available";
			BatchQueue queue = (BatchQueue)session.createQuery(hql)
			        .setString("name", queueNameOrUuid)
			        .setString("systemId", systemId)
					.setString("tenantId", TenancyHelper.getCurrentTenantId())
					.setBoolean("available", Boolean.TRUE)
					.setMaxResults(1)
					.uniqueResult();
			return queue;
		}
		catch (ObjectNotFoundException ex)
		{
			return null;
		}
		catch (HibernateException ex)
		{
			throw ex;
		}
	}
public BatchQueue findBySystemIdAndName ( String systemId , String queueNameOrUuid ) { try { Session session = getSession ( ) ; String hql = "from BatchQueue b " + "where (b.name = :name or uuid = :name) " + "     and b.executionSystem.systemId = :systemId " + "		and b.executionSystem.tenantId = :tenantId " + "		and b.executionSystem.available = :available" ; BatchQueue queue = ( BatchQueue ) session . createQuery ( hql ) . setString ( "name" , queueNameOrUuid ) . setString ( "systemId" , systemId ) . setString ( "tenantId" , TenancyHelper . getCurrentTenantId ( ) ) . setBoolean ( "available" , Boolean . TRUE ) . setMaxResults ( 1 ) . uniqueResult ( ) ; return queue ; } catch ( ObjectNotFoundException ex ) { return null ; } catch ( HibernateException ex ) { throw ex ; } }
Fetches the {@link BatchQueue} based on the {@code systemId} of the
 {@link ExecutionSystem} and the {@code name} of the {@link BatchQueue}.
Fetches the { @link BatchQueue } based on the { @code systemId } of the { @link ExecutionSystem } and the { @code name } of the { @link BatchQueue } .