Most voted "jpa-2.0" questions
Java Persistence API (or simply JPA) is a standard Java language API for data persistence that must be implemented by frameworks that wish to follow such a standard. JPA defines an object-relational mapping medium for simple and common Java objects (Pojos), called entity Beans. Several object/relational mapping frameworks such as Hibernate implement JPA.
Learn more…103 questions
Sort by count of
-
1
votes1
answer171
viewsError integrating Spring 4 + Hibernate 5 + JPA 2 and Glassfish
I’m unable to start the Spring transaction, it’s some configuration I made wrong who can help me. follow the codes: java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()…
-
1
votes1
answer31
viewsDifferent web applications use the same connection pool
Hello! I have two Webs applications that are connected to a single database in the bank, how do I make them enjoy the same connection pool? I create the c3p0 variables in the persistence.xml of…
-
1
votes0
answers62
viewsJPA + Ormlite android: not all of the entity are returned
good evening, I’m having the following problem. I’m using JPA with Ormlite to make persistence on Android. I created a class Produto and a Categoria, both inherit from an abstract class…
-
1
votes1
answer388
viewsDuplicate value in the bank when inserting new users with an already used Role (Spring-Security)
Hello I’m creating a simple web application with Springmvc and Spring Security. I did the User and Roles class as follows: @Entity public class Usuario implements UserDetails { private static final…
-
1
votes1
answer1191
viewsproperty "Hibernate.hbm2ddl.auto" value="update" is not working with postgres
The configuration property of persistence.xml: property name="hibernate.hbm2ddl.auto" value="update" Not working or better is giving error at the time of deploy. If I use how create works but even…
-
1
votes1
answer431
viewsJPA / Hibernate - Lazyloading Onetomany duplicating records
Well, I have the following structure: public class FinCxaTransacaoGrupo { @Id @GeneratedValue(generator="gen-uuid") @GenericGenerator(name="gen-uuid", strategy = "uuid2") @Type(type="pg-uuid")…
-
1
votes1
answer171
views'Transaction is not active' after receiving error for not being able to delete
Guys tried to mount a crud for study and I came across the following situation. I’m using JPA and hibernate. When trying to delete a record that has reference in another table is launched an…
-
1
votes2
answers1470
viewsHow to search using jpa with searching for foreign key
I am trying to perform a search with jpa, I am with the following query: String jpql = "Select m from Medicamento m where m.usuario_id = ?1"; but this error occurs: Exception in thread "main"…
-
1
votes1
answer77
viewsSensitive data in persistence.xml
I am using JPA in my application and so I have a file persistence.xml which contains the connection data to my database: <property name="javax.persistence.jdbc.url"…
-
1
votes1
answer1539
viewsERROR: column "type" of relation "tb_person" does not exist
Hello. I am trying to persist a record, but when I run, it is returning the error below: // ... @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "tipo", discriminatorType…
-
1
votes0
answers266
viewsjava.lang.Illegalstateexception: Cannot create a Session after the Response has been Committed
Good morning guys, I am with a strange problem in my application only after Gero War and send to Integrator, the application does not even open the Login screen, is returned this error: INFO:…
-
1
votes0
answers49
viewshow to change an object instead of one properties at a time using JPA
I have a @Entity Call employee, when I need to change properties name, position, salary etc.. I have to make one property at a time as example below. My class Functioncontroller @Transactional…
jpa-2.0asked 7 years, 4 months ago JavaX_javaX 141 -
1
votes1
answer903
viewsError starting C3P0 connection pool
I configured C3P0 and at start the error occurs below. WARN [com.mchange.v2.resourcepool.Basicresourcepool] com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@74a41b98 -- Acquisition…
-
1
votes1
answer514
viewsCalculate the total Sales Revenue
I have a consultation page that shows the total of the revenue for each product and I want to calculate the total of the sum of the recipes but is going wrong. The correct summing in the hand gave…
-
1
votes1
answer604
viewsSearch using Criteria with WHERE, AND and OR
I’m trying to do a survey using Criteria, the research would be this: SELECT * FROM lefacil.pap_produto a WHERE (a.marca='Fabber Castell' or a.marca='Tilibra') AND (a.quantidadeCores='12 Cores' or…
-
1
votes1
answer311
viewsReason for delay of process and configuration of Hibernate (persistence)
I’m setting up a WS server with Java, and I’m seeing some problems, like login via POSTMAN, is taking between 6000 to 7500 ms to respond, and what it really does, is around 50 ms. After being able…
-
1
votes1
answer339
viewsRecover shopping cart after close and open browser
I’m assembling a shopping cart with JSF it’s working, but not in the way I believe is correct. Example: When I enter sales sites, even if I am not logged in, I can add items to the cart, and even…
-
1
votes1
answer597
viewsSpringboot - JPA - does not migrate relationships in the entity and relationship diagram
I am creating a Rest application using Springboot, JPA and as a Mysql database. It works well, but it has something strange when I enter the database. I used Workbench to create the relational…
-
1
votes1
answer227
viewsHow to create a business rule by JPA?
I need to implement a business rule that ensures that the same employee represented by the table Employee cannot be added more than once to the same project represented by the table Project. Let me…
-
1
votes1
answer179
viewsRemove method does not work, nor returns error
My method remove does not delete the record on BD. And, worst, returns no error, nor executes the query (except for Select, I think it’s normal). I used the prints to know if the object was arriving…
-
1
votes1
answer108
viewsMapping with Inheritancetype.JOINED Does not work
I’m trying to solve a college activity where specifications were passed to map the classes with JPA. I have the following inheritance to map: Employee (parent class), Seller (daughter) and…
-
0
votes1
answer254
viewsHow to do a random search using JPQL script in JPA2
The idea is basically to search for an X number of entities persisted randomly, and these entities cannot be repeated. The question is, is there any way to perform this type of search by creating…
-
0
votes1
answer149
views -
0
votes0
answers174
viewsApplication does not access database when hosted
I have a trial hosting, but I can’t access the database. persists.xlm: <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"…
-
0
votes2
answers191
viewsnull return when registering new product, but when editing I can save give no error
Hello guys I’m having jsf application problems, cdi, when new product registration give null return, but when editing makes editing normally. give error ago 28, 2016 12:52:37 AM…
-
0
votes1
answer45
viewsProblem with Hibernate at the time of lodging
I have a webservice that works perfectly on my machine, I use mysql and Hibernate. I’m getting a lot to do hosting on Integrator.com.br, gives DNS problems etc. The main problem is, when running the…
-
0
votes1
answer129
viewsHibernate with dynamic table names
Good Morning/Afternoon/Evening Staff! in a scenario where a comic table must have a concatenated name and dates as this would look with Hibernate given that the base name is annotated in the model.…
-
0
votes1
answer3898
viewsObject References an Unsaved Transient instance - save the Transient instance before Flushing
I have the following problem I have three tables one with the name User with the following properties: Id, User, Username and Password Person with the following properties Id, Name Functionary with…
-
0
votes1
answer85
viewsHelp on a JPA query
I’m trying to make a query using JPA criteria, it would be as follows: I will pass 2 Start date and a Final Date and a vehicle plate how can I make this query? NOTE: The table that I will consult…
-
0
votes2
answers509
views -
0
votes0
answers410
viewsSaving jpa objects in spring transaction
Good morning, there has been a problem in the application that I work when I persist the object in the database I see the jboss log showing the Insert instruction plus the id of the object remains…
-
0
votes1
answer129
viewsDoubt JPA 2.1 and Hibernate 5.2
I have some questions with JPA 2.1 and Hibernate 5.2. The last version of the JPA booth is 2.1. Right? Is it correct to say that I can implement a JPA-only AP without Ibernate? What are the features…
-
0
votes1
answer255
viewsError using Hibernate to generate tables and doubts about
I am creating a webservice using Maven to manage the dependencies of my project. At the moment, I’m looking to create a database based on my models. I have four doubts and a problem in my attempt:…
-
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
answer105
viewsHibernate + JPA 5 - Java Web
I’m in need of some help in the following problem. When running my web java project on Glassfish Hibernate on every run try to recreate my tables. Minha Entity. @Entity @Table(name = "Estados")…
-
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
votes0
answers11
viewsTable is not generated via jpa
I am studying JSF through the book "The definitive guide to jsf in java ee 8", but I made an error I reviewed the code many times and did not find the origin of this error : Exception…
-
0
votes1
answer875
viewsNull Service Instance with @Autowired
Hello, everyone. I am making a Springboot REST webservice application with JAVA. I need a method to run from time to time. For this, I am using Quartz (org.Quartz). The class method is executed in…
-
0
votes1
answer194
viewsJPA merge/persist
I have the following structure: A.class B.class C.class D.class A.class contains many B.class containing a D.class C.class contains many D.class containing a B.class Whereas D.class is persisted in…
-
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
votes2
answers292
viewsModelling Inheritance Bank with JPA
I understand the concept of Heritage, currently I am working with a condo management project, and I find myself in the following question as you can see below; Please disregard the Debts table, my…
-
0
votes1
answer104
viewsCorrect way to update an object property
I created an update method, however I am having to create a variable to update my position property, which although it is working, I think this would not be the correct way to treat an object. I…
-
0
votes0
answers64
viewsProblem with JSF & JPA Lists
I don’t know if it’s right the way I’m doing it, but I got a problem: java.lang.Illegalargumentexception: id to load is required for loading. When I try to remove a template from the list, and also…
-
0
votes2
answers1587
viewsClass is Managed, but is not Listed in the persistence.xml file
I’m having a problem that I wasn’t before I migrated to JPA 2.0. Receiving message that all my classees / entities are not listed in persistence.xml and even after adding them I keep getting the…
-
0
votes0
answers47
viewsCriteria Hibernate - Error
I’m getting the following Exception, I analyzed my code and I am not able to find the error. The query is performed and returns the objects, but when returning, launches the Exception.…
-
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
answer116
viewsJPA read-only database
Good morning, I have an unusual case for me. A database where I need to make selects and update in 1 or 2 columns of a table. I would like to know how to configure my persistence.xml Persistence.xml…
-
0
votes1
answer41
viewsHow to return data through the Java Criteriaapi from more than one table?
I have a class that doesn’t persist: Peopleware.java public class PessoaDadosSearch{ private Long idPessoaDadosSearch; private String nome; private String cpf; private String municipioResidente;…
-
-1
votes2
answers634
viewsError with @Autowired annotation
Good morning. I’m studying JPA + Hibernate + Spring MVC and I’m a few days with this problem and I can’t solve it. I looked on the Internet and the solutions I saw did not solve. Thank you. Stack…
-
-1
votes1
answer48
viewsView not returning updated BD data
I have a bank view that when I register a new record the same view brings the outdated values to my listing. It only brings the data up to date if I take down the server and go up again. I am using…
jpa-2.0asked 9 years, 3 months ago João Manolo 928