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
answer432
viewsNo bean named 'entityManagerFactory' available
I am testing my Spring application with Junit, however the error occurs after placing the annotation @EnableJpaRepositories: Caused by:…
-
0
votes0
answers62
viewsProblems recovering data via altered JPA directly in the related entity
I have the following entity @Entity @Table(name="matricula") public class Matricula implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy =…
-
0
votes1
answer308
viewsIgnore parameter if null
I have the following method that does a database search: public Collection<Habilidade> pesquisar(HabilidadeForm form) throws Exception { String query = "select u from Habilidade u where u.nome…
-
0
votes1
answer46
viewsError inserting data into JPA
import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity // pode usar…
-
0
votes1
answer539
viewsJPA-HIBERNATE : I understood the conjunctions and disjunctions ? Is that right?
I took some JPA booklets and read some tutorials on the internet, but I’m still a little lost with regards to disjunction and Conjunction in JPA. From what I understood the conjunction serves to…
-
0
votes1
answer389
views -
0
votes0
answers175
viewsSaving dynamic data in the same Java identity
I’m using Spring MVC, Thymeleaf and for me with all routes built he did automatic but not this working, Entity, Repository, controller and etc. I have a relation of N=N of course to Turn, of that…
-
0
votes2
answers64
viewsCreating XML File With Find a particular user in the table using foreach jpa java
Good morning !! Personal my doubt is as follows I have two tables a Person and another Employee. I am doing a for in both tables to be able to create an XML file, but as I am not returning the…
jpaasked 7 years, 9 months ago JavaX_javaX 141 -
0
votes1
answer158
viewsHow to Insert List with JPA
Good afternoon! I am making a web service that receives a Json from the application, disembowels and inserts into the database. I can disembowel normally, the problem occurs at the time of entering…
-
0
votes2
answers150
viewsAfter @Joincolumn JPA does not find Entity attribute
I have two entities that are directly related to @Entity State and @Entity City And my intention was to rename the foreign key present in the customer identity, for example, from 'city.stade_state'…
-
0
votes0
answers756
viewsSelect item in Jcombobox and return associated value in Jtextfield in JPA
I try several times in a Swing form to make sure that when selecting the option in Jcombobox the value of the item in the column of the same row appears in Jtextfield. Once I managed to do this…
-
0
votes1
answer595
views@Onetomany Bidirectional
Good afternoon, you guys I am developing a financial web application and am having problems in making the relationship between Lancamento and ItemLancamento. I will post what I have done so far,…
-
0
votes1
answer349
viewsBuild List mapped with @Manytoone only with a few objects
It is possible to mount a list in a class with only a few objects? @NamedQuery(name = "Curso.Aprovados", query = "select cur from Classificacao cl JOIN cl.candidato ca JOIN ca.curso cur") public…
-
0
votes0
answers34
viewsData does not persist in the database
I have a Primefaces3.5, JSF 2.1 and JPA 2.0 application I am uploading a file in which it does not persistence in the bank but outputs in the console are ok. I still don’t understand why you’re not…
-
0
votes2
answers104
viewsJPA - Java does not insert data into the database
Bean @Named("proprietarioMB") public class ProprietarioBean implements Serializable { private static final long serialVersionUID = 1L; @Inject private ProprietarioService proprietarioService;…
-
0
votes1
answer2589
viewsCreating the JPA/Hibernate "persistence.xml" file
I wonder if there is a way to setup the creation(s) of the persistence.xml at the time of project creation. Example of the aqruivo: <!-- propriedades do hibernate --> <property…
-
0
votes0
answers113
viewsHibernate: query performance drop after a few repetitions
I am developing a Farm Management system. One of the basic queries is to list the animals by type that are alive (inFarm = true). Below is the method that executes this query. public List<T>…
-
0
votes2
answers453
viewsInserting data using JPA
I need help saving the data of an application using JPA. I followed a tutorial that only helped in the implementation of login but did not show how to save the data. In this case, I am trying to…
-
0
votes1
answer557
viewsProblems with CDI + Weld in Wildfly
I’m trying to create a EntityManagerProducer and it seems in the examples found on the internet something very simple, but it is not being. So I conclude that I am doing something wrong follows my…
-
0
votes1
answer136
viewsHow to save a csv using Hibernate and mysql
I need the following routine to be done: Read some information from the database; Generate a csv based on this data; Write this csv to the database; Start downloading this file to the user. I was…
-
0
votes1
answer360
viewsBring all table records with jpa and eclipselink
Guys, I have a question here at JPA. Today I have a method to search the Ufs by ID, as in the example below: public Uf consulta(Integer id) { EntityManager em = getEM(); Uf uf = new Uf(); try {…
-
0
votes0
answers134
viewsUpdate Hibernate
The situation is as follows, when placing the property <property name="hibernate.hbm2ddl.auto" value="update"/>, nothing else works, no query works anymore. log always ends with : jul 27, 2017…
-
0
votes0
answers89
viewsProblem with Hibernate and Wildfly server
Hello. I have a project with Hibernate 4.3.x + Postgresql + Wildfly. But I can’t run it. Follow the error: Iniciando WildFly Application Server WildFly Application Server iniciado Implantação…
-
0
votes0
answers560
viewsJPA with "Detached Entity passed to persist:"
Hello, I have a problem because I use an intermediate table to save the Ids of other 2 tables. Except that the way that Mapeei, I can’t save in this table because apparently JPA understands that I…
-
0
votes1
answer812
viewsError in wildfly postgres configuration
I performed the postgresql configuration: C: wildfly-10.1.0.Final modules system layers base with postgresql main I added the files: module.xml postgresql-9.4.1208.jre7. jar OBS: The bank has…
-
0
votes2
answers238
viewsIs it possible to reuse the parameters of a Query in JPA?
Hello, I have a question regarding Parameters of the object Query in the JPA. I am implementing pagination of my tables using the Primefaces with LazyDataModel and in the function I use to make the…
-
0
votes1
answer139
viewsConfigure orphanRemoval=true in Generate Entities of Table - JPA Tools - Eclipse
I’m having trouble every time I need to use JPA Tools' Generate Entities of Table (use Eclipse Neon.3). I run entities with the Generate Entities of Table command from JPA Tools. In the code of a…
-
0
votes1
answer303
viewsError validating Java user, Spring
I have an error validating the user next to the database. I’ve debugged and the data (which you see from the front end) is being received by the API. The method that makes the search in the database…
-
0
votes1
answer346
views@Datetimeformat with daylight saving time error
I’m having a problem converting date of day 15/10/2017 (start of daylight saving time) My mapping is like this: @Column(nullable = false) @NotNull @DateTimeFormat(pattern = "dd/MM/yyyy") private…
-
0
votes1
answer50
viewsError Returning Query Using Like
I am trying to make a jpql query with like using JPA. However, it is not working. User class repository public class UsuarioRepository extends RepositorioGenerico<Integer, Usuario> { public…
-
0
votes1
answer4414
viewsCan not deserialize instance of java.util.Arraylist out of START_OBJECT token
Using angular, I am unable to insert an array of genres into the Genero property that is in the Manga object. Using Postman to insert the Generos array into the /sleeve API would look like this. {…
-
0
votes1
answer352
viewsCallback methods annotated in a Listener bean class must Return void and take one argument: javax.persistence.Preupdate
I’m having this mistake on my console... Caused by: javax.persistence.PersistenceException: Callback methods annotated in a listener bean class must return void and take one argument:…
-
0
votes0
answers52
viewsProblems with Left Join with Eclipselink - Java
I have a problem with the following query: SELECT * FROM tipo_calibracao t LEFT OUTER JOIN fator_medio f ON (t.id = f.tipo_calibracao AND f.lote = 42) ORDER BY t.id ASC; Java: public…
-
0
votes1
answer174
viewsFactory error when using @Embeddable in JPA
I need to create a composite key on my system, after researching a little discover that I should implement @Embeddable, even fine, I added the class on my system implementing the keys, but when I…
-
0
votes1
answer907
viewsError with Unexpected JPQL token
I made a select JPQL but I’m having this error: Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: where near line 1, column 151 [select pes, pEnd from…
-
0
votes1
answer69
viewsFirebird JPA returning null values
When I try to get some record from the bank, some fields come null, although in the table they are not null! Any idea what might be causing this behavior? I’m using Java 8, Hibernate 5.2.4, Jaybird…
-
0
votes1
answer210
viewsError with Hibernate query
I am trying to perform the following Query on Hibernate: return this.entityManager .createQuery("SELECT u FROM UploadArquivoCondominio u WHERE " + " u.condominio = :ucondominio ) " + "AND u.dtinicio…
-
0
votes0
answers223
viewsjava.lang.Illegalargumentexception: org.hibernate.hql.internal.Ast.Querysyntaxexception: Unexpected AST Node: query
I’m having to make a SELECT in JPA that contains an ORDER BY by selecting from another table. Small representation of tables: When I did by SQL it was normal, but when turning into JPA, it did not…
-
0
votes1
answer338
viewsManytomany JPA - Product Category
Hello, I’m having difficulties in the process of deleting a record that has relationship @ManyToMany. When I delete the record referring to the Product entity with the annotation CascadeType.ALL, it…
-
0
votes1
answer633
viewsJPA insert an object that has a list as attribute
I am developing a layered system(packages),to exercise the concepts of class and came across a question I would like to create a product class,the same has attributes that are references of other…
-
0
votes1
answer95
viewsJPA Error when inserting a product object that has reference to an existing object
I am doubtful in the note manytomany ,I know that it serves to indicate to white that he needs to create an intermediate table and that in turn is located on top of an element that will be list…
-
0
votes2
answers318
views -
0
votes1
answer826
viewsError deserialize JSON - How to Resolve?
I’m using jpa and I have these two entities: @Entity @JsonIdentityInfo( generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") public class Categoria implements Serializable { @Id…
-
0
votes1
answer38
viewsDoubt regarding Join with multiple tables
I have a sale class and the same receives several products(manyToOne) and customer (oneToMany) and would like to join all in a Join to make a report with only the desired information. I tried to…
-
0
votes1
answer208
viewsJPA+HIBERNATE error
Sirs. I have a class called User. @Entity @Table(name = "tb_usuario") public class Usuario { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(name = "email", nullable…
-
0
votes0
answers44
viewsSave to JSF+JPA & Hibernate database error
Good afternoon I am making a registration with JSF , and when I try to save the user in the bank happens this error , however I already added all jars in the folder lib Tomcat , and it has been…
-
0
votes1
answer325
viewsHow to resolve this Error: Unknown Entity when saving to Hibernate?
Follow the code Itensvendadao: package com.livro.capitulo3.crudannotations; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import…
-
0
votes1
answer47
viewsMultiple Bags Exception / Searching multiple collections with JPA
I’m having a problem with JPA when I make an appointment. I’d like to consult Entity A that has a List of Entity B and List of Entity C (I want to consult Entity A bringing the relationships with…
-
0
votes1
answer847
viewsJava - Query Spring with current date
I have the following repository with the following method @Query("SELECT m FROM Money m WHERE m.data = CURRENT_DATE()") Money findTop1IfHasMoneyInCurrentDate(); My money class is like this: @Entity…
-
0
votes1
answer74
viewsProblem saving two sales at the same time - JAVA
I have a problem saving two sales at the same time on different computers, when it finishes both, one replaces the other. I am using @ManagedBean, @SessionScoped. This is my method salvar() in the…