Questions tagged as 'hibernate'

2
answers

Tables are not created automatically by Hibernate in MySQL

Hibernate can not create the table in the database already created (drugstore). Follow the code below. Hibernate.cfg.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hiberna...
asked by 16.08.2016 / 14:11
1
answer

How to generate default values with JPA hibernate [closed]

I would like to optimize my code and my work with the following situation. I have an entity address that has one type, that is, another entity called TpEndereco. Since this table has default values, for example: commercial, other, residential .....
asked by 07.01.2016 / 19:18
1
answer

Instantiate annotated class with Hibernate inheritance using CDI

Good afternoon, I am creating a project using JSF , CDI , Bootstrap and Hibernate . I would like to know how to work with the following problem, I created a set of classes to represent a person entity física...
asked by 30.03.2016 / 18:16
1
answer

Hibernate Multitenant problem with current tenancy ID

I'm using the hibernate multitenant for schemas, I use the Postgresql database. My problem is the following I have a service where I do a select in a public schema table, then for each item returned I have to go to the client schema and make...
asked by 17.11.2015 / 23:51
2
answers

Select JPA and Hibernate

I have five entities (Quotation, Sector, Partner, Items and Leads), where the user will select a quotation and sector and the list of all items related to this sector will appear along with the items that have already been posted ( if any). I...
asked by 21.08.2015 / 04:36
1
answer

Refresh dialog form without closing it

How can I do to update my form dialog without closing it? In other words, I need to get the address by the zip code, and I'll throw it on the form, but I can not. Here is the code I'm using.: View: customer registration <?xml v...
asked by 21.05.2015 / 19:46
1
answer

Difference between Merge () and getInstace () in JPA / Hibernate

I would like to know when to use merge() to update the object instead of changing it through your reference. Example: Produto p = new Produto(); p.setNome("Bola"); p.setvalor("32); manager.persist(p); manager.getTransation().begin();...
asked by 24.04.2015 / 19:04
1
answer

Error: "Lock wait timeout exceeded; try restarting transaction "

I'm developing a java application that uses Hibernate to do the mapping. I created the DAO's of classes, but when doing insert, update and delete operations it returns me this MySQL error. Here are my classes (I'll only post the insertion met...
asked by 26.11.2014 / 19:13
1
answer

Relationship of classes by collections in JPA2

In a bean that has a OneToMany link, with others, through a HashMap what annotations should be used? @Entity class Rodada{ public HashMap<Pergunta,Resposta> perguntas;     
asked by 29.09.2014 / 21:27
1
answer

Improved Hibernate performance

I'm developing a Swing application using Hibernate, but I still do not know all the tricks that the tool has and the development used-it gives me a nice knowledge, but I came across a situation that I researched on the internet and in some books...
asked by 11.08.2014 / 17:37