Questions tagged as 'jpa-2.0'

2
answers

Changes directly in the database reflect in the managed bean?

I'm developing a simple web application, a form. I did the DAO's, Facades and they are working correctly (at least I think they are) but I will also need to edit some values directly in the bank only these changes are not being reflected in the...
asked by 06.02.2014 / 20:37
1
answer

How to create a business rule by JPA?

I need to implement a business rule that ensures that the same employee represented by the Employee table can not be added more than once to the same project represented by the Project table. Let me give you an example; Let's assume we ha...
asked by 17.09.2018 / 21:11
1
answer

Reason for process delay and hibernate configuration (persistence)

I'm building a WS server with Java, and I'm seeing some problems, such as login via POSTMAN, it's taking between 6000 and 7500 ms to respond, which it actually does, is around 50 ms. After you can configure log4, most of the delay is in: or...
asked by 31.01.2018 / 17:34
1
answer

Error integrating Spring 4 + Hibernate 5 + JPA 2 and Glassfish

I am not able to start the Spring transaction, it is some configuration that made me wrong who can help me. follow the codes: java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction() at org.hibernate.internal.Abst...
asked by 25.02.2018 / 22:24
1
answer

Search using Criteria with WHERE, AND and OR

I'm trying to do a search using Criteria , the search would be this: SELECT * FROM lefacil.pap_produto a WHERE (a.marca='Fabber Castell' or a.marca='Tilibra') AND (a.quantidadeCores='12 Cores' or a.quantidadeCores='24 Cores'); I already re...
asked by 01.12.2017 / 19:30
1
answer

'Transaction is not active' after receiving error for not being able to delete

Galera was tempted to set up a crud for study and I came across the following situation. I'm using JPA and Hibernate. When trying to delete a record which has a reference in another table, an Exception is thrown saying that it can not dele...
asked by 28.07.2016 / 15:49
1
answer

Sensitive data in persistence.xml

I'm using JPA in my application and so I have a persistence.xml file that contains the connection data with my database: <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost/banco" /> <property name="j...
asked by 28.08.2016 / 18:05
1
answer

How do I make a OneToMany Unidirectional relationship with joincolumn mandatory? [closed]

How do I make this relationship mandatory when em.persist () is run? I do not want to bidirectional map. @OneToMany(cascade = {CascadeType.ALL}) @JoinColumn(name = "cliente_id",referencedColumnName="ID",insertable=true, nullable=false,...
asked by 16.08.2016 / 20:39
1
answer

JPA / 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") @Column(name="id_fin_cxa_tran...
asked by 01.07.2016 / 20:02
1
answer

JSF calendar with datatable having data from different lists

I'm making software in JSF (2.2), primefaces and JPA with Postgres bank. I need to make a schedule of accounts payable with the following columns and their data: Column before yesterday with data: due date, vendor and value. Column yesterday wit...
asked by 26.06.2015 / 14:40