Package org.apache.ibatis.session

Examples of org.apache.ibatis.session.SqlSession.commit()


  public void insertAuthorAndDeveloper(String login, ResourceDto resourceDto) {
    SqlSession session = mybatis.openSession(false);
    try {
      resourceDao.insertUsingExistingSession(resourceDto, session);
      insertAuthor(login, resourceDto.getId(), session);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here


    SqlSession session = mybatis.openSession(false);
    try {
      SemaphoreMapper mapper = session.getMapper(SemaphoreMapper.class);
      mapper.update(semaphore.getName());
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

  public void release(String name) {
    Preconditions.checkArgument(!Strings.isNullOrEmpty(name), SEMAPHORE_NAME_MUST_NOT_BE_EMPTY);
    SqlSession session = mybatis.openSession(false);
    try {
      session.getMapper(SemaphoreMapper.class).release(name);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

  public void insert(CharacteristicDto dto) {
    SqlSession session = mybatis.openSession(false);
    try {
      insert(dto, session);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

  public void update(CharacteristicDto dto) {
    SqlSession session = mybatis.openSession(false);
    try {
      update(dto, session);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

      } else {
        // New root characteristic
        newCharacteristic.setOrder(dbClient.debtCharacteristicDao().selectMaxCharacteristicOrder(session) + 1);
      }
      dbClient.debtCharacteristicDao().insert(newCharacteristic, session);
      session.commit();
      return toCharacteristic(newCharacteristic);
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

      CharacteristicDto dto = findCharacteristic(characteristicId, session);
      if (!dto.getName().equals(newName)) {
        dto.setName(newName);
        dto.setUpdatedAt(new Date(system2.now()));
        dbClient.debtCharacteristicDao().update(dto, session);
        session.commit();
      }
      return toCharacteristic(dto);
    } finally {
      MyBatis.closeQuietly(session);
    }
View Full Code Here

      dto.setOrder(nextOrder);
      dto.setUpdatedAt(new Date(system2.now()));
      dbClient.debtCharacteristicDao().update(dto, session);

      session.commit();
      return toCharacteristic(dto);
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
View Full Code Here

          .setMetricId(sourceCondition.getMetricId()).setOperator(sourceCondition.getOperator())
          .setWarningThreshold(sourceCondition.getWarningThreshold()).setErrorThreshold(sourceCondition.getErrorThreshold()).setPeriod(sourceCondition.getPeriod()),
          session
          );
      }
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
    return destinationGate;
  }
View Full Code Here

      if (isDefault(qGate)) {
        propertiesDao.deleteGlobalProperty(SONAR_QUALITYGATE_PROPERTY, session);
      }
      propertiesDao.deleteProjectProperties(SONAR_QUALITYGATE_PROPERTY, Long.toString(idToDelete), session);
      dao.delete(qGate, session);
      session.commit();
    } finally {
      MyBatis.closeQuietly(session);
    }
  }
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.