Questions tagged as 'jpa'

1
answer

SUM and MAX function in Hibernate

Hello I have the following scenario, I have a hibernate criter where I get the highest value from a column when I pass a branch code as a parameter. Example: There are only two branches if the code is 1 is a value, if 2 is another value that...
asked by 15.07.2015 / 02:46
2
answers

Failed to acquire data source with JPA and EclipseLink

When I put it to persistence.xml , using a JNDI resource configured in Glassfish itself does not give an error. But when it is to get from file glassfish-resource.xml it gives the following error:    Information: [EL Info]: 2014-...
asked by 09.07.2014 / 17:50
0
answers

Problem to write foreign key in table

I'm developing a java web project - using Spring, Thymeleaf, Html, Mysql. In this project I have two classes that are related by foreign key. (Technical and Cargo). In my view (addTechnical.html) I created a combobox using select to fetch the...
asked by 18.08.2018 / 04:11
1
answer

How to create a relationship using JPA that contains attributes?

Hello, I'm working on a Java Web project with Hibernate, Postgres, Glassfish, and use JPA / JSF. The problem is that my relationships were being generated with the following strategy: @JoinTable(name = "prop_user", joinColumns = {@JoinColumn(n...
asked by 07.07.2018 / 23:53
0
answers

How to implement Flyway in a JavaEE Maven project with Hibernate, vRaptor and JPA?

In a Maven, JPA, with Hibernate and vRaptor integrated project, how to implement the Flyway easily and effectively? Implementing this, my bank will upgrade as it was in the development <property name="hibernate.hbm2ddl.auto" value="upd...
asked by 08.05.2018 / 23:03
1
answer

Better EntityManager definition

I'm studying JPA together with Dependency Injection and read a few points about EntityManager : If we use the following method: public EntityManager getEntityManager() { EntityManagerFactory factory = Persistence.createEntityManagerFa...
asked by 28.12.2016 / 18:22
1
answer

Duplicate mapping error: org.hibernate.DuplicateMappingExceptionn

I'm using Hibernate 5 and am having the following problem: Caused by: org.hibernate.DuplicateMappingException: duplicate import: br.edu.unifeob.entidades.apuracao.Avaliacao refers to both br.edu.unifeob.entidades.apuracao.Avaliacao and br.edu....
asked by 14.08.2015 / 14:22
1
answer

How to map a column that does not exist in the database?

I'm having a small problem mapping (JPA) columns to a class in my system. I have some procedures in the bank that do a lot already and I would not like to stop using them, but I do not know how to map. SELECT r.*, ultimo_documento(r.id) as ult...
asked by 06.10.2016 / 05:00
1
answer

Failed to use search field by Spring MVC and JpaRepository

Good afternoon. I'm working on Repository and Spring MVC. I have an interface, StoreDAO that looks like this. public interface StoreOrderDAO extends JpaRepository<StoreOrder, String>{ List<StoreOrder> findByUser_id(String user_id)...
asked by 11.03.2015 / 20:33
6
answers

Hibernate is not creating the tables

I'm new to Hibernate, because of the little I've learned, I believe I did everything right, that is, I downloaded the dependencies, I wrote down the classes, etc. Below is my example class: package br.com.evolutionary.modelo; import javax.per...
asked by 12.05.2016 / 01:18