Skip to content

Instantly share code, notes, and snippets.

@sohangp
Created October 7, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sohangp/2cd92265094888b641e13911275814e3 to your computer and use it in GitHub Desktop.
Save sohangp/2cd92265094888b641e13911275814e3 to your computer and use it in GitHub Desktop.
Named Parameter
<!-- Search Customer By First Name -->
<named-native-query name="customerEntity.searchCustomerByFirstName">
<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
WHERE
cust.FIRST_NAME = :firstName
]]></query>
</named-native-query>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment