Package com.nurkiewicz.jdbcrepository

Examples of com.nurkiewicz.jdbcrepository.TableDescription


  }

  @Test
  public void buildSqlForSelectByIdsWhenMultipleIdColumnsAndSeveralIds() throws Exception {
    //given
    final TableDescription table = new TableDescription("table", null, "num1", "num2", "num3");

    //when
    final String sql = sqlGenerator.selectByIds(table, 4);

    //then
View Full Code Here


  }

  @Test
  public void buildSqlForDeleteBySingleIdColumn() throws Exception {
    //given
    final TableDescription table = new TableDescription("table", "num");

    //when
    final String sql = sqlGenerator.deleteById(table);

    //then
View Full Code Here

  }

  @Test
  public void buildSqlForDeleteByMultipleIdColumns() throws Exception {
    //given
    final TableDescription table = new TableDescription("table", null, "num1", "num2");

    //when
    final String sql = sqlGenerator.deleteById(table);

    //then
View Full Code Here

            mapping.put("FAVOURITE_COUNT", comment.getFavouriteCount());
            return mapping;
          }
        },
        new CommentWithUserMssqlGenerator(),
        new TableDescription("COMMENTS", "COMMENTS c JOIN USERS u ON c.USER_NAME = u.USER_NAME", "ID")
    );
  }
View Full Code Here

  @Test
  public void buildSqlForUpdateWithSingleIdColumn() throws Exception {
    //given
    final Object ANY = new Object();
    final TableDescription table = new TableDescription("table", "num");

    //when
    final String sql = sqlGenerator.update(table, ImmutableMap.of("x", ANY, "y", ANY, "z", ANY));

    //then
View Full Code Here

  @Test
  public void buildSqlForUpdateWithMultipleIdColumns() throws Exception {
    //given
    final Object ANY = new Object();
    final TableDescription table = new TableDescription("table", null, "num1", "num2");

    //when
    final String sql = sqlGenerator.update(table, ImmutableMap.of("x", ANY, "y", ANY, "z", ANY));

    //then
View Full Code Here

TOP

Related Classes of com.nurkiewicz.jdbcrepository.TableDescription

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.