Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@debop
Copy link
Contributor

@debop debop commented Dec 11, 2018

Support named parameters like this

Map<String, Object> resultIdMap = new HashMap<>();
resultIdMap.put("ids", resultIds);
data.raw(Person.class, "select * from Person WHERE id IN :ids", resultIdMap)

and support duplicated parameters

try (Result<Tuple> result = data.raw("select * from Person WHERE id = :id and name = :name and id = :id", parameters)) {
            assertEquals(result.first().<Number>get("id").intValue(), people.get(0).getId());
        }

@npurushe
Copy link
Contributor

Will look this over thanks!

}
}

private class EntityResult extends BaseResult<E> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks identical to RawEntityQuery.EntityResult this class should probably extend RawEntityQuery to avoid duplication

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I change RawEntityQuery overridable? If then, I will

* @author debop (Sunghyouk Bae)
* @since 18. 12. 8
*/
public class RawTupleNamedQuery extends PreparedQueryOperation implements Supplier<Result<Tuple>> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly this duplicates much RawTupleQuery so probably should extend it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I change RawTupleQuery to overridable, I will extend it

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