Examples of SqlQuery


Examples of ch.epfl.labos.iu.orm.query2.SQLQuery

                  SelectFromWhereExtensionJoin.fromSfw(sfw, (EntityManagerBackdoor)emSource),
                  this);
         try {
            if (analysis.paths.size() > 1) return null;
            PathAnalysis path = analysis.paths.get(0);
            SQLQuery subquery = gen.generateFor(path.getSimplifiedReturnValue());
            if (subquery instanceof SQLQuery.SelectFromWhere)
            {
               final SQLQuery.SelectFromWhere<T> subsfw = (SQLQuery.SelectFromWhere<T>)subquery;
               // TODO: Is this sufficient for finding out if a subquery can
               // be safely put into a FROM clause (i.e. the part put into the
View Full Code Here

Examples of co.cubicode.jdbcframework.SQLQuery

    return findByPrimaryKey(application.toString(), objectType.toString(), operationType.toString());
  }

  public static Permission findByPrimaryKey(String application, String objectType, String operationType) throws ObjectNotFoundException {
    DatabaseFactory instance = DatabaseFactory.getInstance("rbac");
    SQLQuery sql = SQL.getSQL(Permission.class, "findByPrimaryKey");
    sql.setParameter("application", application);
    sql.setParameter("objectType", objectType);
    sql.setParameter("operationType", operationType);
    return instance.query(Permission.class, sql);
  }
View Full Code Here

Examples of com.avaje.ebean.SqlQuery

        .createQuery(EBasicEncrypt.class, "find e (id, description) where description = :d")
        .setParameter("d", "testdesc").findList();

    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

Examples of com.avaje.ebean.SqlQuery

    e.setSomeTime(t0);
    e.setData("HelloWorld".getBytes());

    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

Examples of com.avaje.ebean.SqlQuery

    TUuidEntity e = new TUuidEntity();
    e.setName("blah");

    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

Examples of com.avaje.ebean.SqlQuery

    b.setName("Banana");
    b.setStatus(Status.NEW);

    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

Examples of com.avaje.ebean.SqlQuery

    b.setName("Banana");
    b.setStatus(EBasicEnumId.Status.NEW);

    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

Examples of com.j_spaces.core.client.SQLQuery

       
        UrlSpaceConfigurer usc = new UrlSpaceConfigurer(_spaceUrl);
        LocalCacheSpaceConfigurer lcsc = new LocalCacheSpaceConfigurer(usc.space());
        GigaSpaceConfigurer gigaSpaceConfigurer = new GigaSpaceConfigurer(usc.space());
        _space = gigaSpaceConfigurer.gigaSpace();    
        _query = new SQLQuery(SessionData.class, "expiryTime < ?");
    }
View Full Code Here

Examples of com.jengine.orm.db.query.SQLQuery

    public long count() throws DBException {
        return this.target(new Count()).<Long>one();
    }

    public <T extends Object> List<T> list() throws DBException {
        SQLQuery sqlQuery = toSQL();
        List result = manager.getModelClass().getProvider().select(sqlQuery);
        return processResult(result);
    }
View Full Code Here

Examples of com.liferay.portal.kernel.dao.orm.SQLQuery

    try {
      session = openSession();

      String sql = CustomSQLUtil.get(COUNT_BY_G1_G2_U1_U2);

      SQLQuery q = session.createSQLQuery(sql);

      q.addScalar(COUNT_COLUMN_NAME, Type.LONG);

      QueryPos qPos = QueryPos.getInstance(q);

      qPos.add(groupId1);
      qPos.add(groupId2);
      qPos.add(userId1);
      qPos.add(userId2);

      Iterator<Long> itr = q.list().iterator();

      if (itr.hasNext()) {
        Long count = itr.next();

        if (count != null) {
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.