Package com.avaje.ebean

Examples of com.avaje.ebean.SqlQuery.findUnique()


    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());
View Full Code Here


    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);

View Full Code Here

    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);

View Full Code Here

    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();
View Full Code Here

    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 {
View Full Code Here

                    .createSqlQuery(sqlString);
            sqlCountQuery = Ebean
                    .createSqlQuery("SELECT COUNT(*) AS cnt FROM (" + sqlString + ")");
        }

        int cnt = sqlCountQuery.findUnique().getInteger("cnt");

        if (limit > MAX_FETCH_LABELS) {
            limit = MAX_FETCH_LABELS;
        }

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.