Questions tagged as 'hibernate'

1
answer

What is the benefit of using interfaces for services in Spring MVC?

Suppose I have the following JPA repository: public interface IGreetingRepository extends JpaRepository<Greeting, Long> { } And according to the documentation I would have to generate a service interface as follows: public interface...
asked by 29.12.2015 / 00:38
2
answers

org.hibernate.MappingException: Named query not known

When calling a query with a specific name, the system throws the exception: org.hibernate.MappingException: Named query not known . I've given it several laps but I can not find where the problem is. Consumo.java @Entity @Table( nam...
asked by 03.12.2015 / 16:56
5
answers

[Ljava.lang.Object; can not be cast

I have the following problem, I want to make a query to my db, to bring a list of a related class, all worked with hibernate, but when I want to print on the screen it throws me the following error: Exception in thread "AWT-EventQueue-0" java....
asked by 09.10.2016 / 22:19
1
answer

Error starting IndexOutOfBoundsException application

The application starts correctly, the error jumps when I try to access the path where the application is, which in this case is localhost: 8080 The default driver is this package com.example.demo.controllers; import java.util.HashMap; impo...
asked by 20.11.2018 / 09:47
1
answer

Grant value byte in a set

We have a DB with a User table that has a column of type Tinyint (Since it is a boolean) and we are working with Hibernate. My User model has a variable, autogenerated, Byte type to designate that user value (setters & getters). The fact is t...
asked by 20.04.2018 / 10:24
1
answer

Configure Spring Boot with two DataSources

I am using Spring Boot 2.X with Hibernate 5.X to connect two MySQL databases (Bar and Foo). I want to be able to list the different entities, with all their attributes (ID, Name and relationships @OneToMany/@ManyToOne ), of each of the...
asked by 07.03.2018 / 17:31
1
answer

Using StringProperty or DoubleProperty with Hibernate

Is it possible to create a class in Java to access with hibernate a database table with primary key compound (two or more fields), whose attributes with the @Column are of type StringProperty or DoubleProperty of JavaFX?...
asked by 20.10.2016 / 17:15
1
answer

Compilation error: The method findOne (long) is undefined for the type UserCrud]

to see if someone can help me because I get an error in compiling the edit and delete and I do not know why it is The method findOne(long) is undefined for the type UsuarioCrud ] with root cause java.lang.Error: Unresolved compilation pro...
asked by 03.12.2018 / 13:05
1
answer

I can not remove the object from my list DataTable

I am inside my service and here is where I put the parameter so that I receive the id of the row I want to delete. @Transactional public void eliminaHerramienta(Integer idherramienta) { try { Herramienta p = manager.find(Herramient...
asked by 27.06.2018 / 23:15
1
answer

How to leave by default that hibernate does not interfere with the serial type Id of postgresql?

I have a field ID in PostgreSQL of type serial , to be auto-incremental. But when I do the mapping with Hibernate the .xml of the table is saved like this: '<class name="Model.Persona" table="persona" schema="public" o...
asked by 14.12.2018 / 22:02