Package gwlpr.database.entities

Examples of gwlpr.database.entities.Attributepoint


        attributepoint.getAttributepointPK().setAttributeID(attributepoint.getAttribute().getId());
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Attributepoint persistentAttributepoint = em.find(Attributepoint.class, attributepoint.getAttributepointPK());
            Character characterOld = persistentAttributepoint.getCharacter();
            Character characterNew = attributepoint.getCharacter();
            Attribute attributeOld = persistentAttributepoint.getAttribute();
            Attribute attributeNew = attributepoint.getAttribute();
            if (characterNew != null) {
                characterNew = em.getReference(characterNew.getClass(), characterNew.getId());
                attributepoint.setCharacter(characterNew);
            }
View Full Code Here


    public void destroy(AttributepointPK id) throws NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Attributepoint attributepoint;
            try {
                attributepoint = em.getReference(Attributepoint.class, id);
                attributepoint.getAttributepointPK();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The attributepoint with id " + id + " no longer exists.", enfe);
            }
            Character character = attributepoint.getCharacter();
            if (character != null) {
                character.getAttributepointCollection().remove(attributepoint);
                character = em.merge(character);
            }
            Attribute attribute = attributepoint.getAttribute();
            if (attribute != null) {
                attribute.getAttributepointCollection().remove(attributepoint);
                attribute = em.merge(attribute);
            }
            em.remove(attributepoint);
View Full Code Here

TOP

Related Classes of gwlpr.database.entities.Attributepoint

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.