Package com.nurkiewicz.jdbcrepository

Examples of com.nurkiewicz.jdbcrepository.TableDescription


            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


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

  public BoardingPassRepository() {
    this("BOARDING_PASS");
  }

  public BoardingPassRepository(String tableName) {
    super(MAPPER, UNMAPPER, new TableDescription(tableName, null, "flight_no", "seq_no")
    );
  }
View Full Code Here

  private final SqlGenerator sqlGenerator = new SqlGenerator();

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

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

    //then
View Full Code Here

  }

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

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

    //then
View Full Code Here

  }

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

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

    //then
View Full Code Here

  }

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

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

    //then
View Full Code Here

  }

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

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

    //then
View Full Code Here

  }

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

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

    //then
View Full Code Here

  }

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

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

    //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.