Skip to content

Commit

Permalink
Endre CascadeType
Browse files Browse the repository at this point in the history
  • Loading branch information
s148719 committed Dec 5, 2023
1 parent f9fed0a commit d2f810b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Behandling(
@OneToMany(
fetch = FetchType.EAGER,
mappedBy = "behandling",
cascade = [CascadeType.MERGE],
cascade = [CascadeType.MERGE, CascadeType.PERSIST],
orphanRemoval = true,
)
var inntekter: MutableSet<Inntekt> = mutableSetOf(),
Expand All @@ -91,14 +91,14 @@ class Behandling(
@OneToMany(
fetch = FetchType.EAGER,
mappedBy = "behandling",
cascade = [CascadeType.ALL],
cascade = [CascadeType.MERGE, CascadeType.PERSIST],
orphanRemoval = true,
)
var barnetillegg: MutableSet<Barnetillegg> = mutableSetOf(),
@OneToMany(
fetch = FetchType.EAGER,
mappedBy = "behandling",
cascade = [CascadeType.MERGE],
cascade = [CascadeType.MERGE, CascadeType.PERSIST],
orphanRemoval = true,
)
var utvidetbarnetrygd: MutableSet<Utvidetbarnetrygd> = mutableSetOf(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Inntekt(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long? = null,
@ManyToOne(fetch = FetchType.EAGER)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "behandling_id", nullable = false)
val behandling: Behandling? = null,
@OneToMany(fetch = FetchType.EAGER, mappedBy = "inntekt", cascade = [CascadeType.ALL], orphanRemoval = true)
Expand Down

0 comments on commit d2f810b

Please sign in to comment.