Package gwlpr.database.entities

Examples of gwlpr.database.entities.Item


        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Itemstat persistentItemstat = em.find(Itemstat.class, itemstat.getItemstatPK());
            Item itemOld = persistentItemstat.getItem();
            Item itemNew = itemstat.getItem();
            if (itemNew != null) {
                itemNew = em.getReference(itemNew.getClass(), itemNew.getId());
                itemstat.setItem(itemNew);
            }
            itemstat = em.merge(itemstat);
            if (itemOld != null && !itemOld.equals(itemNew)) {
                itemOld.getItemstatCollection().remove(itemstat);
                itemOld = em.merge(itemOld);
            }
            if (itemNew != null && !itemNew.equals(itemOld)) {
                itemNew.getItemstatCollection().add(itemstat);
                itemNew = em.merge(itemNew);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
View Full Code Here


                itemstat = em.getReference(Itemstat.class, id);
                itemstat.getItemstatPK();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The itemstat with id " + id + " no longer exists.", enfe);
            }
            Item item = itemstat.getItem();
            if (item != null) {
                item.getItemstatCollection().remove(itemstat);
                item = em.merge(item);
            }
            em.remove(itemstat);
            em.getTransaction().commit();
        } finally {
View Full Code Here

TOP

Related Classes of gwlpr.database.entities.Item

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.