Questions tagged as 'hibernate'

0
answers

Recover login when registering

I'm trying to register a user of type bettor and soon after the registration, it is redirected to the index page, but when I make the registration it generates the error:    Serious: java.lang.ClassCastException: bean.LoginBean can not cast c...
asked by 30.04.2018 / 21:08
1
answer

JPA + HIBERNATE error

Gentlemen. I have a class called User. @Entity @Table(name = "tb_usuario") public class Usuario { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @Column(name = "email", nullable = false, unique = true) private String...
asked by 06.05.2018 / 17:19
1
answer

Insert foreign key hibernate

I have four entities (selection, start, bet and bettor) where within the Bet class I have the IDs of a bet and a bettor. When I try to insert a bet by loading the game and the bettor into it, it gives me the following error:    org.hibernate....
asked by 20.04.2018 / 15:32
0
answers

Automatic database creation with Hibernate

Hibernate has the ability to automatically create tables in the database based on the entities that have been mapped, similarly to EntityFramework in .Net     
asked by 01.04.2018 / 19:12
1
answer

Hibernate + JPA 5 - Java Web

I need help with the following problem. When running my java web project in Glassfish the hibernate at every run try to recreate my tables. Minha Entity. @Entity @Table(name = "Estados") public class Estado implements Serializable { @Id @...
asked by 09.04.2018 / 16:57
0
answers

removal of JPA and Hibernate related data

I have two classes, Fornecedor and Produto and when I register the Produto and I choose a Fornecedor saved normal, but at the time of removing a Produto or Fornecedor that is related to a Produto...
asked by 31.03.2018 / 19:26
0
answers

java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: query

I'm having to do a SELECT in JPA that contains an ORDER BY by selecting from another table. Small representation of tables: WhenIdiditforSQLitwasnormal,butwhenIturneditonJPA,itdidnotwork,andifItakeouttheJPAitworksnormally.  2018-03-2816:36:2...
asked by 28.03.2018 / 21:41
1
answer

ManyToMany JPA - Product Category

Hello, I'm having trouble deleting a record that has @ManyToMany relationship. When I delete the record for the Product entity with the CascadeType.ALL annotation, it deletes all the records in the middle table (Categorization), not just...
asked by 22.03.2018 / 19:05
1
answer

Browse rows from a javaEE, jsf2 and Primefaces dataTable with the arrow keys?

I found this code on the internet, but some of it has been discontinued xhtml: <p:hotkey bind="down" update=":testform:tabletest" action="#{aBean.moveDown()}" /> aBean: public void moveDown() { FacesContext facesContext...
asked by 16.03.2018 / 19:58
1
answer

Show result of a servlet list in JSP page

I need to capture an input name, query the database, and return the result in a jsp page. I want to show the result in a short section of the JSP page, in case I mix the JSP page text with the result I want to capture. jsp page with input  ...
asked by 17.03.2018 / 22:08