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
answer409
viewsDaughter entity does not receive its parent entity merge id via @Cascadetype
I have a problem when adding an entity to the database via Cascade. After the update of the entity Aluno the entity Daughter NivelAlunoLinguaEstrangeira does not work properly. @Entity @Table(name =…
-
0
votes1
answer106
viewsError in Embeddedid
I have the composite key below, the problem is that when creating the schema and save the values, Hibernate is reversing the values of TipoContrato with Distribuidora and vice versa. Someone has…
-
0
votes1
answer149
views -
0
votes1
answer1023
viewsJPA annotation @Autowired
@Autowired is the same as extends? Let’s take a small example: package com.dendetech.services; import com.dendetech.Entity.Participant; import com.dendetech.repositories.Participanterepository;…
jpaasked 9 years, 2 months ago André Nascimento 1,258 -
0
votes1
answer2919
viewsHibernate does not recognize class annotation
I have a Maven project, with Glassfish 4.0, Hibernate, I am using annotations and my project was faceted with JPA the persistence.xml file was generated and the Glassfish Connection pool is working.…
-
0
votes1
answer330
viewsDo not write to the database and the console appears as recorded
I have a form inside the modal to record registration, when I insert the data it is as if it were recorded in the Eclipse console, but the same does not happen in the database Message on console as…
-
0
votes1
answer73
viewsDetails with @Autowired and Down object
There’s been a conflict of concepts with me. I have here a service called: AtividadeService There are some lines that catch my eye: import com.dendetech.entity.Atividade; Why import Entity? If it…
-
0
votes1
answer133
viewsProblem with JPQL using JSF
I’m following a book Java EE 7 with JSF, Primefaces and CDI by Thiago Farias. In my persistence.xml, following the book, I have only the definition of my datasource, follows: <?xml version="1.0"…
-
0
votes1
answer1233
viewsProblem with JPA using Wildfly 9 and JTA
It’s the first time I’ve tried to use JTA using the Wildfly container and so far I haven’t been able to execute my code properly. When I publish the application(start Wildfly) it starta perfectly,…
-
0
votes1
answer152
viewsHibernate shows ddl but does not create tables in the database
When starting wildfly I expected the tables to be created in the database but in the console shows a log of create Tables but nothing happens in the database. Below I show it: 14:15:00,462 INFO…
-
0
votes0
answers260
viewsuser editing screen does not load data, and delete method does not delete
Take a look at the codes: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"…
-
0
votes2
answers711
viewsJpa Hibernate merge error
Error Hibernate: select SEQ_COUNT from SEQUENCE_TABLE Where SEQ_NAME = 'EMP_SEQ' for update Hibernate: update SEQUENCE_TABLE set SEQ_COUNT = ? Where SEQ_COUNT = ? and SEQ_NAME = 'EMP_SEQ' Hibernate:…
-
0
votes2
answers1232
viewsHow to change persistence.xml file settings through an external file?
I wanted to know how to change the configuration of the persistence.xml file through an external file. I am using JSF + JPA. I want to do this so as not to leave this setting stuck in the source…
-
0
votes0
answers98
viewsError while persisting object
I’m trying to persist an object and I’m getting this error. Does anyone know how to solve? if you need the classes, persistence.xml, I send. I am not running "on server" only by main method. I’m not…
jpaasked 8 years, 3 months ago Gabriel Faria 119 -
0
votes1
answer50
viewsHow to insert only some of the attributes
I am using JPA with eclipse link, wanted to insert only some data into the database, some of the attributes are not necessary to save, as I could do this?
-
0
votes0
answers1178
views -
0
votes1
answer298
viewsPrint table row "datatable"
I’m using Java, JPA, Wildfly and Primefaces. I have a table with several columns and rows, how do I print (report) each row of the table? each line will have its print icon and I would like to know…
-
0
votes1
answer57
viewsWrite data from one inputText into another inputText
Guys I’m using JAVA, JPA, Primefaces... In my view (xhtml) I have a login screen, how do I pick the name the user typed and write in another inputText field?
-
0
votes2
answers110
viewsAccess JAVA web application from other machines
I am using JAVA,JPA, with Wildfly,e primefaces. I have the link of my application http://localhost:8080/Sicoob/faces/cadastre I would like other machines to access this application, I already…
-
0
votes2
answers854
viewsPut default value in column
I need to leave a default value in this table column, I am mapping the Persistances with Hibernate (summarizing the database is created according to the HQL/JPA I define in Omains. How do I set a…
-
0
votes0
answers71
views -
0
votes0
answers120
viewsOutdated data in Hibernate + JPA queries
I noticed a problem in my Spring application, I am implementing an internal messaging service and when creating the display of the amount of unread messages I realized that the value varied with…
-
0
votes1
answer201
viewsSQL/ JPQL query
Friends, good afternoon. I have a table in the database called Question Inside the table I have two columns that are code (id) and question. I have a filter that I can not specifically bring only…
-
0
votes0
answers104
viewsCreate a JPQL and define the entity at runtime
Good night. I wonder if there is a way to make a JPQL query and define the entity at runtime, without having to concatenate or interpolate String. Example using interpolation: public long…
-
0
votes1
answer118
viewsHibernate - Set foreign key object without seeking object. Direct by Id
Someone knows if it is possible for me to set an object that is a foreign key if I have to look for it. That is, just by setting the direct id? Example: low.setIdEmpress(daoEmpresa.buscaPorId(new…
-
0
votes2
answers725
viewsSolution of exceptions Serviceexception and Failed to execute Goal org.codehaus.mojo:exec-Maven-plugin:1.2.1:exec?
The following error is occurring: Serviceexception and Failed to execute Goal org.codehaus.mojo:exec-Maven-plugin:1.2.1:exec? I have already changed the name of the Provider from…
-
0
votes0
answers960
viewsError trying to update: failed to lazily initialize a Collection, could not initialize proxy component <p:selectManyMenu>
I’m mapping a list with @ManyToMany (fetch = FetchType.EAGER), and I’m getting the following excpetion when I try to UPDATE a record in BD : ADVERTÊNCIA: failed to lazily initialize a collection,…
-
0
votes0
answers903
viewsPersist field blob with file extension - JPA, Hibernate
I need to persist an attachment as a pdf, xls, etc. (type field blob). I need to recover this file after persisting it and I don’t want it to be necessary for the user to inform the file extension.…
-
0
votes1
answer444
viewsSearch using two parameters in JPA
Good night to you all, I am stuck here in a logic, I did the DAO for all the CRUD of my project only that in it will not only have the search for the ID and I am also trying to do some method that…
-
0
votes1
answer175
viewsIllegalargumentexception: illegal value in JPA when recovering Jspinner value
I’m testing an event on a JTable of the kind tableMouseClicked(evt), only that I am having some errors when returning the values in the respective Jtextfield and in a Jspinner that I configured.…
-
0
votes0
answers32
viewsHow to check if my table has related records?
I am developing a project using JPA and with various relationship types like Onetomany, Manytomany, etc. Is there any way I can check if an X table for example has related records in another Y table…
-
0
votes1
answer1770
viewsWhat settings are required to make spring boot generate tables automatically?
I am currently trying to configure my application with spring-boot to generate tables automatically but still do not know how, someone can help?
-
0
votes1
answer463
viewsusing Entitymanager to return a List
Guys, I’m having a problem at the bank looking for a list of phones, these phones have to belong to a number. in my query I do this public List<Telefone> buscar(Proprietario proprietario) {…
-
0
votes1
answer2198
views -
0
votes1
answer659
views -
0
votes1
answer272
viewsUnable to build Entity manager Factory
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence…
-
0
votes1
answer75
viewsEquivalent to LEFT() sql function in JPA
What is the LEFT() equivalent function in JPA? I need to take only the first 6 characters of a field. The equivalent select in sql would be: select left(campo,6), count(*) qtd from tabela group by…
-
0
votes1
answer290
viewsWork with Date in Mysql, JPA
I’m using JPA and creating an entity to store one date within the database. So far so good, the problem is that I need to display the database information according to the month of my date. Do you…
-
0
votes1
answer254
viewsRelationship JPA, Spring, Angular,
I have a client record and I want to associate with this client a relationship of equipment but is not saving the relationship. on the model layer of the customer class I did so @OneToMany(cascade =…
-
0
votes2
answers537
viewsHibernate does not close connections/sessions in BD
I’m in big trouble using hibernate. Each time I call a method that performs a query or update in the database, Hibernate opens a session in the database and then does not close. I’ve tried…
-
0
votes1
answer83
viewsJPA entity generating column with double name id_municipio_id_municipio
I have an entity called districts that contains a relationship with the municipality table. When I run the database the districts table creates the id_municipio_id_municipio field and it was to be…
-
0
votes1
answer111
viewsJPA + JSP - Error trying to enter information into database
I have a problem that I’m not able to solve. I’m trying to enter the information in the bank and I’m not getting it. the browser is returning the following error when registering. Served at:…
-
0
votes1
answer82
viewsHibernate/SQL Average of a table with multiple relationships
I have the following tables TABLE 1 id value table 2 TABELA2 id Tabela3 TABELA3 id And with this, I would like to average TABLE 1, with WHERE in the parameters TABLE 3 with Hibernate/persistence,…
-
0
votes0
answers43
viewsSelecting sets of JPA values
I have the following problem: I have a table with a list of values for a composite key. Following example: ID | ItemCode | Localidade | Preco ---+----------+------------+------- 01 | 001 | 001 | 3.5…
-
0
votes1
answer501
viewsSpring boot + jpa + Localdate
I am unable to configure the classes convert in spring boot to convert the date that comes from the view into String to the controler that expects a Localdate java8, Someone could give me a hint ?…
-
0
votes1
answer3142
viewsJSP - java.lang.Illegalargumentexception: Parameter value [11] Did not match expected type [java.lang.Integer (n/a)]
CAN SOMEONE TELL WHAT I AM DOING WRONG? public List<Usuario> obterusuario(String user){ Consultar consulta = new Consultar (); EntityManager obconsulta = consulta.getEntityManager();…
-
0
votes1
answer311
viewsUsing Jparepository and pageable can I make a partial query?
I have an object that is persisted with jparepository, I use paging but it returns all fields which is not necessary for the application. So there is some way to configure a @Query to just pick up…
-
0
votes1
answer98
viewsJava Web - Remove Method Caused by: org.hibernate.Mappingexception: Unknown Entity: java.lang.Integer
Gent,and I’m trying to create a method in which I delete the database record. However, the following error is occurring: Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer…
-
0
votes1
answer132
viewsSelectoneradio sending only one value
I am concluding a simulation system for my course completion work. However, I have a problem that I have not yet been able to solve. I perform a filter to select the questions for the user to…
-
0
votes0
answers301
viewsJPA References an Unknown Entity
I have the following scenario: Class Rpsv3vo: package nfse.vo; import java.io.Serializable; import java.util.Objects; import javax.persistence.CascadeType; import javax.persistence.Column; import…