Questions tagged as 'hibernate'

1
answer

Show sql generated by JPA / Hibernate

Is there any way to show the SQL generated by JPA / Hibernate without being enabled by the <property name="hibernate.show_sql" value="true"/> property? The difficulty is that I need to monitor only one query, and if I turn on...
asked by 20.07.2017 / 18:38
1
answer

How to map entities with composite keys in JPA?

I have a system where all tables in the database have a column empresa , which is part of PRIMARY KEY . In the client table, I have a column id (autoincrement), which together with empresa form a composite key, mappe...
asked by 09.04.2017 / 23:57
1
answer

Using enums in java

I created an enum and need to set the values in the database in this way: If it is Revenue, the value is 0; If Expense, the value is 1; This is my Enum: public enum EntryType { INCOME, OUTPUT; } In my java controller, the type...
asked by 21.02.2017 / 01:05
1
answer

Hibernate module error OGM + MongoDB inside Wildfly 10

11:13:17,164 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.module.service."deployment.brx-plataforma.war".main: org.jboss.msc.service.StartException in service jboss.module.service."de...
asked by 18.02.2017 / 14:53
1
answer

Error inserting data with Hibernate

I'm having an error inserting into my database:    ERROR: You have an error in your SQL syntax; Admission, Date of Resignation, Name, Marital Status, Sex, Zip Code, CPF, RG, Date of N 'at line 1   Exception in thread "AWT-EventQueue-0" org.hi...
asked by 07.01.2017 / 20:21
2
answers

Session hibernate, how to get instance

In all the hibernate documentation, and web examples have this code example, or a very similar one, to use hibernate. List<Object> list = session.createCriteria(Object.class); Since the session is a Hibernate Session Interface implemen...
asked by 15.12.2016 / 17:44
1
answer

Bug in the Spring query code with Hibernate

I have a problem, I'm studying spring mvc with hibernate and I ended up getting into a bug where it returns the following exception "java.lang.NullPointerException", it follows the codes: ContactController package br.com.agenda.controller...
asked by 03.02.2017 / 00:38
1
answer

Save only if it is not null

How do I map with Hibernate @OneToOne and save only if the information has data in the related table? Example: public class ObservacaoPessoa { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) public Integer id;...
asked by 16.02.2017 / 13:30
2
answers

IReport Tibco - Error processing XML: no element found

Hello! This is the following I'm having trouble generating the report, I'm using jsf, hibernate, mysql Follow my bean. @Named @RequestScoped public class RelatorioBean implements Serializable { private static final long serialVersi...
asked by 04.11.2016 / 14:49
1
answer

Method call inside the JSP

Good morning everyone! I was having trouble formatting dates in jsp, but with the help of friends here, I managed to resolve. The problem is that I think my code is far from the good practices in JSP, I had to program it inside the page, but...
asked by 23.01.2017 / 12:12