Example usage for javax.persistence EntityTransaction begin

List of usage examples for javax.persistence EntityTransaction begin

Introduction

In this page you can find the example usage for javax.persistence EntityTransaction begin.

Prototype

public void begin();

Source Link

Document

Start a resource transaction.

Usage

From source file:portal.api.impl.PortalJpaController.java

public void deleteVxFOnBoardedDescriptor(int mpid) {

    EntityManager entityManager = entityManagerFactory.createEntityManager();
    VxFOnBoardedDescriptor c = entityManager.find(VxFOnBoardedDescriptor.class, mpid);

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.remove(c);/*from   w  w  w. j a v a  2  s  .  c  om*/
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public void deleteExperimentOnBoardDescriptor(int mpid) {

    EntityManager entityManager = entityManagerFactory.createEntityManager();
    ExperimentOnBoardDescriptor c = entityManager.find(ExperimentOnBoardDescriptor.class, mpid);

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.remove(c);/*from w  ww . j a va  2 s . c  om*/
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public void deletInfrastructure(int infraid) {

    EntityManager entityManager = entityManagerFactory.createEntityManager();
    Infrastructure c = entityManager.find(Infrastructure.class, infraid);

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.remove(c);//w w  w. j a  v  a2  s. com
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public InstalledVxF updateInstalledVxF(InstalledVxF is) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    InstalledVxF resis = entityManager.merge(is);
    entityTransaction.commit();//from www  . ja  v  a2  s.com

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public void deleteInstalledVxF(final InstalledVxF message) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();

    entityManager.remove(message);/*from  w  ww .j  av  a2s  . c o m*/

    entityTransaction.commit();
}

From source file:portal.api.impl.PortalJpaController.java

public PortalUser updatePortalUser(PortalUser bu) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    PortalUser resis = entityManager.merge(bu);
    entityTransaction.commit();//from www  . j  a  v a2 s.  c  o m

    return resis;
}

From source file:portal.api.impl.PortalJpaController.java

public PortalProperty updateProperty(PortalProperty p) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    PortalProperty bp = entityManager.merge(p);
    entityTransaction.commit();//from  w w w .  j a v a2 s .co  m

    return bp;
}

From source file:portal.api.impl.PortalJpaController.java

public void saveMANOplatform(MANOplatform mp) {
    logger.info("Will save MANOplatform = " + mp.getName());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.persist(mp);//from   ww w  . j  a v a 2  s  .  c o  m
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public void saveMANOprovider(MANOprovider mprovider) {
    logger.info("Will save MANOprovider = " + mprovider.getName());

    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();
    entityTransaction.begin();
    entityManager.persist(mprovider);/*  www  .j  a va2  s. com*/
    entityManager.flush();
    entityTransaction.commit();

}

From source file:portal.api.impl.PortalJpaController.java

public MANOplatform updateMANOplatform(MANOplatform c) {
    EntityManager entityManager = entityManagerFactory.createEntityManager();

    EntityTransaction entityTransaction = entityManager.getTransaction();

    entityTransaction.begin();
    MANOplatform resis = entityManager.merge(c);
    entityTransaction.commit();//from  w  w w  . ja v a 2  s .com

    return resis;
}