Examples of SqlRow


Examples of com.avaje.ebean.SqlRow

    Assert.assertTrue(qlList.size() == 1);

    SqlQuery q = Ebean.createSqlQuery("select * from e_basicenc where id = :id");
    q.setParameter("id", e.getId());

    SqlRow row = q.findUnique();
    String name = row.getString("name");
    Object desc = row.get("description");
    System.out.println("SqlRow: " + name + " " + desc);

    EBasicEncrypt e1 = Ebean.find(EBasicEncrypt.class, e.getId());

    String desc1 = e1.getDescription();
View Full Code Here

Examples of com.avaje.ebean.SqlRow

    Ebean.save(e);

    SqlQuery q = Ebean.createSqlQuery("select * from e_basicenc_bin where id = :id");
    q.setParameter("id", e.getId());

    SqlRow row = q.findUnique();
    String name = row.getString("name");
    Object data = row.get("data");
    Object someTimeData = row.get("some_time");
    System.out.println("SqlRow name:" + name + " data:" + data + " someTime:" + someTimeData);

    EBasicEncryptBinary e1 = Ebean.find(EBasicEncryptBinary.class, e.getId());

    Timestamp t1 = e1.getSomeTime();
View Full Code Here

Examples of com.avaje.ebean.SqlRow

    Ebean.save(b);

    SqlQuery q = Ebean.createSqlQuery("select * from e_basic_enum_id where status = :status");
    q.setParameter("status", b.getStatus());

    SqlRow sqlRow = q.findUnique();
    String strStatus = sqlRow.getString("status");

    Assert.assertEquals("N", strStatus);

    try {
      b = Ebean.find(EBasicEnumId.class, b.getStatus());
View Full Code Here

Examples of com.avaje.ebean.SqlRow

    Ebean.save(e);

    SqlQuery q = Ebean.createSqlQuery("select * from tuuid_entity where id = :id");
    q.setParameter("id", e.getId());
    SqlRow sqlRow = q.findUnique();

    UUID id = sqlRow.getUUID("id");

    Assert.assertNotNull(id);

    Boolean b = sqlRow.getBoolean("name");
    Assert.assertFalse(b);
  }
View Full Code Here

Examples of com.avaje.ebean.SqlRow

    Ebean.save(b);

    SqlQuery q = Ebean.createSqlQuery("select * from e_basic where id = :id");
    q.setParameter("id", b.getId());

    SqlRow sqlRow = q.findUnique();
    String strStatus = sqlRow.getString("status");

    Assert.assertEquals("N", strStatus);

    EBasic b2 = new EBasic();
    b2.setName("Apple");
View Full Code Here

Examples of com.avaje.ebean.SqlRow

      BeanCollectionWrapper wrapper = new BeanCollectionWrapper(request);
      boolean isMap = wrapper.isMap();
      String mapKey = query.getMapKey();
     
      SqlRow bean = null;
     
      while (rset.next()) {
        synchronized (query) {         
          // synchronise for query.cancel() support   
          if (!query.isCancelled()){
            bean = readRow(request, rset, propNames, estimateCapacity);
          }
        }
        if (bean != null){
          // bean can be null if query cancelled
          if (listener != null) {
            listener.process(bean);
 
          } else {
            if (isMap) {
              Object keyValue = bean.get(mapKey);
              wrapper.addToMap(bean, keyValue);
            } else {
              wrapper.addToCollection(bean);
            }
          }
View Full Code Here

Examples of com.avaje.ebean.SqlRow

    // by default a map will rehash on the 12th entry
    // it will be pretty common to have 12 or more entries so
    // to reduce rehashing I am trying to estimate a good
    // initial capacity for the MapBean to use.
    SqlRow bean = new DefaultSqlRow(initialCapacity, 0.75f, dbTrueValue);
   
    int index = 0;

    for (int i = 0; i < propNames.length; i++) {
      index++;
      Object value = rset.getObject(index);
      bean.set(propNames[i], value);
    }

    return bean;

  }
View Full Code Here

Examples of com.mycila.testing.plugin.db.api.SqlRow

            final int fetch = resultSet.getFetchSize();
            final List<SqlRow> rows = new ArrayList<SqlRow>(fetch);
            this.sqlDatas = new ArrayList<SqlData[]>(fetch);
            int rowIndex = 0;
            for (; resultSet.next(); rowIndex++) {
                final SqlRow sqlRow = new SqlRowImpl(this, rowIndex);
                final SqlData[] row = new SqlData[columnCount];
                rows.add(sqlRow);
                sqlDatas.add(row);
                for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) {
                    row[columnIndex] = new SqlDataImpl(this, sqlRow, columns.get(columnIndex), resultSet);
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwriter.info.SqlRow

            SqlDescription desc = obj.getDescription();

            conn.setAutoCommit(false);
            try {
               for (int i=0; i < rows.size(); i++) {
                  SqlRow row = (SqlRow)rows.get(i);
                  ClientProperty oldRowProp = new ClientProperty(ReplicationConstants.OLD_CONTENT_ATTR, null, null, row.toXml("", false));
                  row.setAttribute(oldRowProp);
                  try {
                     I_Parser parser = new SqlInfoParser();
                     parser.init(this.info);
                     int ret = desc.update(conn, row, parser);
                     if (ret != 1)
                        throw new Exception("the number of updated entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when updating '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
                  try {
                     int ret = desc.delete(conn, row);
                     if (ret != 1)
                        throw new Exception("the number of deleted entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when deleting '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
                  try {
                     int ret = desc.insert(conn, row);
                     if (ret != 1)
                        throw new Exception("the number of inserted entries is wrong '" + ret + "' but should be 1");
                  }
                  catch(Exception ex) {
                     log.info("exception when inserting '" + row.toXml("") + " where description is '" + desc.toXml("") + "'");
                     throw ex;
                  }
               }
               Thread.sleep(this.sleepDelay);
               conn.commit();
View Full Code Here

Examples of org.xmlBlaster.contrib.dbwriter.info.SqlRow

            String tmp = attrs.getValue(SqlRow.NUM_ATTR);
            if (tmp != null) {
               number = Integer.parseInt(tmp.trim());
            }
         }
         this.recordRow = new SqlRow(this.info, number);
         this.updateRecord.getRows().add(this.recordRow);
              
         return;
      }
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.