Skip to content
Advertisement

Tag: jpa

Make a POST with JPA with existing data

I have the following problem, the thing is that I have an entity: The thing is that this back is connected to an Oracle DB, in which I already have a few registered users, but these are entered through a Mockaroo script, and when I try to save a new user through a service Rest throws me this error: Of

JPA Cast BigDecimal as string

I’m using JPA to query a database, but something strange happens. In some cases the cast works and compiles fine, but with a BigDecimal it doesn’t let me use the cast to make a LIKE with a String. Here is a part of the code that works: pesoObjetivo is a data type Double But when I try to perform the

Upgrade to springboot 2.6.1 with querydsl jpa 5.0.0

I am trying to upgrade my springboot version from 2.3.4 to 2.6.1. I use query dsl with jpa and apt-maven-plugin. My issue is that I can’t no more generate the QClasses when I run maven compile. I noticed that I am no more able to use an older version of querydsl (previous one 4.4.0 and apt-maven-plugin 1.1.3). Now when I

JPA Entity for View containig joins and aliases

I have the following query using which I want to create an entity class for the columns which I am retrieving from the query. How to create an entity class from these columns and what variables are needed to take it in entity class to refer to these columns? Answer View is a virtual table based on the result-set of

JPA Hibernate many to many IllegalStateException

I’m attempting to create a many to many relationship. I have a table ‘library_branch’ and i want to join ‘BookCopies’ which contains ‘bookId’, ‘branchId’ and ‘noOfCopies’. I have an error ErrorMvcAutoConfiguration$StaticView. I’m not sure where I’m causing this infinite recursion, any help will be greatly appreciated. 2021-11-26 14:54:43.544 ERROR 22348 — [nio-8080-exec-1] s.e.ErrorMvcAutoConfiguration$StaticView : Cannot render error page for request

Spring JPA relationships

I have some troubles with Spring JPA relationships. I have two entities: Gift and Candy. And I want user to be able to select available candy and add it to gift. How can I do that using spring jpa? I’ve already tried ‘one to many’ relationship with gift as owning side, and I got “null value in column ‘gift_id violates

Mapping one to one relationships in Spring Boot

I am trying to map a User with a certain Table in a one to one relationship. This here is my code, id appreciate if u take a look at it: User class: The Table class: Answer You don’t mapped parent entity with child entity properly.In parent table object of CTable is currenTable and you mapped by with table. Change:

Advertisement