agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

Builders: auto-detect multi-column IDs #660

Closed andrus closed 9 months ago

andrus commented 9 months ago

Currently all request builders are using an overloaded method byId(Object) / byId(Map) to process either a single column ID or a multi-column ID, creating a different ID variant depending on the parameter type. So it is rather easy to make a mistake and pass a Map as an object, resulting in a broken expressions used to retrieve the object. Let's remove the overloaded method with the Map argument, and instead detect the ID semantics dynamically based in the entity model.