0
0
Spring Bootframework~10 mins

Cascade types and behavior in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify a cascade type that propagates all operations.

Spring Boot
@OneToMany(cascade = CascadeType.[1])
private List<Order> orders;
Drag options to blanks, or click blank then click option'
APERSIST
BREMOVE
CALL
DMERGE
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing only one operation like PERSIST or REMOVE when ALL is needed.
2fill in blank
medium

Complete the code to cascade only the persist operation to child entities.

Spring Boot
@OneToMany(cascade = CascadeType.[1])
private Set<Item> items;
Drag options to blanks, or click blank then click option'
ADETACH
BREFRESH
CREMOVE
DPERSIST
Attempts:
3 left
💡 Hint
Common Mistakes
Using REMOVE which deletes entities instead of saving them.
3fill in blank
hard

Fix the error in the cascade configuration to allow merging child entities.

Spring Boot
@OneToMany(cascade = CascadeType.[1])
private List<Comment> comments;
Drag options to blanks, or click blank then click option'
AMERGE
BREFRESH
CREMOVE
DPERSIST
Attempts:
3 left
💡 Hint
Common Mistakes
Using PERSIST which only saves new entities, not updates.
4fill in blank
hard

Fill both blanks to cascade persist and remove operations.

Spring Boot
@OneToMany(cascade = {CascadeType.[1], CascadeType.[2])
private Set<Tag> tags;
Drag options to blanks, or click blank then click option'
APERSIST
BREMOVE
CDETACH
DREFRESH
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up cascade types that do not save or delete entities.
5fill in blank
hard

Fill all three blanks to cascade merge, refresh, and detach operations.

Spring Boot
@OneToMany(cascade = {CascadeType.[1], CascadeType.[2], CascadeType.[3])
private List<Attachment> attachments;
Drag options to blanks, or click blank then click option'
AMERGE
BREFRESH
CDETACH
DPERSIST
Attempts:
3 left
💡 Hint
Common Mistakes
Including PERSIST when only merge, refresh, and detach are needed.