Questions tagged as 'hibernate'

1
answer

Hibernate / JPA - object is an unsaved transient instance

Good afternoon people! When saving a new contract readjustment I have to search for other "similar" contracts to what I'm re-adjusting and readjust them as well. So I was trying to use a callback ( saveAfter ) after saving the first...
asked by 14.11.2016 / 15:41
1
answer

Sending sms via Java [closed]

Personally, I'm developing a financial application that I was asked to complete at the end of a posting, sending a sms to the primary admin. I am using Java web, Mavem, jsf, Hibernate. Could someone give me a light. Thank you.     
asked by 12.10.2016 / 00:07
1
answer

Remove default message @Pattern JPA

I need a help from you. I'm creating a web service rest in java using jersey and hibernate. To validate the fields reported by the caller I used the JPA @Pattern annotation, as follows: @XmlRootElement public class Cfop { @Pattern(regexp = "[...
asked by 09.11.2016 / 22:12
1
answer

Problems in Java project with CDI (Weld) + Hibernate + PrimeFaces

Good evening. I'm having trouble executing my project with the structure described in the title of this post. I am using Hibernate, with Transaction Control by Server (JTA). Follow the classes in my project. Bean that is referenced in the xht...
asked by 12.08.2016 / 05:38
1
answer

Multiples @ElementCollection in two different classes @Embeddable

I have an entity with two Embedded classes of the same type, and each has an ElementCollection of the same type, too. The business logic seems to be correct, but I'm experiencing some problems with the lack of knowledge in JPA. Here are m...
asked by 18.08.2016 / 19:09
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
2
answers

Hibernate: Increment from a specific value

I created an attribute of type Integer called registration and I want it, when the user registers, the value of this registration is generated automatically and saved in mysql from a certain value (Ex: 95000) and as others go if you regis...
asked by 18.07.2016 / 23:20
1
answer

Problem with connection control with the Bank

I'm having some connection problems with the database. Here is my code and the exception. Code @Repository public class MinhaClasseDAOImpl implements MinhaClasseDAO{ protected EntityManagerFactory entityManagerFactory = Persistence.creat...
asked by 11.07.2016 / 15:27
1
answer

Error: EntityManager is closed

My command system, when trying to merge tables, I use EntityManager.merge, however the following error occurs: EntityManager is closed. Here is one of the functions in my code that causes this error: public boolean trocar_Mesa(BigDecimal or...
asked by 05.07.2016 / 02:40
1
answer

Persist associative table in manyTomany

I have the following problem: How will I persist in an associative table that has no class? I have two classes: Person and Time, where I want to make the relationship between people and teams. This creates the Person_Time table, with the Pers...
asked by 05.07.2016 / 17:21