Skip to content
Advertisement

Tag: hibernate

org.postgresql.util.PSQLException: ERROR: relation “users” does not exist – SpringBoot, Hibernate, Postgresql

I am using Spring Boot with Hibernate, JPA and Postgresql database. I am trying to create new user and save it. I have the following code: UserEntity.java UserController.java UserServiceImpl.java UserRepository.java Application.yaml My error in Intelij looks like this: I am testing it with Postman and sending JSON in body like this: But in Postman I am receiving 500 Internal Error.

Understanding JPA sequence generator

I’m using spring data JPA’s sequence generator to assign primary keys to entities. Model contains: The corresponding sequence definition(for SQL Server DB): Since I wanted to start the ids from 100 instead of 1, so I updated the sql script to And then I encountered the problem as mentioned here. I fixed it by the solution mentioned there. This made

Batch insert entities to DB (Quarkus, Hibernate)

First off: I’m not used to Quarkus or Hibernate (I’m pretty much all .net) Problem: My service receives a list of ~10k (Would guess thats the most common number). This comes via a resource endpoint, and it takes +10s for it to complete, Far to long. And the service is unresponsive. The statusDao.Create() is annotated with @Transactional: DAO is @ApplicationScoped

Strange exception when mapping two columns in a table to the same column in another table

There are two entities: and when i create repository with custom query the exception is thrown but if i remove the second referencing column from the query the program starts without exceptions. Moreover, if i use standart query method bookRepository.findAll(): all works fine Books: Book{id=3, name=’Test book’, author=Person{id=1, name=’Person A’}, reviewer=Person{id=2, name=’Person B’}} Book{id=4, name=’Test book’, author=Person{id=2, name=’Person B’}, reviewer=Person{id=1,

Spring boot delete object from database based on a OneToOne relationship

i’ve got an “appointment” entity object(table) AND dates_doctor_available entity build like this AND now i wish from a controller to remove the Database entry based on the “date_time_available_fk” Using “Appointment” object. For example something like where inside service there is a data object access something like this(they are interfaces) where id is the date_time_available_fk number i want to pass(i already

org.hibernate.hql.internal.ast.QuerySyntaxException: Apartment is not mapped [from Apartment]

I have springboot rest appplication with Hibernate and MySQL. I have this error: nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: Apartment is not mapped [from Apartment] But I dont know where I have a mistake. I have two tables: Apartments and Residents in DB. But now I try only getAllApartments() method. I use Intellij and I even checked my DB in her.

What am I doing wrong in this one to one bi-directional mapping?

I have two classes: Person and PersonDetail Person: PersonDetail I have set up a bi-directional one-to-one mapping between these classes. I am trying to save a person and that person’s details and then I am trying to fetch the person using the person’s details. The code for that is: My test is failing because the person detail object has a

Advertisement