Questions tagged as 'jpa'

1
answer

JPA @ManyToMany with additional column

I am trying to connect two tables with a many to many relationship but, in the third table that relates them, apart from the id of each of the other two tables, there is a third field and I do not know how to indicate this third field. I have...
asked by 30.07.2018 / 00:09
2
answers

Make JPA name the tables in capital letters

I am using JPA with spring boot, hibernate and sql server, it works fine, but I would like the names of the tables and their fields in the database to write them in lowercase, how can I make it uppercase? This is how I have my properties:...
asked by 23.08.2018 / 19:29
2
answers

JPA Key composed for .find () [closed]

I have an entity with compound keys, how can I do the .find () Obj p = XPersistence.getManager().find(Obj.class, ??clave)??; p.setCampoDesc("hola"); XPersistence.getManager().getTransaction().commit(); the class has @Id @Column(...
asked by 28.03.2018 / 13:17
2
answers

Problem with query JPQL + JPA + JSF + EJB

@Override public Usuario iniciarSesion(Usuario us){ Usuario usuario = null; String consulta; try { consulta = "FROM usuario u WHERE u.usuario = ?1 and u.password =?2"; Query query = em.createQuery(consulta);...
asked by 25.10.2016 / 10:53
1
answer

JPA - Problems with persist of @ManyToOne

I am working on an application that requires data from faculties and careers to be saved and I have created the following entities:    Faculty @Entity @Table(name = "uc_facultades", schema = "uc") @SequenceGenerator(name = "Facultades_id_s...
asked by 28.01.2018 / 00:06
1
answer

Autoincrement error in jpa

This message I get when you perform the insert in the database and it does not give any errors, it only gives this message of warning .    Warning: The class RepeatableWriteUnitOfWork is already flushing. The query will be executed without...
asked by 11.12.2017 / 22:45
3
answers

Correct way to send data to a view with jpa spring framework

What is the best practice to send data to a view with Spring framework, it is correct to send an entity to a view or first convert an entity to a disc. This is because of the security issue, that not all the data in a table is necessar...
asked by 20.11.2017 / 22:40
1
answer

Error saving to a mySQL table with JPA

I have this class to save in a table with JPA: <línea 12>public class AgendaJPADAOImpl implements AgendaJPADAO, Serializable{ EntityManagerFactory emf= Persistence.createEntityManagerFactory("AgendaJPAPU"); EntityManager em= emf.createE...
asked by 17.10.2016 / 16:33
2
answers

Carry a SELECT to a NAMED QUERY

I want to do the following SELECT but in a NAMED QUERY , I do not know if it's possible. SELECT DISTINCT (q1.code ||'/'|| q1.name) FROM ( SELECT c.code,c.name FROM USER c ) q1     
asked by 05.08.2016 / 16:53
1
answer

doubt with Querys - BDOO

I have the following code: In the entity Article I have the following @NamedQuery @NamedQuery(name="Article.aumentapreu", query="UPDATE Article a SET a.preu=a.preu*:quantitat") And in manager class article: /...
asked by 20.03.2018 / 17:54