| Hey there, i have a strange naming issue with Spring Data JPA native queries. Basically i´m issueing this query:
@Query(value = "select i.invoice_id as \"invoiceId\", i.booking_tag as \"bookingTag\", i.invoice_number as \"invoiceNumber\", i.created_by as \"createdBy\", i.invoice_api_groups as \"apiGroups\", i.invoice_date as \"invoiceDate\", r.recipient as \"recipient\" from invoice i inner join recipient r on (i.recipient_recipient_id = r.recipient_id) where i.invoice_state = ?2 and i.invoice_api_groups similar to ?1 order by i.invoice_date desc", nativeQuery = true)
I have a Spring Data JPA Projection Interface which should take the results. But the naming gets confused. These means the Property:
/**
* The invoice id.
*
* @return long
*/
long getInvoiceId();
gets not filled, because Hibernate (a suggestion) does the naming wrong, which means invoiceId will be named invoiceid (mind the second lower case naming). So Spring cannot map the right Interface properties. I have filed a Spring Data JPA Issue here: https://jira.spring.io/browse/DATAJPA-1225 Please see all details with screenshots and comments on the above link. Please let me know if you need further information. Thank you! |