Most voted "spring-jpa" questions
Spring JPA is an integral part of the Spring Framework used for JPA management (Java Persistence API).
Learn more…91 questions
Sort by count of
-
0
votes1
answer145
viewsUppercase in Criteriabuilder
I have the following consultation with Criteriabuilder CriteriaBuilder cb = manager.getCriteriaBuilder(); CriteriaQuery<Escola> cq = cb.createQuery(Escola.class); Root<Escola> root =…
-
0
votes1
answer51
viewsSpring with Database (Sqlserver) already created
I’m developing an application Rest API using Spring Boot. Doubt: If I already have a Database in production with populated tables it is necessary to create the Entity class with the annotation…
-
0
votes0
answers11
viewsCause of Nullpointer in DAO
Good morning, good morning. I’m making the following mistake GRAVE: Servlet.service() for servlet [dispatcher] in context with path [/PortalSega] threw exception [Request processing failed; nested…
-
0
votes0
answers16
viewsError with the orphanRemoval
I’m trying to use orphanRemoval for the TCC project and I’m having trouble, I think it’s dependency. @ManyToMany(cascade = CascadeType.ALL, orphanRemoval = true) private List<ReadingTarget>…
-
0
votes1
answer192
viewsCreation and editing in the Spring Framework
I recently started to learn Spring, along with the Thymeleaf template engine for data display. However, I have been facing some problems that I cannot solve: When editing the Star Wars Movie entity,…
-
0
votes1
answer737
viewsSpring Data JPA - Query via Specification - Manytomany and Join with Multiple Entities
Hello, I’ve assembled the following Specification class: public class ItemVendedorSpecification implements Specification<ItemVendedor> { private static final long serialVersionUID = 1L;…
-
0
votes2
answers1287
viewsSpringdata paging with Pageimpl<> size does not work
I created a method within a service class to generate a paged list of products using Springdata (Java Spring Rest application), follow the code: public Page<ProdutoDTOVendedor>…
-
0
votes0
answers175
viewsError when creating tables with relation and JPA
Good morning, I’m trying to create two tables with flyway+Spring+Sqlserver+JPA, very simple thing just to pass the time and I’m having an error that I can’t understand because running the same…
-
0
votes2
answers101
viewsScheduling problem for sending notices by e-mail Spring and Javamailsender
Good morning, I am using spring with Scheduled, before I used Quartz but as I uploaded the version of spring I decided to abandon Quartz since the first option was enough to meet my need. In short,…
-
0
votes1
answer446
viewsHow to search for the lowest price in an entity with Spring Data JPA in a Jparepository? (Keywords or JPQL)
I have the following java entity using spring: public class ItemVendedor implements Serializable{ private static final long serialVersionUID = 1L; private ItemVendedorPK id = new ItemVendedorPK();…
-
0
votes1
answer259
viewsRestriction error in relationship Onetomany Hibernate
I’m getting error in the Onetomany relationship when I try to persist an entity. Error: org.postgresql.util.PSQLException: ERROR: null value in column "book_url_id" violates not-null constraint…
-
0
votes0
answers26
viewsData migration postgresql reformulate table
The title may imply that I am recreating a table with similar attributes, but the term is as follows:: I have a database currently running in my application for study purposes, there is a class…
-
0
votes1
answer75
viewsHow to persist objects in a table if I don’t already have the foreign key?
I have a class of Equipment that has a Scheduling list. They are mapped like this: @Entity @Table(schema = "pesquisa", name = "sre_equipamento") public class Equipamento implements Serializable {…
-
0
votes1
answer177
viewsPost only the Manytomany relationship
I have the school entities and teacher. I mapped the Manytomany relationship. I have no idea how to save only the list by passing an array of ids. Teacher class @Id Long id; // não importa os demais…
-
0
votes1
answer428
viewsSign up for Spring Boot
Good afternoon, you guys. I’m having difficulties to implement my Register on Spring Boot. I’m willing to do the method in three ways(if,else if,else) that if it is all right to register, that if…
-
0
votes1
answer54
viewsProvided id of the Wrong type for class - [JPA] Embeddableid formed by another Embeddable
On the bench I have two tables called Table and Tabub. To Table is composed of a primary key, which is composed of 3 attributes. To Tabub is composed of a primary key, which is composed of 3…
-
0
votes1
answer32
viewsPrevent the delete of a parent object if it has JPA child objects
Is there any way defined by JPA that prevents the exclusion of a parent object if it has a child object attached to it? For example: I have the class (Entity) Department, in which I have the…
-
0
votes1
answer1140
viewsSpring data JPA error (Parameter 0 of constructor and entityManagerFactory)
Guys, for hours I’ve been trying to solve a problem in my Spring Data JPA I execute the code and I get this error Description: Parameter 0 of constructor in…
-
0
votes0
answers182
viewsTransactional Spring is not rollback when some Excpetion is released
I am using springboot 2.2.4 and mysql, as an example I have two classes: Client and Dependent: import javax.persistence.*; @Entity public class Cliente { @Id @GeneratedValue(strategy =…
-
0
votes1
answer368
viewsSpring Boot + JPA + Websecurity - How to save User + Profile?
Hello, it’s been a few days that I’m breaking my head to be able to register a user and its role. The information should be recorded in different entities and I can’t make that relationship. I can…
-
0
votes1
answer142
viewsSpringboot does not generate the tables in the bank
When I run the project, my tables do not appear in the database. I noticed that when I take my relations out of the attributes that I declared @Onetomany, it creates the tables, but my project needs…
-
0
votes1
answer394
viewsHow to create a custom findBy method for spring?
I can use findById in the controller but wanted to know how to create a findByQualquer to another class property. follows the code: Model: package com.leonardo.pokedex.model; import…
-
0
votes1
answer186
viewsError @Postmapping @Manytoone settando "usuario_id" spring boot
I’m using Spring and Hibernate in one of the applications I’m working on and I have a problem with processing transactions. I need to do a POST using 2 entities, the Lancamentoentity and…
-
0
votes1
answer742
viewsNo Qualifying bean of type found for service
Good evening guys, I’m trying to launch a Spring API and I’m having the following problem running it, I’ve tried renaming the methods as well as the functions First I’ll leave the Debug log here…
-
0
votes1
answer471
viewsFindby with nested object - Spring Data JPA
I’m having a doubt when creating a findBy using jpa with atríbuto of a nested object, the classes are: public class Livro { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;…
-
0
votes0
answers37
viewsI need to Associate two entities in @Manytomany with JPA using Mysql, but it is not saved in the composite table (usuario_item)
I need to make the connection between user and item for a login system I’m stagnant in this error 2 days ago. I searched for forums and tutorials and could not get anything to help me. If possible…
-
0
votes0
answers180
viewsSpringboot, Hibernate does not create tables in the H2 database
Hello I’m trying to use bank H2 with springboot, but tables are not being created in the database automatically. application properties #DataSource spring.datasource.url=jdbc:h2:file:~/fintech…
-
0
votes1
answer63
viewsIntermediate table mapping with JPA attributes
Hello, I’m trying to create a relationship where there is an intermediary table that has fields other than foreign keys. My classes are like this: @Entity public class Pedido { @Id…
-
0
votes0
answers11
viewsHow to add items to a list with Spring JPA Onetomany with Postman
I searched several places and did not find an answer, because it just doesn’t work by putting the annotations @Onetomany and @Manytoone, already put with fetch, with Mapped, didn’t work. 1 - How JPA…
spring-jpaasked 3 years, 6 months ago gise 39 -
0
votes0
answers28
viewsHow to Enter Into Spring Data in a Bi-Erect Relationship
I’m doing a back end study using the api SWAPI, I have already mapped the entities etc. But now I don’t know how to map to insert, for example: Entidade Film @Data @Entity public class Film extends…
-
0
votes1
answer199
viewsError Creating bean with name 'transactionController'
I’m starting to learn Spring and I’m getting this error, I’ve done several searches on the internet but so far I don’t understand what is causing the problem:…
-
-1
votes1
answer61
viewsStarted’s Springboot Project but I can’t get Postman’s Apis
The start project but when I call in Postman nothing comes back, nor the error. It’s as if the project had not gone up! In pom.xml are the dependencies: jpa, mysql and web. I have not touched them.…
-
-1
votes1
answer120
viewsHow do I leave my Hibernate (Spring Boot) dynamic query?
Hello I am trying to let my dynamic query down as follows: @Query("SELECT T.NR_EVENT FROM TB_TIMELINE AS T WHERE T.NR_PENUMPER = :customerCode") public List<TB_TIMELINE>…
-
-1
votes1
answer440
viewsDate less day in Mysql
I’m having a little, boring problem that I can’t seem to solve. I am making a java application using Spring Framework and using Vuejs as front. The database is Mysql. The problem is that when I try…
-
-1
votes1
answer70
viewsHow to remove a Where from @Query in Spring Jparepository
I am using Spring BOOT with Starter JPA and java 8 and I have this query in my Repository : @Query("select p from Product p where p.name like %:name% and p.costValue = :costValue and p.saleValue=…
-
-1
votes1
answer217
viewsPrimary key composed of two foreign keys
Good afternoon to you all! I have a doubt in the structure of an Entity, I am using Hibernate+JPA. The class is a user rating, where one primary key will be the user (coming from the User class),…
-
-1
votes1
answer33
viewsToken Authentication Micro-service Java
I am separating my authentication service into microservices, but when I separate the token into a module, my authentication service always returns 401 and does not log any This is my config class…
-
-2
votes1
answer29
viewsJPA Speciffication - Filter entity list
I have a "Request" entity with a task list (another entity) and need to use speciffication to filter the requested entity and the nested task list. Example: Select * Order where tarrefa.finalizada =…
-
-2
votes1
answer35
viewsHow to generate a json with an object array
Hello, I’m trying to create a REST API, where in the GET method I should return a JSON in this style: {questions:[{ id: 1, question: 'pergunta 1', answers: [{ answerText: 'resposta 1',…
spring spring-boot spring-jpa h2databaseasked 3 years, 8 months ago Luis Gustavo Rodrigues Oliveir 3 -
-2
votes2
answers35
viewsProblems running the DDL on a Rest Api via JPA
When I go to execute I realize this mistake: org.hibernate.tool.schema.spi.Commandacceptanceexception: Error executing DDL "create table tb-product (id int8 not null, name varchar(255), quantity…
-
-3
votes1
answer43
viewsHibernate mapping error
Good afternoon person, could help me in a mapping error? Event class: @Entity @Table(name = "EVENT") public class Event { private static final long serialVersionUID = 1L; @Id…