Package com.darkhonor.rage.model

Examples of com.darkhonor.rage.model.Category


            throw new NullPointerException("Category is null");
        } else
        {
            EntityTransaction tx = em.getTransaction();
            tx.begin();
            Category deletedCategory = em.find(Category.class, id);
            tx.commit();
            if (deletedCategory == null)
            {
                LOGGER.error("(delete) Provided Category ID does not exist");
                throw new IllegalArgumentException("Provided Category Id does not "
View Full Code Here


            throw new IllegalArgumentException("Category name is either null or blank");
        } else
        {
            EntityTransaction tx = em.getTransaction();
            tx.begin();
            Category updatedCategory = em.find(Category.class, category.getId());
            tx.commit();
            if (updatedCategory == null)
            {
                LOGGER.error("(update) Provided Category does not exist");
                throw new IllegalArgumentException("Provided Category does not exist");
            }
            updatedCategory.setName(category.getName());
            tx.begin();
            updatedCategory = em.merge(updatedCategory);
            tx.commit();
            return updatedCategory;
        }
View Full Code Here

TOP

Related Classes of com.darkhonor.rage.model.Category

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.