Answer the question
In order to leave comments, you need to log in
How to change column type in postgresql via spring boot?
I have such an entity
import javax.persistence.*;
@Entity
public class RatingList {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String message;
private Double rating;
// связи на отправителя
// и на препода
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "user_id")
private User author;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "teacher_id")
private Teacher teacher;
public RatingList() {
}
public RatingList(String message, Double rating, User author, Teacher teacher) {
this.message = message;
this.rating = rating;
this.author = author;
this.teacher = teacher;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Double getRating() {
return rating;
}
public void setRating(Double rating) {
this.rating = rating;
}
public User getAuthor() {
return author;
}
public void setAuthor(User author) {
this.author = author;
}
public Teacher getTeacher() {
return teacher;
}
public void setTeacher(Teacher teacher) {
this.teacher = teacher;
}
Answer the question
In order to leave comments, you need to log in
Hello!
You can set length. For example,
@Column (length = 2000)
private String message;
@Lob
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question