Package jodd.db.oom.sqlgen

Examples of jodd.db.oom.sqlgen.DbSqlBuilder.generateQuery()


      assertEquals("where (1=1) BOY", dbc.generateQuery());
      dbc = sql()._("where")._().match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      dbc = sql()._("where")._().match("BadBoy", bb).table(bb, null);
      assertEquals("where (1=1) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb).table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = Integer.valueOf(3);
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
View Full Code Here


      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      dbc = sql()._("where")._().match("BadBoy", bb).table(bb, null);
      assertEquals("where (1=1) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb).table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = Integer.valueOf(3);
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.ID=:badBoy.ajdi) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
View Full Code Here

      dbc = sql()._("where ").match("b", bb).table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = Integer.valueOf(3);
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.ID=:badBoy.ajdi) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (b.ID=:badBoy.ajdi) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "";
View Full Code Here

      bb.ajdi = Integer.valueOf(3);
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.ID=:badBoy.ajdi) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (b.ID=:badBoy.ajdi) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (1=1) BOY", dbc.generateQuery());
View Full Code Here

      assertEquals("where (b.ID=:badBoy.ajdi) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (1=1) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "foo";
View Full Code Here

      bb.ajdi = null;
      bb.nejm = "";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (1=1) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "foo";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.NAME=:badBoy.nejm) BOY", dbc.generateQuery());
View Full Code Here

      assertEquals("where (1=1) BOY b", dbc.generateQuery());

      bb.ajdi = null;
      bb.nejm = "foo";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.NAME=:badBoy.nejm) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (b.NAME=:badBoy.nejm) BOY b", dbc.generateQuery());
    }
  }
View Full Code Here

      bb.ajdi = null;
      bb.nejm = "foo";
      dbc = sql()._("where ").match("BadBoy", bb)._(" ").table(bb, null);
      assertEquals("where (BOY.NAME=:badBoy.nejm) BOY", dbc.generateQuery());
      dbc = sql()._("where ").match("b", bb)._(" ").table(bb, "b");
      assertEquals("where (b.NAME=:badBoy.nejm) BOY b", dbc.generateQuery());
    }
  }

  @Test
  public void testCriteria() {
View Full Code Here

    DbSqlBuilder dbc = sql()._("select").
        columnsAll("bb").columnsIds("bg")._(" from").
        table(bb, "bb").table(bg, "bg")._().
        match("bb", bb)._().match("bg", bg);

    assertEquals("select bb.ID, bb.GIRL_ID, bb.NAME, bg.ID from BOY bb, GIRL bg (1=1) (1=1)", dbc.generateQuery());

    dbc = sql()._("select").
        columnsAll("bb").columnsIds("bg")._(" from").
        table(bb, "bb").table(bg, "bg")._(" where ").
        match("bb", bb)._().match("bg", bg)._(" or ").refId("bb")._("=").value(Long.valueOf(5L));
View Full Code Here

        columnsAll("bb").columnsIds("bg")._(" from").
        table(bb, "bb").table(bg, "bg")._(" where ").
        match("bb", bb)._().match("bg", bg)._(" or ").refId("bb")._("=").value(Long.valueOf(5L));


    assertEquals("select bb.ID, bb.GIRL_ID, bb.NAME, bg.ID from BOY bb, GIRL bg where (1=1) (1=1) or bb.ID=:p0", dbc.generateQuery());

    dbc.reset();
    bb.ajdi = bg.fooid = Integer.valueOf(1);
    assertEquals("select bb.ID, bb.GIRL_ID, bb.NAME, bg.ID from BOY bb, GIRL bg where (bb.ID=:badBoy.ajdi) (bg.ID=:badGirl.fooid) or bb.ID=:p0", dbc.generateQuery());
  }
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.