source: src/main/java/com/example/fooddeliverysystem/repository/storedprocedure/OrderCostCalcualte.java

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 
1package com.example.fooddeliverysystem.repository.storedprocedure;
2
3import jakarta.persistence.*;
4import org.springframework.data.jpa.repository.query.Procedure;
5import org.springframework.stereotype.Component;
6
7import java.util.ArrayList;
8
9@Component
10public 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.