0
0
Spring Bootframework~10 mins

Fetch types (LAZY vs EAGER) in Spring Boot - Interactive Practice

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

Complete the code to set the fetch type to lazy loading for the association.

Spring Boot
@OneToMany(fetch = FetchType.[1])
private Set<Order> orders;
Drag options to blanks, or click blank then click option'
AEAGER
BIMMEDIATE
CLAZY
DDEFERRED
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing EAGER when lazy loading is intended.
2fill in blank
medium

Complete the code to set the fetch type to eager loading for the association.

Spring Boot
@ManyToOne(fetch = FetchType.[1])
private Customer customer;
Drag options to blanks, or click blank then click option'
ALAZY_LOAD
BLAZY
CON_DEMAND
DEAGER
Attempts:
3 left
💡 Hint
Common Mistakes
Using LAZY when eager loading is required.
3fill in blank
hard

Fix the error in the fetch type declaration to use the correct enum value.

Spring Boot
@OneToOne(fetch = FetchType.[1])
private Profile profile;
Drag options to blanks, or click blank then click option'
AEager
BLAZY
CLazy
Dlazy
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase or mixed case enum values.
4fill in blank
hard

Fill both blanks to define a OneToMany association with lazy fetch and cascade all operations.

Spring Boot
@OneToMany(fetch = FetchType.[1], cascade = CascadeType.[2])
private List<Item> items;
Drag options to blanks, or click blank then click option'
ALAZY
BEAGER
CALL
DREMOVE
Attempts:
3 left
💡 Hint
Common Mistakes
Using EAGER fetch when lazy is intended.
Using REMOVE cascade instead of ALL.
5fill in blank
hard

Fill all three blanks to define a ManyToMany association with eager fetch, cascade persist, and mappedBy 'tags'.

Spring Boot
@ManyToMany(fetch = FetchType.[1], cascade = CascadeType.[2], mappedBy = "[3]")
private Set<Category> categories;
Drag options to blanks, or click blank then click option'
ALAZY
BPERSIST
Ctags
DEAGER
Attempts:
3 left
💡 Hint
Common Mistakes
Using LAZY instead of EAGER.
Using wrong cascade type.
Incorrect mappedBy value.