@Override public String createItem(Item item, SystemUser systemUser) throws Exception { item.setCommonDomainProperty( CommonFunctions.getCommonDomainPropertyForSavingEntity(systemUser)); item.setStatus(Status.ACTIVE); if (!(item.getItemTypes() == null)) { for (ItemType itemType : item.getItemTypes()) { itemType.setItem(item); itemType.setStatus(Status.ACTIVE); itemType.setCommonDomainProperty( CommonFunctions.getCommonDomainPropertyForSavingEntity(systemUser)); if (!(itemType.getItemAttributeValues() == null)) { for (ItemAttributeValue itemAttributeValue : itemType.getItemAttributeValues()) { itemAttributeValue.setItemType(itemType); itemAttributeValue.setStatus(Status.ACTIVE); itemAttributeValue.setCommonDomainProperty( CommonFunctions.getCommonDomainPropertyForSavingEntity(systemUser)); } } } } commonDAO.createEntity(item); return ApplicationConstants.SUCCESS; }
@Override public List<Item> listAllItems(Status status) throws Exception { return commonDAO.getAllEntitiesByStatus(Item.class, status); }