Skip to content

Tag: jpa

use desc as a field name in Spring boot entity class

The table was not being created for the following model despite following the correct procedure Model Answer So I was creating an entity class for JPA where there was a field name desc. I was using MySQL database. But for some reason, I was getting the following error. The model Later I changed the field name and the whole thing

JPA Subquery fails

Does anyone know why it fails? It does not give syntax problems but it gives me the error “missing expression (ORA-00936)” The problem seems to be in :user IN uc.users Answer I think the last bit is incorrect. This should work: So, the whole query becomes:

Delete cascade Category child (Java Hibernate JPA)

I have this Entity to represent a Category system with a selfrelationship to get child categories: The problem is when I want to delete a category that has child categories. I want to delete all child categories but Java drops me this exception : Cannot delete or update a parent row: a foreign key constraint fails (vanger.producto, CONSTRAINT FKju4fpj8umbyi05750yjm70cx0 FOREIGN

Error starting Tomcat context.Exception: org.springframework.beans.factory.BeanCreationException.Message:Error creating bean with name ‘h2Console’ def

I have this simple CRUD Spring HTTP Service (see ). I would like to achieve something like . I made use of Thymeleaf and 2 html files: add-edit-employee.html and list-employees.html. Initial data comes from an sql table: data.sql & schema.sql. When I run the project I get error: Log of the errors 2 Pom file EmployeeEntity class data.sql schema.sql

How to create LinkedList of JPA entities

I have a scenario where I need to create an entity which has references to list of predecessors and list of successors. when a request is received, I need to create entity like below: Request: My new entity “task2” should now be created as below in DB. While saving task2 with previous as task1 and next as task3, I also