Here is my table design
**Songs
Movie Id - integer
[year] - integer
Song name - character
Set Singers(list) - text
Lyrics writer(list) -text
Length - numeric(3,2)**
I am developing a rest service using spring boot . I tried to implement a pojo where I am not getting good result.
here is my developed model class
@Entity
public class SongsInfo {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Long id;
int year;
@ElementCollection
List<String> singers;
@ElementCollection
List<String> lyricists;
float length;
public SongsInfo() {
}
public int getYear() {
return year;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setYear(int year) {
this.year = year;
}
public List<String> getSingers() {
return singers;
}
public void setSingers(List<String> singers) {
this.singers = singers;
}
public List<String> getLyricists() {
return Lyricists;
}
public void setLyricists(List<String> lyricists) {
Lyricists = lyricists;
}
public float getLength() {
return length;
}
public void setLength(float length) {
this.length = length;
}
/* public MoviesInfo getMoviesInfo() {
return moviesInfo;
}
@Access(AccessType.PROPERTY)
@ManyToOne
@JoinColumn(name = "movieId")
public void setMoviesInfo(MoviesInfo moviesInfo) {
this.moviesInfo = moviesInfo;
}*/
}
Please help me to write a model class where I can implement all the CRUD operations .
My expectaion of data in the table:
MovieId year Song name setofsingers lyricists length
CA1532 2015 adiga adiga hemachandra, roopa ram,sirivennala 5:46