Skip to content

DATAJDBC-181 - Use NamingStrategy for instantiating entities. #47

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

Closed
wants to merge 3 commits into from

Conversation

schauder
Copy link
Contributor

@schauder schauder commented Mar 7, 2018

The ResultSetParameterValueProvider uses the relevant property for a requested parameter in order to obtain the proper column name to use.

Improved mocking of ResultSets in tests to actually fail when a non-existing column gets requested instead of just returning null.

schauder added 3 commits March 7, 2018 12:14
The ResultSetParameterValueProvider uses the relevant property for a requested parameter in order to obtain the proper column name to use.

Improved mocking of ResultSets in tests to actually fail when a non existing column gets requested instead of just returning null.
Removed superfluous @requiredargsconstructor annotations.
@gregturn
Copy link
Contributor

gregturn commented Mar 9, 2018

Resolved via 18bf6ca and b49b767

@gregturn gregturn closed this Mar 9, 2018
@gregturn gregturn deleted the issue/DATAJDBC-181 branch March 9, 2018 15:20
mp911de added a commit that referenced this pull request Feb 21, 2022
DatabaseClient now supports named parameters prefixed with a colon such as :name in addition to database-native bind markers. Named parameters thus are supported in annotated repository query methods which also increases portability of queries across database vendors.

Named parameter support unrolls collection arguments to reduce the need for argument-specific SQL statements:

db.execute()
    .sql("SELECT id, name, state FROM table WHERE age IN (:ages)")
    .bind("ages", Arrays.asList(35, 50));

Results in a query: SELECT id, name, state FROM table WHERE age IN (35, 50)

Collection arguments containing nested object arrays can be used to use select lists:

List<Object[]> tuples = new ArrayList<>();
tuples.add(new Object[] {"John", 35});
tuples.add(new Object[] {"Ann",  50});

db.execute()
    .sql("SELECT id, name, state FROM table WHERE (name, age) IN (:tuples)")
    .bind("tuples", tuples);

translates to: SELECT id, name, state FROM table WHERE (name, age) IN (('John', 35), ('Ann', 50))

Original pull request: #47.
mp911de pushed a commit that referenced this pull request Feb 21, 2022
Formatting.
Made Tests simpler and stricter by using `containsExactly`.
Added @test annotation to ignored database specific tests so they actually show up as ignored.

Original pull request: #47.
mp911de added a commit that referenced this pull request Feb 21, 2022
Original pull request: #47.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants