Package gwlpr.database.entities

Examples of gwlpr.database.entities.Account


            Faction faction = factionstat.getFaction();
            if (faction != null) {
                faction = em.getReference(faction.getClass(), faction.getId());
                factionstat.setFaction(faction);
            }
            Account account = factionstat.getAccount();
            if (account != null) {
                account = em.getReference(account.getClass(), account.getEMail());
                factionstat.setAccount(account);
            }
            em.persist(factionstat);
            if (faction != null) {
                faction.getFactionstatCollection().add(factionstat);
                faction = em.merge(faction);
            }
            if (account != null) {
                account.getFactionstatCollection().add(factionstat);
                account = em.merge(account);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            if (findFactionstat(factionstat.getFactionstatPK()) != null) {
View Full Code Here


            em = getEntityManager();
            em.getTransaction().begin();
            Factionstat persistentFactionstat = em.find(Factionstat.class, factionstat.getFactionstatPK());
            Faction factionOld = persistentFactionstat.getFaction();
            Faction factionNew = factionstat.getFaction();
            Account accountOld = persistentFactionstat.getAccount();
            Account accountNew = factionstat.getAccount();
            if (factionNew != null) {
                factionNew = em.getReference(factionNew.getClass(), factionNew.getId());
                factionstat.setFaction(factionNew);
            }
            if (accountNew != null) {
                accountNew = em.getReference(accountNew.getClass(), accountNew.getEMail());
                factionstat.setAccount(accountNew);
            }
            factionstat = em.merge(factionstat);
            if (factionOld != null && !factionOld.equals(factionNew)) {
                factionOld.getFactionstatCollection().remove(factionstat);
                factionOld = em.merge(factionOld);
            }
            if (factionNew != null && !factionNew.equals(factionOld)) {
                factionNew.getFactionstatCollection().add(factionstat);
                factionNew = em.merge(factionNew);
            }
            if (accountOld != null && !accountOld.equals(accountNew)) {
                accountOld.getFactionstatCollection().remove(factionstat);
                accountOld = em.merge(accountOld);
            }
            if (accountNew != null && !accountNew.equals(accountOld)) {
                accountNew.getFactionstatCollection().add(factionstat);
                accountNew = em.merge(accountNew);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
View Full Code Here

            Faction faction = factionstat.getFaction();
            if (faction != null) {
                faction.getFactionstatCollection().remove(factionstat);
                faction = em.merge(faction);
            }
            Account account = factionstat.getAccount();
            if (account != null) {
                account.getFactionstatCollection().remove(factionstat);
                account = em.merge(account);
            }
            em.remove(factionstat);
            em.getTransaction().commit();
        } finally {
View Full Code Here

            Inventory inventoryID = storagetab.getInventoryID();
            if (inventoryID != null) {
                inventoryID = em.getReference(inventoryID.getClass(), inventoryID.getId());
                storagetab.setInventoryID(inventoryID);
            }
            Account account = storagetab.getAccount();
            if (account != null) {
                account = em.getReference(account.getClass(), account.getEMail());
                storagetab.setAccount(account);
            }
            em.persist(storagetab);
            if (inventoryID != null) {
                inventoryID.getStoragetabCollection().add(storagetab);
                inventoryID = em.merge(inventoryID);
            }
            if (account != null) {
                account.getStoragetabCollection().add(storagetab);
                account = em.merge(account);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            if (findStoragetab(storagetab.getStoragetabPK()) != null) {
View Full Code Here

            em = getEntityManager();
            em.getTransaction().begin();
            Storagetab persistentStoragetab = em.find(Storagetab.class, storagetab.getStoragetabPK());
            Inventory inventoryIDOld = persistentStoragetab.getInventoryID();
            Inventory inventoryIDNew = storagetab.getInventoryID();
            Account accountOld = persistentStoragetab.getAccount();
            Account accountNew = storagetab.getAccount();
            if (inventoryIDNew != null) {
                inventoryIDNew = em.getReference(inventoryIDNew.getClass(), inventoryIDNew.getId());
                storagetab.setInventoryID(inventoryIDNew);
            }
            if (accountNew != null) {
                accountNew = em.getReference(accountNew.getClass(), accountNew.getEMail());
                storagetab.setAccount(accountNew);
            }
            storagetab = em.merge(storagetab);
            if (inventoryIDOld != null && !inventoryIDOld.equals(inventoryIDNew)) {
                inventoryIDOld.getStoragetabCollection().remove(storagetab);
                inventoryIDOld = em.merge(inventoryIDOld);
            }
            if (inventoryIDNew != null && !inventoryIDNew.equals(inventoryIDOld)) {
                inventoryIDNew.getStoragetabCollection().add(storagetab);
                inventoryIDNew = em.merge(inventoryIDNew);
            }
            if (accountOld != null && !accountOld.equals(accountNew)) {
                accountOld.getStoragetabCollection().remove(storagetab);
                accountOld = em.merge(accountOld);
            }
            if (accountNew != null && !accountNew.equals(accountOld)) {
                accountNew.getStoragetabCollection().add(storagetab);
                accountNew = em.merge(accountNew);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
View Full Code Here

            Inventory inventoryID = storagetab.getInventoryID();
            if (inventoryID != null) {
                inventoryID.getStoragetabCollection().remove(storagetab);
                inventoryID = em.merge(inventoryID);
            }
            Account account = storagetab.getAccount();
            if (account != null) {
                account.getStoragetabCollection().remove(storagetab);
                account = em.merge(account);
            }
            em.remove(storagetab);
            em.getTransaction().commit();
        } finally {
View Full Code Here

            Inventory backpack = character.getBackpack();
            if (backpack != null) {
                backpack = em.getReference(backpack.getClass(), backpack.getId());
                character.setBackpack(backpack);
            }
            Account accountID = character.getAccountID();
            if (accountID != null) {
                accountID = em.getReference(accountID.getClass(), accountID.getEMail());
                character.setAccountID(accountID);
            }
            Collection<Skill> attachedSkillCollection = new ArrayList<Skill>();
            for (Skill skillCollectionSkillToAttach : character.getSkillCollection()) {
                skillCollectionSkillToAttach = em.getReference(skillCollectionSkillToAttach.getClass(), skillCollectionSkillToAttach.getId());
                attachedSkillCollection.add(skillCollectionSkillToAttach);
            }
            character.setSkillCollection(attachedSkillCollection);
            Collection<Profession> attachedProfessionCollection = new ArrayList<Profession>();
            for (Profession professionCollectionProfessionToAttach : character.getProfessionCollection()) {
                professionCollectionProfessionToAttach = em.getReference(professionCollectionProfessionToAttach.getClass(), professionCollectionProfessionToAttach.getId());
                attachedProfessionCollection.add(professionCollectionProfessionToAttach);
            }
            character.setProfessionCollection(attachedProfessionCollection);
            Collection<EquippedSkill> attachedEquippedSkillCollection = new ArrayList<EquippedSkill>();
            for (EquippedSkill equippedSkillCollectionEquippedSkillToAttach : character.getEquippedSkillCollection()) {
                equippedSkillCollectionEquippedSkillToAttach = em.getReference(equippedSkillCollectionEquippedSkillToAttach.getClass(), equippedSkillCollectionEquippedSkillToAttach.getEquippedSkillPK());
                attachedEquippedSkillCollection.add(equippedSkillCollectionEquippedSkillToAttach);
            }
            character.setEquippedSkillCollection(attachedEquippedSkillCollection);
            Collection<Weaponset> attachedWeaponsetCollection = new ArrayList<Weaponset>();
            for (Weaponset weaponsetCollectionWeaponsetToAttach : character.getWeaponsetCollection()) {
                weaponsetCollectionWeaponsetToAttach = em.getReference(weaponsetCollectionWeaponsetToAttach.getClass(), weaponsetCollectionWeaponsetToAttach.getWeaponsetPK());
                attachedWeaponsetCollection.add(weaponsetCollectionWeaponsetToAttach);
            }
            character.setWeaponsetCollection(attachedWeaponsetCollection);
            Collection<Item> attachedItemCollection = new ArrayList<Item>();
            for (Item itemCollectionItemToAttach : character.getItemCollection()) {
                itemCollectionItemToAttach = em.getReference(itemCollectionItemToAttach.getClass(), itemCollectionItemToAttach.getId());
                attachedItemCollection.add(itemCollectionItemToAttach);
            }
            character.setItemCollection(attachedItemCollection);
            Collection<Attributepoint> attachedAttributepointCollection = new ArrayList<Attributepoint>();
            for (Attributepoint attributepointCollectionAttributepointToAttach : character.getAttributepointCollection()) {
                attributepointCollectionAttributepointToAttach = em.getReference(attributepointCollectionAttributepointToAttach.getClass(), attributepointCollectionAttributepointToAttach.getAttributepointPK());
                attachedAttributepointCollection.add(attributepointCollectionAttributepointToAttach);
            }
            character.setAttributepointCollection(attachedAttributepointCollection);
            em.persist(character);
            if (secondaryProfession != null) {
                secondaryProfession.getCharacterCollection().add(character);
                secondaryProfession = em.merge(secondaryProfession);
            }
            if (primaryProfession != null) {
                primaryProfession.getCharacterCollection().add(character);
                primaryProfession = em.merge(primaryProfession);
            }
            if (level != null) {
                level.getCharacterCollection().add(character);
                level = em.merge(level);
            }
            if (lastOutpost != null) {
                lastOutpost.getCharacterCollection().add(character);
                lastOutpost = em.merge(lastOutpost);
            }
            if (equipmentPack != null) {
                equipmentPack.getCharacterCollection().add(character);
                equipmentPack = em.merge(equipmentPack);
            }
            if (equipment != null) {
                equipment.getCharacterCollection().add(character);
                equipment = em.merge(equipment);
            }
            if (beltpouch != null) {
                beltpouch.getCharacterCollection().add(character);
                beltpouch = em.merge(beltpouch);
            }
            if (bag2 != null) {
                bag2.getCharacterCollection().add(character);
                bag2 = em.merge(bag2);
            }
            if (bag1 != null) {
                bag1.getCharacterCollection().add(character);
                bag1 = em.merge(bag1);
            }
            if (backpack != null) {
                backpack.getCharacterCollection().add(character);
                backpack = em.merge(backpack);
            }
            if (accountID != null) {
                accountID.getCharacterCollection().add(character);
                accountID = em.merge(accountID);
            }
            for (Skill skillCollectionSkill : character.getSkillCollection()) {
                skillCollectionSkill.getCharacterCollection().add(character);
                skillCollectionSkill = em.merge(skillCollectionSkill);
View Full Code Here

            Inventory bag2New = character.getBag2();
            Inventory bag1Old = persistentCharacter.getBag1();
            Inventory bag1New = character.getBag1();
            Inventory backpackOld = persistentCharacter.getBackpack();
            Inventory backpackNew = character.getBackpack();
            Account accountIDOld = persistentCharacter.getAccountID();
            Account accountIDNew = character.getAccountID();
            Collection<Skill> skillCollectionOld = persistentCharacter.getSkillCollection();
            Collection<Skill> skillCollectionNew = character.getSkillCollection();
            Collection<Profession> professionCollectionOld = persistentCharacter.getProfessionCollection();
            Collection<Profession> professionCollectionNew = character.getProfessionCollection();
            Collection<EquippedSkill> equippedSkillCollectionOld = persistentCharacter.getEquippedSkillCollection();
            Collection<EquippedSkill> equippedSkillCollectionNew = character.getEquippedSkillCollection();
            Collection<Weaponset> weaponsetCollectionOld = persistentCharacter.getWeaponsetCollection();
            Collection<Weaponset> weaponsetCollectionNew = character.getWeaponsetCollection();
            Collection<Item> itemCollectionOld = persistentCharacter.getItemCollection();
            Collection<Item> itemCollectionNew = character.getItemCollection();
            Collection<Attributepoint> attributepointCollectionOld = persistentCharacter.getAttributepointCollection();
            Collection<Attributepoint> attributepointCollectionNew = character.getAttributepointCollection();
            List<String> illegalOrphanMessages = null;
            for (EquippedSkill equippedSkillCollectionOldEquippedSkill : equippedSkillCollectionOld) {
                if (!equippedSkillCollectionNew.contains(equippedSkillCollectionOldEquippedSkill)) {
                    if (illegalOrphanMessages == null) {
                        illegalOrphanMessages = new ArrayList<String>();
                    }
                    illegalOrphanMessages.add("You must retain EquippedSkill " + equippedSkillCollectionOldEquippedSkill + " since its character field is not nullable.");
                }
            }
            for (Weaponset weaponsetCollectionOldWeaponset : weaponsetCollectionOld) {
                if (!weaponsetCollectionNew.contains(weaponsetCollectionOldWeaponset)) {
                    if (illegalOrphanMessages == null) {
                        illegalOrphanMessages = new ArrayList<String>();
                    }
                    illegalOrphanMessages.add("You must retain Weaponset " + weaponsetCollectionOldWeaponset + " since its character field is not nullable.");
                }
            }
            for (Attributepoint attributepointCollectionOldAttributepoint : attributepointCollectionOld) {
                if (!attributepointCollectionNew.contains(attributepointCollectionOldAttributepoint)) {
                    if (illegalOrphanMessages == null) {
                        illegalOrphanMessages = new ArrayList<String>();
                    }
                    illegalOrphanMessages.add("You must retain Attributepoint " + attributepointCollectionOldAttributepoint + " since its character field is not nullable.");
                }
            }
            if (illegalOrphanMessages != null) {
                throw new IllegalOrphanException(illegalOrphanMessages);
            }
            if (secondaryProfessionNew != null) {
                secondaryProfessionNew = em.getReference(secondaryProfessionNew.getClass(), secondaryProfessionNew.getId());
                character.setSecondaryProfession(secondaryProfessionNew);
            }
            if (primaryProfessionNew != null) {
                primaryProfessionNew = em.getReference(primaryProfessionNew.getClass(), primaryProfessionNew.getId());
                character.setPrimaryProfession(primaryProfessionNew);
            }
            if (levelNew != null) {
                levelNew = em.getReference(levelNew.getClass(), levelNew.getLevel());
                character.setLevel(levelNew);
            }
            if (lastOutpostNew != null) {
                lastOutpostNew = em.getReference(lastOutpostNew.getClass(), lastOutpostNew.getId());
                character.setLastOutpost(lastOutpostNew);
            }
            if (equipmentPackNew != null) {
                equipmentPackNew = em.getReference(equipmentPackNew.getClass(), equipmentPackNew.getId());
                character.setEquipmentPack(equipmentPackNew);
            }
            if (equipmentNew != null) {
                equipmentNew = em.getReference(equipmentNew.getClass(), equipmentNew.getId());
                character.setEquipment(equipmentNew);
            }
            if (beltpouchNew != null) {
                beltpouchNew = em.getReference(beltpouchNew.getClass(), beltpouchNew.getId());
                character.setBeltpouch(beltpouchNew);
            }
            if (bag2New != null) {
                bag2New = em.getReference(bag2New.getClass(), bag2New.getId());
                character.setBag2(bag2New);
            }
            if (bag1New != null) {
                bag1New = em.getReference(bag1New.getClass(), bag1New.getId());
                character.setBag1(bag1New);
            }
            if (backpackNew != null) {
                backpackNew = em.getReference(backpackNew.getClass(), backpackNew.getId());
                character.setBackpack(backpackNew);
            }
            if (accountIDNew != null) {
                accountIDNew = em.getReference(accountIDNew.getClass(), accountIDNew.getEMail());
                character.setAccountID(accountIDNew);
            }
            Collection<Skill> attachedSkillCollectionNew = new ArrayList<Skill>();
            for (Skill skillCollectionNewSkillToAttach : skillCollectionNew) {
                skillCollectionNewSkillToAttach = em.getReference(skillCollectionNewSkillToAttach.getClass(), skillCollectionNewSkillToAttach.getId());
                attachedSkillCollectionNew.add(skillCollectionNewSkillToAttach);
            }
            skillCollectionNew = attachedSkillCollectionNew;
            character.setSkillCollection(skillCollectionNew);
            Collection<Profession> attachedProfessionCollectionNew = new ArrayList<Profession>();
            for (Profession professionCollectionNewProfessionToAttach : professionCollectionNew) {
                professionCollectionNewProfessionToAttach = em.getReference(professionCollectionNewProfessionToAttach.getClass(), professionCollectionNewProfessionToAttach.getId());
                attachedProfessionCollectionNew.add(professionCollectionNewProfessionToAttach);
            }
            professionCollectionNew = attachedProfessionCollectionNew;
            character.setProfessionCollection(professionCollectionNew);
            Collection<EquippedSkill> attachedEquippedSkillCollectionNew = new ArrayList<EquippedSkill>();
            for (EquippedSkill equippedSkillCollectionNewEquippedSkillToAttach : equippedSkillCollectionNew) {
                equippedSkillCollectionNewEquippedSkillToAttach = em.getReference(equippedSkillCollectionNewEquippedSkillToAttach.getClass(), equippedSkillCollectionNewEquippedSkillToAttach.getEquippedSkillPK());
                attachedEquippedSkillCollectionNew.add(equippedSkillCollectionNewEquippedSkillToAttach);
            }
            equippedSkillCollectionNew = attachedEquippedSkillCollectionNew;
            character.setEquippedSkillCollection(equippedSkillCollectionNew);
            Collection<Weaponset> attachedWeaponsetCollectionNew = new ArrayList<Weaponset>();
            for (Weaponset weaponsetCollectionNewWeaponsetToAttach : weaponsetCollectionNew) {
                weaponsetCollectionNewWeaponsetToAttach = em.getReference(weaponsetCollectionNewWeaponsetToAttach.getClass(), weaponsetCollectionNewWeaponsetToAttach.getWeaponsetPK());
                attachedWeaponsetCollectionNew.add(weaponsetCollectionNewWeaponsetToAttach);
            }
            weaponsetCollectionNew = attachedWeaponsetCollectionNew;
            character.setWeaponsetCollection(weaponsetCollectionNew);
            Collection<Item> attachedItemCollectionNew = new ArrayList<Item>();
            for (Item itemCollectionNewItemToAttach : itemCollectionNew) {
                itemCollectionNewItemToAttach = em.getReference(itemCollectionNewItemToAttach.getClass(), itemCollectionNewItemToAttach.getId());
                attachedItemCollectionNew.add(itemCollectionNewItemToAttach);
            }
            itemCollectionNew = attachedItemCollectionNew;
            character.setItemCollection(itemCollectionNew);
            Collection<Attributepoint> attachedAttributepointCollectionNew = new ArrayList<Attributepoint>();
            for (Attributepoint attributepointCollectionNewAttributepointToAttach : attributepointCollectionNew) {
                attributepointCollectionNewAttributepointToAttach = em.getReference(attributepointCollectionNewAttributepointToAttach.getClass(), attributepointCollectionNewAttributepointToAttach.getAttributepointPK());
                attachedAttributepointCollectionNew.add(attributepointCollectionNewAttributepointToAttach);
            }
            attributepointCollectionNew = attachedAttributepointCollectionNew;
            character.setAttributepointCollection(attributepointCollectionNew);
            character = em.merge(character);
            if (secondaryProfessionOld != null && !secondaryProfessionOld.equals(secondaryProfessionNew)) {
                secondaryProfessionOld.getCharacterCollection().remove(character);
                secondaryProfessionOld = em.merge(secondaryProfessionOld);
            }
            if (secondaryProfessionNew != null && !secondaryProfessionNew.equals(secondaryProfessionOld)) {
                secondaryProfessionNew.getCharacterCollection().add(character);
                secondaryProfessionNew = em.merge(secondaryProfessionNew);
            }
            if (primaryProfessionOld != null && !primaryProfessionOld.equals(primaryProfessionNew)) {
                primaryProfessionOld.getCharacterCollection().remove(character);
                primaryProfessionOld = em.merge(primaryProfessionOld);
            }
            if (primaryProfessionNew != null && !primaryProfessionNew.equals(primaryProfessionOld)) {
                primaryProfessionNew.getCharacterCollection().add(character);
                primaryProfessionNew = em.merge(primaryProfessionNew);
            }
            if (levelOld != null && !levelOld.equals(levelNew)) {
                levelOld.getCharacterCollection().remove(character);
                levelOld = em.merge(levelOld);
            }
            if (levelNew != null && !levelNew.equals(levelOld)) {
                levelNew.getCharacterCollection().add(character);
                levelNew = em.merge(levelNew);
            }
            if (lastOutpostOld != null && !lastOutpostOld.equals(lastOutpostNew)) {
                lastOutpostOld.getCharacterCollection().remove(character);
                lastOutpostOld = em.merge(lastOutpostOld);
            }
            if (lastOutpostNew != null && !lastOutpostNew.equals(lastOutpostOld)) {
                lastOutpostNew.getCharacterCollection().add(character);
                lastOutpostNew = em.merge(lastOutpostNew);
            }
            if (equipmentPackOld != null && !equipmentPackOld.equals(equipmentPackNew)) {
                equipmentPackOld.getCharacterCollection().remove(character);
                equipmentPackOld = em.merge(equipmentPackOld);
            }
            if (equipmentPackNew != null && !equipmentPackNew.equals(equipmentPackOld)) {
                equipmentPackNew.getCharacterCollection().add(character);
                equipmentPackNew = em.merge(equipmentPackNew);
            }
            if (equipmentOld != null && !equipmentOld.equals(equipmentNew)) {
                equipmentOld.getCharacterCollection().remove(character);
                equipmentOld = em.merge(equipmentOld);
            }
            if (equipmentNew != null && !equipmentNew.equals(equipmentOld)) {
                equipmentNew.getCharacterCollection().add(character);
                equipmentNew = em.merge(equipmentNew);
            }
            if (beltpouchOld != null && !beltpouchOld.equals(beltpouchNew)) {
                beltpouchOld.getCharacterCollection().remove(character);
                beltpouchOld = em.merge(beltpouchOld);
            }
            if (beltpouchNew != null && !beltpouchNew.equals(beltpouchOld)) {
                beltpouchNew.getCharacterCollection().add(character);
                beltpouchNew = em.merge(beltpouchNew);
            }
            if (bag2Old != null && !bag2Old.equals(bag2New)) {
                bag2Old.getCharacterCollection().remove(character);
                bag2Old = em.merge(bag2Old);
            }
            if (bag2New != null && !bag2New.equals(bag2Old)) {
                bag2New.getCharacterCollection().add(character);
                bag2New = em.merge(bag2New);
            }
            if (bag1Old != null && !bag1Old.equals(bag1New)) {
                bag1Old.getCharacterCollection().remove(character);
                bag1Old = em.merge(bag1Old);
            }
            if (bag1New != null && !bag1New.equals(bag1Old)) {
                bag1New.getCharacterCollection().add(character);
                bag1New = em.merge(bag1New);
            }
            if (backpackOld != null && !backpackOld.equals(backpackNew)) {
                backpackOld.getCharacterCollection().remove(character);
                backpackOld = em.merge(backpackOld);
            }
            if (backpackNew != null && !backpackNew.equals(backpackOld)) {
                backpackNew.getCharacterCollection().add(character);
                backpackNew = em.merge(backpackNew);
            }
            if (accountIDOld != null && !accountIDOld.equals(accountIDNew)) {
                accountIDOld.getCharacterCollection().remove(character);
                accountIDOld = em.merge(accountIDOld);
            }
            if (accountIDNew != null && !accountIDNew.equals(accountIDOld)) {
                accountIDNew.getCharacterCollection().add(character);
                accountIDNew = em.merge(accountIDNew);
            }
            for (Skill skillCollectionOldSkill : skillCollectionOld) {
                if (!skillCollectionNew.contains(skillCollectionOldSkill)) {
                    skillCollectionOldSkill.getCharacterCollection().remove(character);
View Full Code Here

            Inventory backpack = character.getBackpack();
            if (backpack != null) {
                backpack.getCharacterCollection().remove(character);
                backpack = em.merge(backpack);
            }
            Account accountID = character.getAccountID();
            if (accountID != null) {
                accountID.getCharacterCollection().remove(character);
                accountID = em.merge(accountID);
            }
            Collection<Skill> skillCollection = character.getSkillCollection();
            for (Skill skillCollectionSkill : skillCollection) {
                skillCollectionSkill.getCharacterCollection().remove(character);
View Full Code Here

            if (materialStorage != null) {
                materialStorage.getAccountCollection().add(account);
                materialStorage = em.merge(materialStorage);
            }
            for (Storagetab storagetabCollectionStoragetab : account.getStoragetabCollection()) {
                Account oldAccountOfStoragetabCollectionStoragetab = storagetabCollectionStoragetab.getAccount();
                storagetabCollectionStoragetab.setAccount(account);
                storagetabCollectionStoragetab = em.merge(storagetabCollectionStoragetab);
                if (oldAccountOfStoragetabCollectionStoragetab != null) {
                    oldAccountOfStoragetabCollectionStoragetab.getStoragetabCollection().remove(storagetabCollectionStoragetab);
                    oldAccountOfStoragetabCollectionStoragetab = em.merge(oldAccountOfStoragetabCollectionStoragetab);
                }
            }
            for (Factionstat factionstatCollectionFactionstat : account.getFactionstatCollection()) {
                Account oldAccountOfFactionstatCollectionFactionstat = factionstatCollectionFactionstat.getAccount();
                factionstatCollectionFactionstat.setAccount(account);
                factionstatCollectionFactionstat = em.merge(factionstatCollectionFactionstat);
                if (oldAccountOfFactionstatCollectionFactionstat != null) {
                    oldAccountOfFactionstatCollectionFactionstat.getFactionstatCollection().remove(factionstatCollectionFactionstat);
                    oldAccountOfFactionstatCollectionFactionstat = em.merge(oldAccountOfFactionstatCollectionFactionstat);
                }
            }
            for (Character characterCollectionCharacter : account.getCharacterCollection()) {
                Account oldAccountIDOfCharacterCollectionCharacter = characterCollectionCharacter.getAccountID();
                characterCollectionCharacter.setAccountID(account);
                characterCollectionCharacter = em.merge(characterCollectionCharacter);
                if (oldAccountIDOfCharacterCollectionCharacter != null) {
                    oldAccountIDOfCharacterCollectionCharacter.getCharacterCollection().remove(characterCollectionCharacter);
                    oldAccountIDOfCharacterCollectionCharacter = em.merge(oldAccountIDOfCharacterCollectionCharacter);
                }
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of gwlpr.database.entities.Account

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.