Package com.intel.mtwilson.as.data

Examples of com.intel.mtwilson.as.data.TblMle


    public void create(MwMleSource mwMleSource) {
        EntityManager em = getEntityManager();
        try {
           
            em.getTransaction().begin();
            TblMle mleId = mwMleSource.getMleId();
            if (mleId != null) {
                mleId = em.getReference(mleId.getClass(), mleId.getId());
                mwMleSource.setMleId(mleId);
            }
            em.persist(mwMleSource);
            if (mleId != null) {
                mleId.getMwMleSourceCollection().add(mwMleSource);
                em.merge(mleId);
            }
            em.getTransaction().commit();
        } finally {
            em.close();
View Full Code Here


        EntityManager em = getEntityManager();
        try {
           
            em.getTransaction().begin();
            MwMleSource persistentMwMleSource = em.find(MwMleSource.class, mwMleSource.getId());
            TblMle mleIdOld = persistentMwMleSource.getMleId();
            TblMle mleIdNew = mwMleSource.getMleId();
            if (mleIdNew != null) {
                mleIdNew = em.getReference(mleIdNew.getClass(), mleIdNew.getId());
                mwMleSource.setMleId(mleIdNew);
            }
            mwMleSource = em.merge(mwMleSource);
            if (mleIdOld != null && !mleIdOld.equals(mleIdNew)) {
                mleIdOld.getMwMleSourceCollection().remove(mwMleSource);
                mleIdOld = em.merge(mleIdOld);
            }
            if (mleIdNew != null && !mleIdNew.equals(mleIdOld)) {
                mleIdNew.getMwMleSourceCollection().add(mwMleSource);
                em.merge(mleIdNew);
            }
            em.getTransaction().commit();
        } catch (Exception ex) {
            String msg = ex.getLocalizedMessage();
View Full Code Here

                mwMleSource = em.getReference(MwMleSource.class, id);
                mwMleSource.getId();
            } catch (EntityNotFoundException enfe) {
                throw new NonexistentEntityException("The mwMleSource with id " + id + " no longer exists.", enfe);
            }
            TblMle mleId = mwMleSource.getMleId();
            if (mleId != null) {
                mleId.getMwMleSourceCollection().remove(mwMleSource);
                em.merge(mleId);
            }
            em.remove(mwMleSource);
            em.getTransaction().commit();
        } finally {
View Full Code Here

TOP

Related Classes of com.intel.mtwilson.as.data.TblMle

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.