class HibernateAttributeOptionDAO extends HibernatePersistentObjectDAO<AttributeOption> implements AttributeOptionDAO {

	@Override
	public List<AttributeOption> findBySetIdAndAttribute(long setId, String attribute) {
		List<AttributeOption> coll = new ArrayList<AttributeOption>();
		try {
			if (StringUtils.isEmpty(attribute))
				coll = (List<AttributeOption>) findByQuery(
						"from AttributeOption _opt where _opt.deleted=0 and _opt.setId = ?1 order by _opt.position asc",
						new Object[] { Long.valueOf(setId) }, null);
			else
				coll = (List<AttributeOption>) findByQuery(
						"from AttributeOption _opt where _opt.deleted=0 and _opt.setId = ?1 and _opt.attribute = ?2 order by _opt.position asc",
						new Object[] { Long.valueOf(setId), attribute }, null);
		} catch (Throwable e) {
			log.error(e.getMessage(), e);
		}
		return coll;
	}

	public  HibernateAttributeOptionDAO();

}