Package jodd.db.oom.tst

Examples of jodd.db.oom.tst.BadGirl


  }

  @Test
  public void testCriteria() {
    BadBoy bb = new BadBoy();
    BadGirl bg = new BadGirl();

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


    DbSqlBuilder b = DbEntitySql.update(g);
    assertEquals("update GIRL Girl_ set ID=:girl.id, NAME=:girl.name, SPECIALITY=:girl.speciality  where (1=1)",
        b.generateQuery());
    checkGirl(b);

    BadGirl bg = new BadGirl(Integer.valueOf(2), null, ".net");
    b = DbEntitySql.update(bg);
    assertEquals(
        "update GIRL BadGirl_ set ID=:badGirl.fooid, SPECIALITY=:badGirl.foospeciality  where (BadGirl_.ID=:badGirl.fooid)",
        b.generateQuery());
    checkBadGirl1(b);
View Full Code Here

    checkBadGirl2(b);
  }

  @Test
  public void testUpdateColumn() {
    BadGirl bg = new BadGirl(Integer.valueOf(1), "sanja", "c++");
    DbSqlBuilder b = DbEntitySql.updateColumn(bg, "fooname", "Anja");
    assertEquals(
        "update GIRL BadGirl_ set NAME=:p0 where (BadGirl_.ID=:badGirl.fooid)",
        b.generateQuery());
    Map<String, ParameterValue> params = b.getQueryParameters();
View Full Code Here

    DbSqlBuilder b = DbEntitySql.delete(g);
    assertEquals("delete from GIRL where (GIRL.ID=:girl.id and GIRL.NAME=:girl.name and GIRL.SPECIALITY=:girl.speciality)",
        b.generateQuery());
    checkGirl(b);

    BadGirl bg = new BadGirl(Integer.valueOf(2), null, ".net");
    b = DbEntitySql.delete(bg);
    assertEquals(
        "delete from GIRL where (GIRL.ID=:badGirl.fooid and GIRL.SPECIALITY=:badGirl.foospeciality)",
        b.generateQuery());
    checkBadGirl1(b);
View Full Code Here

    b = DbEntitySql.findByAll(g);
    assertEquals("select Girl_.ID, Girl_.NAME, Girl_.SPECIALITY from GIRL Girl_ where (Girl_.ID=:girl.id and Girl_.NAME=:girl.name and Girl_.SPECIALITY=:girl.speciality)",
        b.generateQuery());
    checkGirl(b);

    BadGirl bg = new BadGirl(Integer.valueOf(2), null, ".net");
    b = DbEntitySql.find(bg);
    assertEquals("select BadGirl_.ID, BadGirl_.NAME, BadGirl_.SPECIALITY from GIRL BadGirl_ where (BadGirl_.ID=:badGirl.fooid and BadGirl_.SPECIALITY=:badGirl.foospeciality)",
        b.generateQuery());
    checkBadGirl1(b);
View Full Code Here

    DbSqlBuilder b = DbEntitySql.count(g);
    assertEquals("select count(*) from GIRL Girl_ where (Girl_.ID=:girl.id and Girl_.NAME=:girl.name and Girl_.SPECIALITY=:girl.speciality)",
        b.generateQuery());
    checkGirl(b);

    BadGirl bg = new BadGirl();
    b = DbEntitySql.count(bg);
    assertEquals("select count(*) from GIRL BadGirl_ where (1=1)",
        b.generateQuery());

    bg = new BadGirl(Integer.valueOf(2), null, ".net");
    b = DbEntitySql.count(bg);
    assertEquals("select count(*) from GIRL BadGirl_ where (BadGirl_.ID=:badGirl.fooid and BadGirl_.SPECIALITY=:badGirl.foospeciality)",
        b.generateQuery());
    checkBadGirl1(b);

View Full Code Here

TOP

Related Classes of jodd.db.oom.tst.BadGirl

Copyright © 2018 www.massapicom. 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.