Questions tagged [spring-boot-jpa]
96 questions
0
votes
1 answer
I don't know why the double values are displayed in postman. Is the my code correct?
This is my Book class:
@Entity
@Table(name="book")
public class Book {
@JsonIgnoreProperties({"hibernateLazyInitializer",…

shreya
- 1
- 1
0
votes
0 answers
How to use Spring boot JPA native query with join unrelated entities
I have a custom model for order and item that will hold minimum data than the actual entity class
Models
class OrderMinimalModel {
long id;
String comment;
List items;
}
class ItemMinimalModel{
long…

Bikesh M
- 8,163
- 6
- 40
- 52
0
votes
2 answers
org.hibernate.HibernateException: Found shared references to a collection
Spring boot 2.5
@Entity
public class Orders {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@NotNull
@OneToMany(mappedBy = "orders", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
…

Alexei
- 14,350
- 37
- 121
- 240
0
votes
0 answers
springboot remove mysql auto configuration
I have a springboot application in which one module interacts with mysql database. It works fine if mysql server is up. But I would like to bring the application up and perform other activities even if the mysql server not available.
Right now, if…

din_oops
- 698
- 1
- 9
- 27
0
votes
1 answer
org.hibernate.MappingException: Could not determine type for custom object type
Spring boot 2.3
Entity Cart has many entites CartItem.
So here my models:
@Entity
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@OneToMany(mappedBy = "cart", fetch = FetchType.EAGER,
…

Alexei
- 14,350
- 37
- 121
- 240
0
votes
0 answers
In my Spring boot: TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing
Spring boot 2.2
@Entity
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;
@OneToOne(fetch = FetchType.EAGER,
cascade = CascadeType.ALL,
mappedBy = "cart")
private…

Alexei
- 14,350
- 37
- 121
- 240
0
votes
0 answers
Can't use org.springframework.data.util.Pair in Spring boot JPA
Spring Boot 2.2.5
One cart has many products.
I need to store products and quantity of products. So I use map for this.
So here my model:
import javax.persistence.*;
import java.util.*;
import org.springframework.data.util.Pair;
@Entity
public…

Alexei
- 14,350
- 37
- 121
- 240
0
votes
2 answers
Can't create entity object with map with custom object
Spring boot 2.5
I has entity Cart. One cart has many entities Product. In one cart has many products. So I try with @JoinColumn but I get error:
@Entity
public class Cart {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int…

Alexei
- 14,350
- 37
- 121
- 240
0
votes
1 answer
Spring Boot JPA : How to map a filed to a column whose data type is not fixed
I have an entity class with two fields.
@Entity(name = "additional_attributes")
class AdditionalAttributes {
@Id
private Integer id;
private String attributeName;
private Object attributevalue;
// getter and setter
// manytoone with…

Randhir Ray
- 540
- 5
- 14
0
votes
1 answer
Spring Boot 2 custom query with OneToOne mapping
I am using Spring Boot 2 with thymeleaf to display data from an existing Oracle 12 database.
The workflow entity is one of my main entities which I would like to display:
@Entity
@Immutable
@Table(name = "V_AV_WFPROC", schema="avuser")
public class…

dni0911
- 1
- 1
0
votes
0 answers
No property [propertyName] found for type [Type] when invoke findAll(pageable)
@Entity
@Table(name = "report_type")
public class ReportType implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private String id;
@NotNull
…

Haifeng Zhang
- 30,077
- 19
- 81
- 125
0
votes
2 answers
JPA - Validation failed for classes [com.homelancer.models.User] during persist time for groups [javax.validation.groups.Default, ]
I've been trying to figure out this apparent easy issue, but I'm having no sucess in it.
In essence, My entity "Job" has a One To One Relation with entity "User".
When trying to post a new Job, I do not want to send all the info regarding the User,…

Wambosy
- 3
- 1
- 2
0
votes
3 answers
JPA - UnsatisfiedDependencyException: Error creating bean with name : Unsatisfied dependency expressed through field
I do know there are quite a few answers already to this topic, but I still cannot find a proper answer to my issue in here. Here are the details:
Controller:
@RestController
@RequestMapping(path = "/api")
public class RoleController {
…

Wambosy
- 3
- 1
- 2
0
votes
2 answers
Spring Boot Mysql query to get all records based on the @query value
I am trying to retreive all records from a MySQL table using spring boot JPA. Following is the repositry definition
MovieRepository class
@Query("From MovieEntity m, TheaterMovieShowEntity tms, TheaterEntity t where t.city=?1 and…

mack
- 345
- 5
- 18
0
votes
1 answer
How SpringBoot JPA run DDL sql with dynamic tableName?
Yestody,I got this question, how jpa run DDL sql with dynamic tableName?
usually,I just used DQL and DML like 'select,insert,update,delete'.
such as :
public interface UserRepository extends JpaRepository {
@Query(value =…

Daiql
- 84
- 9