API 1.0.18 Tree Parents
This commit is contained in:
@@ -23,4 +23,9 @@ data class ExerciseTree (
|
||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseTree")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
val translations: List<ExerciseTreeTranslation> = mutableListOf<ExerciseTreeTranslation>().toList()
|
||||
|
||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "exerciseTreeChild")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
val parents: List<ExerciseTreeParents> = mutableListOf<ExerciseTreeParents>().toList()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.aitrainer.api.model
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore
|
||||
import javax.persistence.*
|
||||
import javax.validation.constraints.NotNull
|
||||
|
||||
@Entity
|
||||
data class ExerciseTreeParents (
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
var exerciseTreeParentsId: Long = 0,
|
||||
@get: NotNull var exerciseTreeParentId: Long?
|
||||
) {
|
||||
@ManyToOne(fetch = FetchType.EAGER, optional = false)
|
||||
@JoinColumn(name = "exerciseTreeChildId", nullable = false)
|
||||
@JsonIgnore
|
||||
val exerciseTreeChild: ExerciseTree? = null
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user