From 211aa26df14fb066a3bc50d7800c4915dd70fbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 11 Nov 2024 16:11:47 +0100 Subject: [PATCH] RLH-19 - Use UserDto in init query --- src/main/java/wtf/beatrice/releasehive/HiveMain.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/wtf/beatrice/releasehive/HiveMain.java b/src/main/java/wtf/beatrice/releasehive/HiveMain.java index fcbab03..a474e4c 100644 --- a/src/main/java/wtf/beatrice/releasehive/HiveMain.java +++ b/src/main/java/wtf/beatrice/releasehive/HiveMain.java @@ -7,6 +7,7 @@ import org.hibernate.Transaction; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import wtf.beatrice.releasehive.db.HibernateManager; +import wtf.beatrice.releasehive.dtos.UserDto; import wtf.beatrice.releasehive.models.User; import java.util.List; @@ -30,7 +31,7 @@ public class HiveMain { Session session = HibernateManager.getSession(); Transaction transaction = session.beginTransaction(); - List users = session.createQuery("FROM User", User.class).getResultList(); + List users = session.createQuery("FROM User", UserDto.class).getResultList(); transaction.commit(); StringBuilder usersListBuilder = new StringBuilder("[");