Привет, я делаю систему управления контентом для ночной компании. Мы сможем принять новые записи, а затем выдвинуть и выбрать победителей.
Это то, что у меня есть в Springboot до сих пор. < /P>
@Entity
@Data
public class AwardCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long awardCategoryId;
private String awardCategoryName;
}
< /code>
@Entity
@Data
public class Content {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long contentId;
private String contentName;
@Column(columnDefinition = "TEXT")
private String synopsis;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "content_type_id")
private ContentType contentType;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "country_code")
private Country countryCode;
private String portraitUrl;
private String landscapeUrl;
private Boolean featured;
private ContentApprovalStatus approvalStatus;
@CreationTimestamp
private LocalDateTime createTime;
@UpdateTimestamp
private LocalDateTime updateTime;
@ManyToMany
@JoinTable(
name = "content_genre",
joinColumns = @JoinColumn(name = "content_id"),
inverseJoinColumns = @JoinColumn(name = "genre_id")
)
private Set genres;
@ManyToMany
@JoinTable(
name = "content_language",
joinColumns = @JoinColumn(name = "content_id"),
inverseJoinColumns = @JoinColumn(name = "language_id")
)
private Set languages;
@OneToMany(mappedBy = "content", cascade = CascadeType.ALL, orphanRemoval = true)
private Set contentCrews;
}
< /code>
@Entity
@Data
public class ContentCrew {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "content_id")
private Content content;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "crew_id")
private Crew crew;
private String role;
}
< /code>
@Entity
@Data
public class ContentType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long contentTypeId;
private String contentTypeName;
}
< /code>
@Entity
@Data
public class Country {
@Id
private String countryCode;
private String countryName;
}
< /code>
@Entity
@Data
public class Crew {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long crewId;
private String crewName;
@Column(name = "crew_dob")
private Date crewDoB;
@Enumerated(EnumType.STRING)
private Gender crewGender;
@Column(columnDefinition = "TEXT")
private String bio;
private String image_url;
@OneToMany(mappedBy = "crew", cascade = CascadeType.ALL, orphanRemoval = true)
private Set contentCrews;
}
< /code>
@Entity
@Data
public class Genre {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long genreId;
private String genreName;
}
< /code>
@Entity
@Data
public class Language {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long languageId;
private String languageName;
}
< /code>
@Entity
@Data
public class Submission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long submissionId;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "content_id")
private Content contentId;
private Integer submissionYear;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "award_category_id")
private AwardCategory awardCategory;
private Integer nominationYear=0;
private Integer awardYear=0;
}
< /code>
Is this good enough to make a content management system as i want to have complete control over almost every aspect of this. Once the content management is complete the submissions entity and the content entity will be used to populate the site using a rest api which i will work on later.
My current entity relation design
Подробнее здесь: https://stackoverflow.com/questions/797 ... in-springb
Как создать оптимальное соединение с правильным каскадом между двумя субъектами в Springboot для фильма DB ⇐ JAVA
Программисты JAVA общаются здесь
1758617929
Anonymous
Привет, я делаю систему управления контентом для ночной компании. Мы сможем принять новые записи, а затем выдвинуть и выбрать победителей.
Это то, что у меня есть в Springboot до сих пор. < /P>
@Entity
@Data
public class AwardCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long awardCategoryId;
private String awardCategoryName;
}
< /code>
@Entity
@Data
public class Content {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long contentId;
private String contentName;
@Column(columnDefinition = "TEXT")
private String synopsis;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "content_type_id")
private ContentType contentType;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "country_code")
private Country countryCode;
private String portraitUrl;
private String landscapeUrl;
private Boolean featured;
private ContentApprovalStatus approvalStatus;
@CreationTimestamp
private LocalDateTime createTime;
@UpdateTimestamp
private LocalDateTime updateTime;
@ManyToMany
@JoinTable(
name = "content_genre",
joinColumns = @JoinColumn(name = "content_id"),
inverseJoinColumns = @JoinColumn(name = "genre_id")
)
private Set genres;
@ManyToMany
@JoinTable(
name = "content_language",
joinColumns = @JoinColumn(name = "content_id"),
inverseJoinColumns = @JoinColumn(name = "language_id")
)
private Set languages;
@OneToMany(mappedBy = "content", cascade = CascadeType.ALL, orphanRemoval = true)
private Set contentCrews;
}
< /code>
@Entity
@Data
public class ContentCrew {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "content_id")
private Content content;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "crew_id")
private Crew crew;
private String role;
}
< /code>
@Entity
@Data
public class ContentType {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long contentTypeId;
private String contentTypeName;
}
< /code>
@Entity
@Data
public class Country {
@Id
private String countryCode;
private String countryName;
}
< /code>
@Entity
@Data
public class Crew {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long crewId;
private String crewName;
@Column(name = "crew_dob")
private Date crewDoB;
@Enumerated(EnumType.STRING)
private Gender crewGender;
@Column(columnDefinition = "TEXT")
private String bio;
private String image_url;
@OneToMany(mappedBy = "crew", cascade = CascadeType.ALL, orphanRemoval = true)
private Set contentCrews;
}
< /code>
@Entity
@Data
public class Genre {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long genreId;
private String genreName;
}
< /code>
@Entity
@Data
public class Language {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long languageId;
private String languageName;
}
< /code>
@Entity
@Data
public class Submission {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long submissionId;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "content_id")
private Content contentId;
private Integer submissionYear;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "award_category_id")
private AwardCategory awardCategory;
private Integer nominationYear=0;
private Integer awardYear=0;
}
< /code>
Is this good enough to make a content management system as i want to have complete control over almost every aspect of this. Once the content management is complete the submissions entity and the content entity will be used to populate the site using a rest api which i will work on later.
My current entity relation design
Подробнее здесь: [url]https://stackoverflow.com/questions/79770434/how-to-create-a-optimal-join-with-proper-cascade-between-two-entities-in-springb[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия