class HibernateGenericDAO extends HibernatePersistentObjectDAO<Generic> implements GenericDAO {

	@Override
	public List<Generic> findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId) {
		String query = " 1=1 ";
		if (StringUtils.isNotEmpty(type))
			query += " and _entity.type like '" + SqlUtil.doubleQuotes(type) + "' ";
		if (StringUtils.isNotEmpty(subtype))
			query += " and _entity.subtype like '" + SqlUtil.doubleQuotes(subtype) + "' ";
		if (qualifier != null)
			query += " and _entity.qualifier = " + qualifier;
		if (tenantId != null)
			query += " and _entity.tenantId = " + tenantId;

		try {
			return findByWhere(query, null, null);
		} catch (PersistenceException e) {
			log.error(e.getMessage(), e);
			return new ArrayList<Generic>();
		}
	}

	public  HibernateGenericDAO();

}