Most voted "jpa" questions
The Java Persistence API (JPA) defines a path to map Plain Old Java Objects (Pojos) to a database, these Pojos are called entity Beans.
Learn more…652 questions
Sort by count of
-
0
votes0
answers70
viewsInsert/get multiple tables without Id
Good afternoon guys, I’m having a problem affecting me a few days already. The situation is as follows, I have a simple relationship: There are tables person, street, neighborhood, city, state,…
-
0
votes1
answer111
viewsNumber(3.0) field in Oracle database for Java
I have a table in an Oracle 11g database with a field of type NUMBER(3,0) In a Spring project, I own the following: @Repository public interface TipoPropriRepository extends…
-
0
votes1
answer180
viewsQuery with multiple Ids and date with JPA and Spring via Restapi
Good morning, I’m trying to set up a query with Spring JPA and Rest where I can insert several Ids and initial and final date. The query works if I only put an ID with the dates. The code is like…
-
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
votes1
answer4449
viewsHow to fix these and other errors: Failed to Convert from type [java.lang.String] to type [java.lang.Long] for value 'list'?
I’m implementing an example of a book about Spring Boot, but, after executing, while trying to access the route /clientes/list or else, /clientes/view in the browser appear the following errors:…
-
0
votes2
answers692
viewsHibernate, JPA, does not save the new data in the database
I have a Java Spring MVC application, with Hibernate and JPA and HTML interface. I have two forms that depend on the Notebooks class and its attributes. In the first form I enter the data of a new…
-
0
votes1
answer183
viewsHow to resolve: Column "id" not found [42122-197]?
Guys, I’m creating an API that will display random phrases from a table in the database. The problem is that whenever I access the route, on the console, I get this exception:…
-
0
votes1
answer159
viewsJPQL JPA - Create a list grouped by date with the sum and profit of all items sold that day
The SQL query below is returning a wrong result to the fieldEntrega. SELECT DATE(p.dt_pedido) AS barChartLabels, COUNT( DISTINCT p.id) AS qtdPedido, SUM((item.quantidade * item.preco) *…
-
0
votes1
answer88
viewsDoubt about foreign key Ibernate
insert image description here The diary_place table is being created with 2 user_id field, I want it to be only a user_id referenced as foreign key for Diary and place tables. I want the result to…
-
0
votes0
answers363
viewsAPPLICATION FAILED TO START: Persistence error while starting the application
Projeto Completo: https://github.com/codenome/ponto-inteligente-api I am developing an application with Spring Boot, and when starting the application I found an error that I could not solve after…
-
0
votes1
answer176
views -
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
answer815
viewsHQL with case, sum and max
I’m with a query that is giving problem, I believe the problem occurs for not allow to use the function max, within the function sum, am I correct? How can I get around this? Because I need to add…
-
0
votes1
answer63
viewsQuery returns subclasses in Spring
I’m having trouble mapping the classes of a spring project I’m working on. I have the super class called Itempauta and the subclass Homologation. Pai Class @Data @Entity @Table(name="item_pauta")…
-
0
votes1
answer1226
viewsUnique index or Primary key Violation
I am getting the error below when trying to create a new item in a table, in this table I have some previously added items. 2019-03-17 00:05:09 WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error:…
-
0
votes1
answer266
viewsSpring Error with JPQL: Unsatisfieddependencyexception
I’m doing a REST API in Spring Boot and I’m having a hard time bringing the results of a Repository query. I have this MER, which is a small part of my bank: I built these two entities in Java,…
-
0
votes1
answer62
viewsHow to create Queries to generate a JPA SCHEMA
I am trying to create a query to create a schema in sql automatically; as soon as opening the program it executes: createQuery("CREATE NEW SCHEMA IF NOT EXISTS"); My project is like this: -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
answer71
viewsI am unable to list the data in the Mysql database using Hibernate JPA
**Classe: Estado** package entidade; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public…
-
0
votes1
answer50
viewsHow do I add the "same" object to a list and change a property?
I have to send a list of entitys to a method that will make the Insert of these entitys in the bank. This entity represents an inscription of a patient who will enter some waiting queues of…
-
0
votes0
answers805
viewsorg.postgresql.util.Psqlexception: ERROR: Operator does not exist: bigint = bytea
I have a method that retrieves all paths from the appendices of a ledger, so the appendices can be printed. They are listed in a p:datatable within a dialog, but when opening the screen so that I…
-
0
votes1
answer930
viewsJpa Hibernate does not create table in H2
Good night, I am new in Java development - Spring Boot and following a tutorial I can not generate the table in the H2 database, already tried to make some changes in the application.propreties but…
hibernate jpa spring-boot h2database spring-tools-suiteasked 5 years, 5 months ago JULIO CESAR SILVA DE FREITAS 23 -
0
votes3
answers140
viewsJPA+Hibernate: Error removing from an entity
I’m getting this Exception while doing the remove, already broke my head looking for what and Exception in thread "main" java.lang.Runtimeexception: Error Interpreting query [delete from Book Where…
-
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
answer82
viewsHow to prevent Hibernate from creating columns from the fields of an abstract mother class
I have an abstract class Pessoas with methods getters and setters and a concrete class that inherits from Pessoas (members). By mapping the concrete class as Entity and its fields, it is creating…
-
0
votes1
answer194
viewsSend by jsp a command for the controller to update the database method
I want to make a "deposit" into the account with Id "x". The controller sends the "account" to the jsp that returns the deposit value to be updated in the database. That was the logic I used, but I…
-
0
votes1
answer914
viewsHow to rollback the database using Spring Framework
I have this method that saves data in 3 different tables, /** * * @param user - de onde os dados do usuário serão retirados para gravar no banco * @throws GoogleAuthException - se houver algum erro…
-
0
votes2
answers332
viewsUser change does not work, is doubling given in bank
I implemented spring security in my project, I can already register new users and login/logout. Now I’m trying to edit this user’s data, when I click save, it duplicates the data in the database,…
-
0
votes1
answer278
viewsHow to receive a Json in a Clob Java + Spring boot Field
Good morning I have an ethic that one of the fields is a Clob that stores a Json @NotNull @Column(name = "SEQUENCE_PROPOSAL_UID", length = 3) private Long sequenceProposalUid; @NotNull @JsonProperty…
-
0
votes0
answers45
viewsHow to upload Manytoone entity relationship and save to database?
How do I upload (Multipartfile) with Manytoone relationship, in my case I want to upload image in a Call(Entity). Follow the code below: @Entity @DynamicUpdate public class FileInfo { @Id…
-
0
votes0
answers87
viewsReturn all records from another class in JPA Spring
How do I return a complete list of another class within a class? I need Patient.java to return (in the findALL that returns me in JSON) a list of all records in the Statuspaciente.java class,…
-
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
answer130
viewsHow to do a Query ignoring the side spaces of the Column content?
Good morning, everyone! Using the Query: @Repository public interface SessaoRepository extends AbstractRepository<Sessao, Long> { @Query(value = "SELECT p FROM Sessao p WHERE p.dc_secao…
-
0
votes3
answers100
viewsError doing an INSERT in Postgresql database
When making an insertion in the Postgree bank I have as a response a very strange error: 2019-11-22 17:06:30.310 ERROR 15212 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : Nenhum…
-
0
votes1
answer207
viewsInfinite recursion in a bidirectional Manytomany model in Hibernate
I’m trying to create a bi-directional Manytomany relationship in Java, I can already insert into the database smoothly, but when I try to bring data from these tables I fall into an infinite…
-
0
votes0
answers163
viewsQuery JPA using Paging is taking longer as the page number increases, and generating timeout
I’m running a query with JPA on a cloud server of the google app engine, this query should bring me millions of records, and so I’m using Pageable on it, to avoid bank timeout, the problem is that…
-
0
votes1
answer341
viewsInfinite looping in bidirectional relationship - Manytomany
I’m building a Rest API in Springboot. In it I have 2 related classes, and when I do a get in one of them they return me a looping Infinite through your foreign keys I’ve tried using the…
-
0
votes1
answer41
viewsFulltext Mysql with Spring Boot
Good morning, I am trying to make a fulltext in mysql with spring boot, in mysql when I do the test with the sql command, the result brings back correctly, but when I pass the spring boot sql…
-
0
votes1
answer30
viewsUsing the JPA Repository example
I need to do a search in the bank where I have an object that is filled with everything except the id and check if it has any object that gives a "Match" with it and return it! I thought to make a…
-
0
votes1
answer92
viewsOracle Session date format for running Stored Data
Talk guys, all good? I have a little problem that may be simple to solve, but I could not find solution so far. I have procedures stored in the oracle database that need to be executed, however I am…
-
0
votes1
answer36
viewsJPA+Eclipselink Composite Key with Object
I am creating a class of stocks where the key of the table will be the product code+local, so that the system can control various stocks of the same product in different locations. I created an…
-
0
votes1
answer26
viewsError while deploying appengine
I have this project in spring, runs locally with appengine, but when I deploy, it error it in appengine org.eclipse.jetty.annotations.ServletContainerInitializersStarter doStart:…
-
0
votes1
answer197
viewsJPA connection to Firebird error
I always used mysql for the database, but now I have a need to connect with a band Firebird(FDB) in a project, I am using Maven, when trying to connect spring returns me the following error: Caused…
-
0
votes0
answers110
viewsPersist child objects with parent id 1:N
Guys I’m having difficulty in relationships with Hibernate, I have a 1:N relationship between Provider and Address (1 provider may have N addresses). My problem is this, when I try to persist a…
-
0
votes1
answer2231
viewsHow to do Inner Join in Jpa Springboot
I have the following appointment: select m.id, m.nome, m.crm, e.descricao especialidade from medico m inner join especialidade e on e.id = m.especialidade_id Whose database return is like this: '5',…
-
0
votes1
answer199
viewsInsert data into related entity @Onetoone in Spring Boot(Jpa, Hibernate, Postgre)
I have a one-dimensional relationship (1:1) where the contract has a tenant. Class User @Table(name="TB_USER") @Inheritance(strategy = InheritanceType.JOINED) public class User implements…
-
0
votes0
answers20
viewsJava Criteriabuilder groupBy with Expression and Criteriabuilder.Function
I’m getting the bug: "ERROR: "movement0_.date1" column must appear in the GROUP BY clause or be used in an aggregate function". Estou usando o seguinte código para montagem da typedQuery:…
-
0
votes0
answers29
viewsJPA Hibernate does not work when I add the module-info.java
Hello, I am developing a simple CRUD study using Javafx such as GUI and JPA/Hibernate to do the work with the database. It’s a Maven project, I’ve added the required libraries and Javafx and…
-
0
votes0
answers97
viewsREST Springboot API to generate random bet numbers
I am creating a REST API to generate random number for lottery. These are the requirement endpointes. In the first step, we need to build an endpoint that will receive the person’s email and return…
-
0
votes1
answer33
views