Package entity

Examples of entity.Tagcorrelations


    public void edit(Tagcorrelations tagcorrelations) throws NonexistentEntityException, Exception {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Tagcorrelations persistentTagcorrelations = em.find(Tagcorrelations.class, tagcorrelations.getId());
            Tag referencedTagIdOld = persistentTagcorrelations.getReferencedTagId();
            Tag referencedTagIdNew = tagcorrelations.getReferencedTagId();
            Tag mainTagIdOld = persistentTagcorrelations.getMainTagId();
            Tag mainTagIdNew = tagcorrelations.getMainTagId();
            if (referencedTagIdNew != null) {
                referencedTagIdNew = em.getReference(referencedTagIdNew.getClass(), referencedTagIdNew.getId());
                tagcorrelations.setReferencedTagId(referencedTagIdNew);
            }
View Full Code Here


    public void destroy(Integer id) throws NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Tagcorrelations tagcorrelations;
            try {
                tagcorrelations = em.getReference(Tagcorrelations.class, id);
                tagcorrelations.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The tagcorrelations with id " + id + " no longer exists.", enfe);
            }
            Tag referencedTagId = tagcorrelations.getReferencedTagId();
            if (referencedTagId != null) {
                referencedTagId.getTagcorrelationsList().remove(tagcorrelations);
                referencedTagId = em.merge(referencedTagId);
            }
            Tag mainTagId = tagcorrelations.getMainTagId();
            if (mainTagId != null) {
                mainTagId.getTagcorrelationsList().remove(tagcorrelations);
                mainTagId = em.merge(mainTagId);
            }
            em.remove(tagcorrelations);
View Full Code Here

TOP

Related Classes of entity.Tagcorrelations

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.