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
votes1
answer87
viewsJaxb and JPA: class Embeddable Could not determine type for java.util.List
I’m trying to incorporate a class into another class. I’ve been able to do this in other scenarios, however, by the error shown below, I’m not getting it now. javax.persistence.PersistenceException:…
-
0
votes1
answer58
viewsProblem when performing a select with JPA
I’m facing a bug I can’t figure out a solution. When I do a persist and then select the received and normal result, but when doing an update and after that select instead of displaying the updated…
-
0
votes0
answers98
viewsCould not determine type for: java.util.List, at table: ..., for Columns: [org.hibernate.Mapping.Column(...)]
I have a very simple problem using JSF + JPA c/ Hibernate. I have two classes: Message and Comment.. The Message class contains a list of Comments. But when trying to make this relationship the…
-
0
votes1
answer168
viewsJPQL - SQL query
good night. I have a bean, which has an init() method. One of the objectives of this init is to bring the cycle that was opened according to the course of that user, that is, If there is no cycle or…
-
0
votes0
answers99
viewsError when returning the object after query
Good night to you all. Objective: The main objective is to take the user id and the code of the simulated that he answered, and display it on another screen after he answers this simulated, however,…
-
0
votes1
answer294
viewsLongtext MYSQL Persistence Variable Type
Good morning, In my database Mysql, I have a column of the type longText. My doubt is how to declare the type and annotation of this variable in the java class. Soon search found the following…
-
0
votes1
answer66
viewsError to play search screen data for registration screen for editing
Gentlemen, I’m having a hard time getting the objs from my customer search screen, and playing it on the sign-up screen for editing it. My search screen is with a button with a <p:button…
-
0
votes1
answer60
viewsError while listing database data - JPA2 and Hibernate / JSF
Console error in eclipse mar 27, 2018 2:05:24 PM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException GRAVE: Error Rendering View[/Fornecedor.xhtml] javax.el.ELException:…
-
0
votes0
answers385
viewsDisplay login user profile data
Good guys to creating a panel where have my profile section for the Administrator who is online can see your profile information. However I am still having problems creating the profile page, I have…
-
0
votes1
answer76
viewsError: 'Operand type Clash: image is incompatible with Numeric'
When trying to save an object in the database, gives the following exception: org.hibernate.Exception.Dataexception: could not update. [...] Caused by: java.sql.Sqlexception: Operand type Clash:…
-
0
votes0
answers205
viewsHow to run database call with JPA parameter
How do I call a stored procedure from the bank I have the following procedure stored in the database, and I wish to execute your call by passing the parameter projId, using JPA to pick up the…
-
0
votes1
answer269
viewsError 500 in java webservices when testing in Postman
I am a good time trying to solve this problem,I configured my environment about 3 times but when it comes to testing Postman always gives the error 500,I believe that my problem is not in the entity…
-
0
votes1
answer108
views -
0
votes0
answers351
viewsJPA hibernate - delete children from the list
public class A implements Serializable { @OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY) @JoinColumn(name = "A_ID") private List<B> bList; } public class B…
-
0
votes0
answers176
viewsMany To Many JSF and JPA
Greetings my dear, I ask for help to resolve the following question: I have two entities in a relationship of many to many @Entity public class Livro implements Serializable { private static final…
-
0
votes1
answer383
viewsHow to mount a generic query using jpa nativequery
Consider the following table: table: info_people ||Row ||first name||last name ||nationality ||time_do_heart |1|Marcelo |aragao |brazil |sp |2 |maria |Fonseca |brasil |sp |3 |Joao |timotio |brazil…
-
0
votes1
answer422
viewsHow to implement the pessimistic lock in Java WEB EJB?
I have competition problems in my system, I need to insert the lock pessimistic because users access and save at the same time, causing bizarre errors in the result.
-
0
votes1
answer144
viewsJavax/persistence/Persistence problem using JPA with CXF
I am facing an error when I try to consume a web service that is using JPA(Eclipse-link) to insert data into the database. Classes Entity : @Entity @Table(name = "gato") public class GatoPersistente…
-
0
votes1
answer65
viewsCode does not update in Hibernate JPA in Eclipse
Hello guys I’m making a system to sharpen a little my techniques and I came across a problem. I modified my code a little while ago but when I went to debug it looked like it was running the old…
-
0
votes1
answer47
viewsInsert record into a table and use newly generated ID to insert record into related table
I have a insert where I save a record, and need to use the result of the saved value in another insert. Empresa emp = new Empresa(); emp.setId(1); emp.setNome("Nome da empresa");…
-
0
votes0
answers174
viewsDoubt when generating REST of return of Procedure in jersey
I have a method where his return is a list, based on an execution of a trial in the bank StoredProcedureQuery spq = em.createStoredProcedureQuery("PROCEDURE"); .... The return of this query are some…
-
0
votes1
answer110
viewsLimit @Onetomany List
Good morning Guys! I have some problems in a list that in some cases do not need to return it completely @OneToMany(mappedBy="local", cascade=CascadeType.ALL, fetch = FetchType.EAGER)…
-
0
votes1
answer78
viewsWhat to call Named Query in main? JPA
Guys, please, could someone show me how to call in the main @Namedquery class of another class. Follow the example: @Entity @Table(name="edificio")…
-
0
votes1
answer39
viewsError in the findById of a generic class for persistence and queries using Hibernate JPA
I have a generic class I’m using to perform queries with JPA Hibernate. My class is like this: public class BaseRepositoryImpl<T> implements BaseRepository<T> The problem is that in some…
-
0
votes1
answer62
viewsDoubt Beginner SQL
I need to know what the following queries accomplish, but I am doubtful, because I am starting to study SQL now. You can help me? "SELECT user_id, CAST(SUM(points_per_badge) AS INT) " + "FROM…
-
0
votes1
answer248
viewsError saving form with Hibernate: could not execute statement
I have a web form that saves data in Mysql, but is returning an error could not execute statement; Column 'bairro' cannot be null. The error says that the 'neighborhood' field cannot be null, but I…
-
0
votes0
answers285
viewsHibernate, JPA and SQL Server ERROR
I can’t get my application up. Below the stack, persistence and pom. Stack 22:25:32.131 [main] ERROR o.h.tool.hbm2ddl.SchemaExport - HHH000231: Schema export unsuccessful…
-
0
votes1
answer98
viewsCss only applies on one page, using Spring MVC
Hello, I’m doing a project using Spring MVC I’m applying a css to the main page and it’s all right. <link href="${contextPath}resources/css/reset.css" rel="stylesheet" type="text/css"…
-
0
votes0
answers59
viewsDoes Jparepository Saveall maintain the state of persistence in memory?
Jparepository offers us options save and saveAndFlush to persist the objects to the database. Unlike saveAndFlush, the save keeps the persistence state in memory, which ends up generating memory…
-
0
votes0
answers42
viewsError using MD5 in @Query in Springboot application
Good morning, initially I was trying to execute a query that would return a checksum: @Query(value = "SELECT MD5(STRING_AGG(atendimento::text, '')) FROM atendimento WHERE id_avaliador_fk = ?1;",…
-
0
votes1
answer416
viewsSpring Data JPA: How to Project Data?
I’m following a tutorial to make projection based at this link. However, it seems that the application is generating an error in the serialization of the data emitted by the reflection of Jackson.…
-
0
votes1
answer34
viewsNamed query not known - Hibernate + JSF
Personal talk, I’m having trouble calling a named query, resulting in org.hibernate.MappingException: Named query not known Hibernate.cfg.xml: <hibernate-configuration> <session-factory>…
-
0
votes1
answer80
viewsConvert query return to Integer
How can I cast a query for Integer? Follow what I tried to execute. public Integer validaPrincipal(String usuario, Integer tipo) { try{ return (Integer)…
-
0
votes0
answers131
viewsJPA Hibernate two entities with the same name, always saving in the same entity
I have a jCombobox where all the entidades students. It happens to have two entities with the same name (two students Rodrigo Silva for example). Both are loaded on combo. To the gravar the data in…
-
0
votes0
answers75
viewsHow to work with Classes that have other Classes as a Springboot attribute
Eae people , this is the first time I’m programming for the web and using spring boot for it , is a college project where Frontend will be done in JS with React and Back made in JAVA with Spring .…
-
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
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
answer36
viewsHow to deal with duplicity exceptions in Constraint Unique?
Speak devs, all right? How best to deal with duplicity errors when trying to create field with Constraint Unique? Just let the exception happen? Or I a findByAlgumCampo and if it already exists I do…
-
0
votes0
answers12
viewsjava.lang.Classnotfoundexception: javax.persistence.Persistence
I am in error when using Entitymanagerfactory, is a web project with Hibernate + JPA This is the mistake: java.lang.Classnotfoundexception: javax.persistence.Persistence at…
-
0
votes0
answers212
viewsOn call to Entityidentifierreaderimpl#resolve, Entitykey was already known; should only happen on root Returns with an optional Identifier specified
Using Hibernate with class: Java text. package br.com.meusite.model.documento; @Entity public class Texto extends ABeanDao<Texto> { private static final long serialVersionUID = 1L; private…
-
0
votes1
answer546
viewsEdit datatable record
Next person: On my datatable when I click the edit button, you are not opening the screen for editing. Can anyone help me where I am missing? page: <h:form id="pesquisa"> <p:panel…
-
0
votes1
answer287
viewsJPA Eclipselink - Trigger SQL SERVER
I’m having a problem with a Trigger created in SQL SERVER. When I insert the data into the table that starts Trigger directly in SQL SERVER Trigger works normal, however when performed insertion by…
-
0
votes1
answer289
viewsPostgresql reserved word problems
Dear friends, I am using locally a code downloaded from Github for educational purposes and I am having trouble deploying War, the error has to do with a reserved word from the database used in the…
-
0
votes2
answers228
viewsCreate bi-directional relationship without using DTO?
Hello, I’m on a project and I need to do bidirectional relationship between two entities, the relationship is @OneToMany @ManyToOne, so far so good. But I wonder if there is any way to do it without…
-
0
votes1
answer39
viewsError in this repeat loop. It is only taking the first value of the database
Error in this loop of repetition. It is only taking the first value of the database. You’re just doing the consultation in the first field and you’re ignoring the others. @Controller //…
-
0
votes0
answers92
viewscompleteMethod primeFaces is returned the id where it should return name
I am creating a form where I have neighborhood address name etc, and for that, I am using prime Faces. <p:outputLabel value="Nome" for="nome" /> <p:autoComplete id="nome" size="60"…
-
0
votes0
answers319
viewsLosing database connection. Postgress, Glassfish
After about 15 minutes my system stops communicating with the database. Log Entry Detail Close-up Timestamp 05/09/2016 21:22:30.287 Log Level ERROR Logger…
-
0
votes1
answer536
viewsUni-directional Onetomany mapping with 3 classes using 1 single class
Good night, I have the following structure: @Entity public class Endereco { private String logradouro; private String numero; private String cep; private String bairro; private String complemento; }…
-
0
votes0
answers78
viewsDatetime Angularjs x Java x Mysql Persistence
I created an application in our company to control the use of certain equipment of our industry. The fact is that there was a need to control the date/time of entry and exit of a product in a…
-
0
votes0
answers360
viewsPersistence.xml file does not find class of the Provider tag
I’m creating a JPA + Maven Hibernate project. I put the required statements in pom.xml, and the project downloaded the Hibernate dependencies, but when configuring the Provider tag of the…