<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hello<br data-mce-bogus="1"></div><div>are you aware of Jakarta data API ?<br></div><div>  <a href="https://github.com/jakartaee/data">https://github.com/jakartaee/data</a><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Which is quite similar to Spring Data and provide a typesafe API,<br data-mce-bogus="1"></div><div>here is a presentation by Gavin King<br data-mce-bogus="1"></div><div>  https://www.youtube.com/watch?v=X9GplCb5SWY<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>For me the static meta-model does exactly what you want.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>regards,<br data-mce-bogus="1"></div><div>RĂ©mi</div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Peter Eastham" <petereastham@gmail.com><br><b>To: </b>"amber-dev" <amber-dev@openjdk.org><br><b>Sent: </b>Monday, December 9, 2024 2:52:32 AM<br><b>Subject: </b>Improving Method Reference Ergonomics<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr">Hi Amber team,<br><br>Earlier this week I was playing around with fluent API design, and I believe Java could benefit from some improvements to the usage of Method References, I'll keep this short with the following example.<br><br>Lets take the following JPA Criteria from section 6.3.3 of the Specification, (Only for an example of what an API could begin doing, not should do)<br>CriteriaQuery q = cb.createQuery(Customer.class);
<br>Root customer = q.from(Customer.class);<br>Join order = customer.join(Customer_.orders, JoinType.LEFT);<br>q.where(cb.equal(customer.get(Customer_.status), 1)).select(customer);  <br><br>If there was greater access to the Method Reference more implicit information could be passed, reducing the noise,<br>CriteriaQuery q = CriteriaQuery.createQuery(Customer::new)<br>  .leftJoin(Customer::orders)<br>  .where(Object::equals, Customer::status, 1);<br>var result = q.select();<br><br>Regarding what should be available, the resolved Class and Method name at least, anything else I'd leave up to the feasibility of the change.<br><br>Thanks,<br>-Peter</div><br></blockquote></div></div></body></html>