Category "jpa"

detached entity passed to persist - on findByMethod

I understand the error message and i know how to solve it, but i want to know why it occurs in this specific place especially on a find method. I created a mini

Cannot access org.springframework.data from my Java Classes

I'm working on an online tutorial, and in the step where I need to work with databases and add jpa, I cannot access it in my project. I have successfully put t

CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well

Hibernate 6.0.1 with PostgreSQL JDBC driver 42.3.5 causes the following exception: java.lang.UnsupportedOperationException: CteInsertStrategy can only be used w

Spring Boot + Hibernate - Insert query getting slow down

I am working on one spring boot application. Here I have 100,000 records that are inserted into db by different process. and its inserting one by one. I can't d

Find a record containing all or a part of a list of id of other table in a many-to-many relation on MySql/Jpa?

In my web application, I have 3 tables: TAB A: Recipes (id, name) TAB B: Recipes_Ingredients(id, fk_recipe,fk_ingredient, quantity) Bridge table TAB C: Ingredie

Why `spring-data-jpa` with `spring-data-cassandra` won't create cassandra tables automatically?

I'm using spring-data-cassandra:3.1.9 and the properties looks like : spring: data: cassandra: keyspace-name: general_log session-name: genera

How to remove an element from a Set inside a Page of items based on a Condition using Java 8

I have a Page of Farmers coming from a JPA repository call findAll method. Each Farmer consists of a Set of Farms which are also coming in the repository call l

This application has no explicit mapping for /error bad request 400

I have a small spring boot project,, which works fine . But, I tried to add some kind of validation.. I worked on one html page but failed on the other with no

What is wrong with my native query in jpa?

I'm sending a very simple query to the database, but I'm getting an error. It feels like I'm missing something very simple. I guess it wouldn't allow me to crea

spring data jpa on timestamp field for current date?

I have to query on timestamp field for current date and get only 1 record. I can write the query like: @Query("Select i From Log i Where i.createdBy = :userId

How can I use mysql table as a unique key generator in Spring Boot JPA?

I want to generate unique keys at run time across regions and the key generation will be owned by master region. I will have one table with one column(key) with

Eclipse (JBoss Developer Studio) not automatically building JPA metamodel classes

I have a Maven project set up that has a parent and two child modules: parent business support All of my JPA entities are in the support module. I've

JPA equivalent of Hibernate's @Generated(GenerationTime.ALWAYS)

When certain non key fields of a entity are generated in the database (for instance, by triggers) a call to persist will not bring back values that the database

Difference between save and saveAndFlush in Spring data jpa

I am trying to learn spring data JPA by testing some CRUD operation via JpaRepository. I came across two methods save and saveAndFlush. I don't get the differe

Fundamentals.How can you use Lazy fetching in Spring+Hibernate+=Vaadin after the session closes

There is the Customer entity which has a one to many relationship to entity Address,so there is a List<Address> getAddress in Customer.Entity Address has

org.hibernate.QueryException: Not all named parameters have been set:[]

I'm getting extremely strange behavior out of JPA 2.0 I'm trying to build a query that looks likes, where employeId and empDepartment are long values passing

JPA created too many fields in table

enter image description here I am trying to map some entities to tables in MySQL database using Spring Boot JPA. I have a problem with one of the tables because

spring-boot-starter-data-jpa dependency error

I am using new version of Spring boot - 1.5.7. But , when I create new spring starter project with jpa dependency, I got strange error: Caused by: org.spr

JPA ERROR: relation does not exist

I can't figure out what I'm doing wrong. I'm learning JPA mapping to a relational DB, by following some tutorials on the web, but can't find one that is straigh

JPA Multiple Embedded fields with prefix?

With JPA annoations, I want to reuse same embedded object like this : @Entity public class User { @Embedded public Address homeAddress; @Embedded