ExerciseTreeParents all

This commit is contained in:
bossanyit
2020-12-05 11:47:12 +01:00
parent 9485389b9d
commit 044e999e7d
4 changed files with 24 additions and 13 deletions
@@ -22,4 +22,13 @@ class ExerciseTreeParentsController (private val exerciseTreeParentsRepository:
return if (list.isEmpty()) ResponseEntity.notFound().build() else
ResponseEntity.ok().body(list)
}
@GetMapping("/exercise_tree_parents")
fun getAll(): ResponseEntity<List<ExerciseTreeParents>> {
val list: List<ExerciseTreeParents> = exerciseTreeParentsRepository.findAll().orEmpty()
logger.info(" -- Get All Exercise Tree Parents by $list")
return if (list.isEmpty()) ResponseEntity.notFound().build() else
ResponseEntity.ok().body(list)
}
}
@@ -22,9 +22,4 @@ 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)
var parents: List<ExerciseTreeParents> = mutableListOf<ExerciseTreeParents>().toList()*/
}
@@ -11,12 +11,5 @@ data class ExerciseTreeParents (
var exerciseTreeParentsId: Long = 0,
@get: NotNull var exerciseTreeParentId: Long?,
@get: NotNull var exerciseTreeChildId: Long?
)/*{
@ManyToOne(fetch = FetchType.EAGER, optional = false)
@JoinColumn(name = "exerciseTreeChildId", nullable = false)
@JsonIgnore
val exerciseTreeChild: ExerciseTree? = null
}
*/
)