Skip to content
Advertisement

Tag: mysql

Duplicates in Output Java Spring Boot JPA

I’m working on an application with following Entities and code: The RestController for MotionPicture: My DB Table: clip columns: id(1-100 unique), date, size Table: motion_picture columns: id(1-100 unique), date, size, duration association table: motion_picture_clips columns: motion_picture_id (1-100 random), clips_id (1-100 unique) When I run the programm and make a the getRequest in Postman (getById and getAll) –> I’ll get duplicated

Why my trigger is not working with Hibernate?

I have a Java spring boot project and I use Hibernate in this project. I have a void deleteAll(List<Long> idList) method and its query is @Query(value = “DELETE c FROM Course c WHERE c.id in :idList”, nativeQuery = true). I want to use a trigger after every delete operation. I created a trigger in mysql and it works when I

The dreaded Java SpringBoot app not connecting to MySQL with Docker-compose java.net.ConnectException: Connection refused

I have been struggling with the following issue – the dreaded Java SpringBoot app not connecting to MySQL with docker compose exceptions: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure JDBCConnectionException: Unable to open JDBC Connection for DDL execution java.net.ConnectException: Connection refused The app works fine on its own, but it can’t seem to connect to mysql once I get it in Docker. I

Spring Data JPA Distinct Returning Duplicate Values

In my Spring boot application I have a query which should return a distinct List of Focus’ (works perfectly in MySQL) However this does not return distinct values, duplicates are contained in the resulting list. Another issue is that I can’t return a whole entity using @Query annotation – changing my query to SELECT DISTINCT(F) FROM Focus F gives the

Advertisement