public List<Template> findTemplatesAssignedTo(Host parentHost, boolean includeArchived) throws DotHibernateException {
HibernateUtil hu = new HibernateUtil(Template.class);
String query = !includeArchived?templatesUnderHostSQL + " and vi.deleted = " + DbConnectionFactory.getDBFalse():templatesUnderHostSQL;
hu.setSQLQuery(templatesUnderHostSQL);
hu.setParam(parentHost.getIdentifier());
return new ArrayList<Template>(new HashSet<Template>(hu.list()));
}
@SuppressWarnings("unchecked")
public List<Template> findTemplatesUserCanUse(User user, String hostName, String query,boolean searchHost ,int offset, int limit) throws DotDataException, DotSecurityException {