final com.abiquo.server.core.infrastructure.Repository repository, final Category category,
final HypervisorType hypervisor, final OSType ostype, final Boolean is64b,
final boolean imported, final FilterOptions filters)
{
Criteria crit = null;
Criterion sameEnterpriseOrShared = sameEnterpriseOrSharedInRepo(enterprise, repository);
if (imported)
{
Criterion importedTemplate = importedVirtualMachineTemplate(enterprise);
crit = createCriteria(Restrictions.or(sameEnterpriseOrShared, importedTemplate));
}
else
{
crit = createCriteria(sameEnterpriseOrShared);