0
0
Spring Bootframework~5 mins

Fetch types (LAZY vs EAGER) in Spring Boot - Quick Revision & Key Differences

Choose your learning style9 modes available
Recall & Review
beginner
What does LAZY fetch type mean in Spring Boot?
LAZY fetch type means related data is loaded only when it is accessed for the first time, not when the main entity is loaded.
Click to reveal answer
beginner
What does EAGER fetch type mean in Spring Boot?
EAGER fetch type means related data is loaded immediately with the main entity, even if it is not accessed right away.
Click to reveal answer
intermediate
Which fetch type can cause performance issues if many related entities are loaded unnecessarily?
EAGER fetch type can cause performance issues because it loads all related data immediately, even if not needed.
Click to reveal answer
intermediate
How does LAZY fetch type improve application performance?
LAZY fetch type improves performance by loading related data only when needed, reducing initial data load and memory use.
Click to reveal answer
intermediate
In which scenario is EAGER fetch type preferred?
EAGER fetch type is preferred when related data is always needed immediately with the main entity, avoiding extra database calls later.
Click to reveal answer
What happens when you use LAZY fetch type in Spring Boot?
AData loads randomly
BRelated data loads immediately with main entity
CNo data is loaded at all
DRelated data loads only when accessed
Which fetch type loads all related entities immediately?
AEAGER
BDEFERRED
CNONE
DLAZY
What is a downside of using EAGER fetch type?
AData loads only on user request
BRelated data never loads
CSlower initial loading due to loading all related data
DIt causes syntax errors
When is LAZY fetch type most useful?
AWhen related data is always needed
BWhen related data is rarely needed
CWhen no related data exists
DWhen you want to load everything immediately
Which annotation attribute controls fetch type in Spring Boot JPA?
Afetch
Bload
Ctype
Dmode
Explain the difference between LAZY and EAGER fetch types in Spring Boot.
Think about when related data is loaded and how it affects speed.
You got /3 concepts.
    Describe a situation where you would choose LAZY fetch type over EAGER.
    Consider saving resources by loading data only when necessary.
    You got /3 concepts.