<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>