ExercisePlan, ExercisePlanDetail - no OneToMany connection, Delete operation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user