List<ProductSku> productSkus = criteria.list();
return productSkus;
}
public List<ProductSku> findProductSkusNotInThisMasterCatalogCategoryId(final Long categoryId, Object... params) {
DetachedCriteria subquery = DetachedCriteria.forClass(ProductSku.class);
subquery.createAlias("catalogCategoryMasterProductSkuRels", "catalogCategoryProductSkuRel", JoinType.LEFT_OUTER_JOIN);
subquery.add(Restrictions.eq("catalogCategoryProductSkuRel.pk.catalogCategoryMaster.id", categoryId));
subquery.setProjection(Projections.property("id"));
Criteria criteria = createDefaultCriteria(ProductSku.class);
handleSpecificProductMarketingFetchMode(criteria, params);
criteria.add(Subqueries.notIn("id", subquery));