Skip to content

Instantly share code, notes, and snippets.

@sohangp
Last active May 16, 2019 14:40
Show Gist options
  • Save sohangp/c3e1f85414dce1548e0f7737b6923352 to your computer and use it in GitHub Desktop.
Save sohangp/c3e1f85414dce1548e0f7737b6923352 to your computer and use it in GitHub Desktop.
The Native Query
<named-native-query name="customerEntity.getCustomerDetails">
<query><![CDATA[
SELECT
cust.id as customerId,
cust.FIRST_NAME as firstName,
cust.LAST_NAME as lastName,
cust.CITY as city,
cust.COUNTRY as country,
corder.ORDER_NUMBER as orderNumber,
corder.TOTAL_AMOUNT as totalAmount
FROM CUSTOMER cust LEFT JOIN CUSTOMER_ORDER corder
ON corder.CUSTOMER_ID = cust.ID
]]></query>
</named-native-query>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment