Coder Social home page Coder Social logo

querybuilder-mapper's People

Contributors

augustoccesar avatar

querybuilder-mapper's Issues

Add support for JPA

When the project is using JPA, it already has a @Column annotation on models, so, need to create a way to verify following the rules:

  • If model contains QueryBuilder @Column annotation, work as it is now.
  • If model contains JPA @Column, get the data from it and build as the previous.
  • If model don't contains @Column, get the fields and consider it column name as the attribute name in snake case.

Map existing instance

As it is now, you can only create a new instance when mapping the result of a query

User user = new Mapper<User>("u").map(rs, User.class);

need to create a way to map to an existing instance

User user = new User();
new Mapper<User>("u").map(rs, user);

Simpler Connection/PreparedStatement/ResultSet

Create a way to reduce the boilerplate code produced every time that is going to run a query

try (PreparedStatement stmt = this.connection.prepareStatement(sql)) {
    try (ResultSet rs = stmt.executeQuery()) {
        while (rs.next()) {
            // Do stuff with each result
        }
    }
}

Looking for a way to do it simpler, like

SomeClass.executeQuery(sql, connection, (rs) -> {
    // Do stuff with each result
});

If query contains ? than, be able to pass the parameters

SomeClass.executeQuery(sql, connection, param1, param2, param3, (rs) -> {
    // Do stuff with each result
});
// or
ArrayList<Object> params = new ArrayList<>();
SomeClass.executeQuery(connection, params, (rs) -> {
    // Do stuff with each result
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.