Last change
on this file was 8d11f8c, checked in by jovanmanchev <jovanmanchev3003@…>, 20 months ago |
code added, trial 2
|
-
Property mode
set to
100644
|
File size:
752 bytes
|
Line | |
---|
1 | package com.example.fooddeliverysystem.repository.storedprocedure;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import org.springframework.data.jpa.repository.query.Procedure;
|
---|
5 | import org.springframework.stereotype.Component;
|
---|
6 |
|
---|
7 | import java.util.ArrayList;
|
---|
8 |
|
---|
9 | @Component
|
---|
10 | public class OrderCostCalcualte {
|
---|
11 |
|
---|
12 | @PersistenceContext
|
---|
13 | private EntityManager em;
|
---|
14 |
|
---|
15 | @Procedure
|
---|
16 | public Integer calculate_cost_of_order_food(Long orderId){
|
---|
17 | StoredProcedureQuery query = em.createNamedStoredProcedureQuery("calculate_cost_of_order_food2");
|
---|
18 | query = query.setParameter("order_id", Integer.valueOf(String.valueOf(orderId)));
|
---|
19 | query.execute();
|
---|
20 | // System.out.println(query.getOutputParameterValue("vkupno_cena_hrana"));
|
---|
21 | return null;
|
---|
22 | }
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.