Package gwlpr.database.entities

Examples of gwlpr.database.entities.Weaponset


        weaponset.getWeaponsetPK().setCharacterID(weaponset.getCharacter().getId());
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Weaponset persistentWeaponset = em.find(Weaponset.class, weaponset.getWeaponsetPK());
            Weapon weaponsOld = persistentWeaponset.getWeapons();
            Weapon weaponsNew = weaponset.getWeapons();
            Character characterOld = persistentWeaponset.getCharacter();
            Character characterNew = weaponset.getCharacter();
            if (weaponsNew != null) {
                weaponsNew = em.getReference(weaponsNew.getClass(), weaponsNew.getId());
                weaponset.setWeapons(weaponsNew);
            }
View Full Code Here


    public void destroy(WeaponsetPK id) throws NonexistentEntityException {
        EntityManager em = null;
        try {
            em = getEntityManager();
            em.getTransaction().begin();
            Weaponset weaponset;
            try {
                weaponset = em.getReference(Weaponset.class, id);
                weaponset.getWeaponsetPK();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The weaponset with id " + id + " no longer exists.", enfe);
            }
            Weapon weapons = weaponset.getWeapons();
            if (weapons != null) {
                weapons.getWeaponsetCollection().remove(weaponset);
                weapons = em.merge(weapons);
            }
            Character character = weaponset.getCharacter();
            if (character != null) {
                character.getWeaponsetCollection().remove(weaponset);
                character = em.merge(character);
            }
            em.remove(weaponset);
View Full Code Here

TOP

Related Classes of gwlpr.database.entities.Weaponset

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.