Package javax.persistence

Examples of javax.persistence.EntityTransaction.begin()


      ac.setDeleted("true");
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (ac.getTypId() == null) {
        session.persist(ac);
          } else {
            if (!session.contains(ac)) {
              session.merge(ac);
View Full Code Here


  private List getRoomsOrganisationByOrganisationId(long organisation_id, int start, int max, String orderby, boolean asc){
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      String hql = "select c from Rooms_Organisation as c " +
      "where c.organisation.organisation_id = :organisation_id " +
      "AND c.deleted <> :deleted";
      if (orderby.startsWith("c.")){
        hql += "ORDER BY "+orderby;
View Full Code Here

          "WHERE a.deleted <> :deleted ";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("deleted", "true");
     
       
      List<AppointmentReminderTyps> listAppointmentReminderTyp = query.getResultList();
View Full Code Here

  private Rooms_Organisation getRoomsOrganisationByOrganisationIdAndRoomId(long organisation_id, long rooms_id){
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      String hql = "select c from Rooms_Organisation as c " +
      "where c.room.rooms_id = :rooms_id " +
      "AND c.organisation.organisation_id = :organisation_id " +
      "AND c.deleted <> :deleted";
      Query q = session.createQuery(hql);
View Full Code Here

  public List getRoomsOrganisationByRoomsId(long rooms_id){
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      String hql = "select c from Rooms_Organisation as c " +
      "where c.room.rooms_id = :rooms_id " +
      "AND c.deleted <> :deleted";
      Query q = session.createQuery(hql);
     
View Full Code Here

  public List<Rooms_Organisation> getRoomsOrganisations(){
    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      CriteriaBuilder cb = session.getCriteriaBuilder();
      CriteriaQuery<Rooms_Organisation> cq = cb.createQuery(Rooms_Organisation.class);
      Root<Rooms_Organisation> c = cq.from(Rooms_Organisation.class);
      TypedQuery<Rooms_Organisation> q = session.createQuery(cq);
      List<Rooms_Organisation> ll = q.getResultList();
View Full Code Here

          r.setRoomtype(this.getRoomTypesById(roomtypes_id));
          r.setUpdatetime(new Date());
          Object idf = PersistenceSessionUtil.createSession();
          EntityManager session = PersistenceSessionUtil.getSession();
          EntityTransaction tx = session.getTransaction();
          tx.begin();
          if (r.getRooms_id() == null) {
            session.persist(r);
              } else {
                if (!session.contains(r)) {
                  session.merge(r);
View Full Code Here

      r.setAllowRecording(allowRecording);
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (r.getRooms_id() == null) {
        session.persist(r);
          } else {
            if (!session.contains(r)) {
              r = session.merge(r);
View Full Code Here

        r.setIsModeratedRoom(isModeratedRoom);
       
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
        tx.begin();
        if (r.getRooms_id() == null) {
          session.persist(r);
            } else {
              if (!session.contains(r)) {
                session.merge(r);
View Full Code Here

      r.setDeleted("true");
      r.setUpdatetime(new Date());
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (r.getRooms_id() == null) {
        session.persist(r);
          } else {
            if (!session.contains(r)) {
              session.merge(r);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.