Привет, я делаю систему управления контентом для компании Night Awards, и сейчас я сосредоточен на создании контента и актеров. Это то, что у меня есть до сих пор. < /P>
@Entity
@Data
@Table(name = "cast_crew")
public class Cast {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
@Column(columnDefinition = "TEXT")
private String bio;
private String imageUrl;
}
< /code>
@Entity
@Data
public class Content {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
@Column(columnDefinition = "TEXT")
private String description;
@Enumerated(EnumType.STRING)
private ContentType contentType;
private String countries;
private String genres;
private String languages;
private boolean featured;
@Enumerated(EnumType.STRING)
private ApprovalStatus approvalStatus = ApprovalStatus.PENDING;
private String portraitImage;
private String landscapeImage;
}
< /code>
Now I want to create a join between them. But the thing is a cast person can have multiple roles in a certain content(say a movie). For example person A in a movie M is a Director, Actor, Writer. How can i create a join like this. This will be a management system so I should be able to manage the different casts in a movie, add new ones, delete existing ones etc. Also I was thinking that I should be able to select from existing casts when editing a content, so would thymeleaf be good for this. If i want to add a complete new cast person to a movie, i will need to create a cast individually then select it in the edit menu for content. Later on I will also need to add entities for the nominations, awards edition etc.
Подробнее здесь: https://stackoverflow.com/questions/797 ... in-springb