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?
✗ Incorrect
LAZY fetch type delays loading related data until it is accessed.
Which fetch type loads all related entities immediately?
✗ Incorrect
EAGER fetch type loads related entities immediately with the main entity.
What is a downside of using EAGER fetch type?
✗ Incorrect
EAGER fetch can slow down loading because it fetches all related data upfront.
When is LAZY fetch type most useful?
✗ Incorrect
LAZY fetch is best when related data is not always required, saving resources.
Which annotation attribute controls fetch type in Spring Boot JPA?
✗ Incorrect
The 'fetch' attribute in annotations like @OneToMany controls LAZY or EAGER loading.
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.