Skip to content

FluentQuery is a sql query builder by using java 8 functional interfaces and spring's JdbcTemplate.

License

Notifications You must be signed in to change notification settings

firatgursoy/fluentquery

Repository files navigation

fluentquery

FluentQuery is a flexible SQL query builder which utilizes JAVA 8 Functional Interfaces and Spring's JdbcTemplate.

Main use-case is complex conditional query building situations. Benefits are high code readability, easy validation and easy to integrate SQL to java code.

<dependency>
  <groupId>io.github.firatgursoy</groupId>
  <artifactId>fluentquery</artifactId>
  <version>0.0.4</version>
</dependency>
@Configuration
public SpringConfiguration {

  @Bean
  FluentQueryFactory queryFactory(NamedParameterJdbcTemplate jdbcTemplate){
    return new JdbcTemplateFluentQueryFactoryImpl(jdbcTemplate);
  }
  
}

@Repository
public SampleUsageRepository {

  @Autowired
  FluentQueryFactory queryFactory;
  
  public List<SampleDto> getSampleDtos(){
    return queryFactory.newQuery()
    .append("select * from sample_dto")
    .list(SampleDto.class);
  }
  
}

About

FluentQuery is a sql query builder by using java 8 functional interfaces and spring's JdbcTemplate.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages