Examples of DbWork


Examples of ch.inftec.ju.db.DbWork

  private void runLiquibaseChangeLog(final String changeLogResourceName, final Map<String, String> parameters) {
    // Make sure we have a transaction when accessing entity manager meta data
    final DbType dbType = this.connUtil.getDbType();
    final String metaDataUserName = this.connUtil.getMetaDataInfo().getUserName();
   
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        try {
          JdbcConnection jdbcConn = new JdbcConnection(conn);
         
View Full Code Here

Examples of ch.inftec.ju.db.DbWork

    this.configProperties.put(name, value);
    return this;
  }
 
  private void execute(final DbUnitWork work) {
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        doExecute(conn, work);
      }
    });
View Full Code Here

Examples of ch.inftec.ju.db.DbWork

    Assert.assertNotNull(this.connUtil.getDbType());
  }
 
  @Test
  public void canCreateTable_usingJdbcTemplate() {
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        JdbcTemplate jt = JuConnUtils.asJdbcTemplate(conn);
       
        // Drop table in case the test wasn't succesful last time
        try {
          jt.execute("drop table juConnUtilTestTable");
        } catch (Exception ex) {
          // Expected...
        }
       
        // Create new test table
        jt.execute("CREATE TABLE juConnUtilTestTable (id NUMERIC(19))");
        jt.execute("insert into juConnUtilTestTable (id) values (1)");
       
        // Query the table
        Long id = jt.queryForLong("select id from juConnUtilTestTable where id=1");
        Assert.assertEquals(new Long(1), id);
       
        // Create a new connUtil to make sure we'll see the changes there...
        JuConnUtil connUtil2 = JuConnUtils.build()
          .profile(JuUtils.getJuPropertyChain().get("ju-dbutil-test.profile", true))
          .create();
        connUtil2.doWork(new DbWork() {
          @Override
          public void execute(Connection conn) {
            Long id2 = JuConnUtils.asJdbcTemplate(conn).queryForLong("select id from juConnUtilTestTable where id=1");
            Assert.assertEquals(new Long(1), id2);
           
View Full Code Here

Examples of ch.inftec.ju.db.DbWork

    this.configProperties.put(name, value);
    return this;
  }
 
  private void execute(final DbUnitWork work) {
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        doExecute(conn, work);
      }
    });
View Full Code Here

Examples of ch.inftec.ju.db.DbWork

    // Make sure we have a transaction when accessing entity manager meta data
    final DbType dbType = this.connUtil.getDbType();
    final String metaDataUserName = this.connUtil.getMetaDataInfo().getUserName();
//    this.tx.commit(); // We must not be within a managed transaction when performing Liquibase work...
   
    this.connUtil.doWork(new DbWork() {
      @Override
      public void execute(Connection conn) {
        try {
          JdbcConnection jdbcConn = new JdbcConnection(conn);
         
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.