Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SQL annotations like in JDBI [DATAJDBC-116] #350

Closed
spring-projects-issues opened this issue Jul 20, 2017 · 1 comment
Closed

Add SQL annotations like in JDBI [DATAJDBC-116] #350

spring-projects-issues opened this issue Jul 20, 2017 · 1 comment
Assignees
Labels
in: repository type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jul 20, 2017

Alex Rader opened DATAJDBC-116 and commented

In JDBI we can write

public interface UserDao {
    @SqlUpdate("CREATE TABLE user (id INTEGER PRIMARY KEY, name VARCHAR)")
    void createTable();

    @SqlUpdate("INSERT INTO user(id, name) VALUES (?, ?)")
    void insertPositional(int id, String name);

    @SqlUpdate("INSERT INTO user(id, name) VALUES (:id, :name)")
    void insertNamed(@Bind("id") int id, @Bind("name") String name);

    @SqlUpdate("INSERT INTO user(id, name) VALUES (:id, :name)")
    void insertBean(@BindBean User user);

    @SqlQuery("SELECT * FROM user ORDER BY name")
    @RegisterBeanMapper(User.class)
    List<User> listUsers();
}

http://jdbi.github.io/

it will be useful to able to do the same in Spring Data


Issue Links:

  • DATAJDBC-82 annotation based spring-jdbc
    ("duplicates")
@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 26, 2017

Alex Rader commented

Please close as duplicate of https://jira.spring.io/browse/DATAJDBC-82

@spring-projects-issues spring-projects-issues added in: repository type: enhancement labels Dec 31, 2020
mp911de added a commit that referenced this issue Feb 21, 2022
Create database containers using the constructor accepting the image name to make sure that the exposed port gets registered. A recent change in Testcontainers caused that the port is no longer registered when using the default constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: repository type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants