ExercisePlan, ExercisePlanDetail - no OneToMany connection, Delete operation

This commit is contained in:
Bossanyi Tibor
2020-09-10 07:15:42 +02:00
parent d860d79667
commit efe7dea584
10 changed files with 99 additions and 29 deletions
@@ -17,11 +17,13 @@ data class ExercisePlan(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
var exercisePlanId: Long = 0
var exercisePlanId: Int = 0
@OneToMany(fetch = FetchType.EAGER, mappedBy = "exercisePlan")
/* @OneToMany(fetch = FetchType.LAZY, mappedBy = "exercisePlan")
@Fetch(value = FetchMode.SUBSELECT)
val planDetailList: List<ExercisePlanDetail> = mutableListOf<ExercisePlanDetail>()
*/
}
@@ -6,15 +6,18 @@ import javax.persistence.*
@Entity
data class ExercisePlanDetail (
@get: NonNull var exerciseTypeId: Long = 0,
@get: NonNull var exercisePlanId: Int = 0,
@get: NonNull var exerciseTypeId: Int = 0,
@get: NonNull var serie: Int = 0,
@get: NonNull var repeats: Int = 0,
@get: NonNull var weightEquation: String? = "",
@get: NonNull var weightEquation: String? = ""
@ManyToOne(fetch = FetchType.EAGER, optional = false)
/* @ManyToOne(fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "exercisePlanId", nullable = false)
@JsonIgnore
val exercisePlan: ExercisePlan? = null
*/
) {
@Id