0
0
Spring Bootframework~10 mins

Custom query methods by naming convention 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 define a method that finds users by their last name.

Spring Boot
List<User> findBy[1](String lastName);
Drag options to blanks, or click blank then click option'
ALastName
BAge
CId
DEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase property names in method names.
Using unrelated property names.
2fill in blank
medium

Complete the method name to find users older than a certain age.

Spring Boot
List<User> findByAge[1](int age);
Drag options to blanks, or click blank then click option'
AGreaterThan
BEquals
CContains
DStartsWith
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Equals' instead of 'GreaterThan' for comparison.
Using string-related keywords like 'Contains' for numeric fields.
3fill in blank
hard

Fix the error in the method name to find users by email ignoring case.

Spring Boot
User findByEmail[1](String email);
Drag options to blanks, or click blank then click option'
AStartsWith
BContains
CGreaterThan
DIgnoreCase
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Contains' or 'StartsWith' when case insensitivity is needed.
Omitting the case-insensitive keyword.
4fill in blank
hard

Fill both blanks to find users by first name and last name.

Spring Boot
List<User> findBy[1]And[2](String firstName, String lastName);
Drag options to blanks, or click blank then click option'
AFirstName
BAge
CLastName
DEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names.
Not capitalizing property names properly.
5fill in blank
hard

Fill all three blanks to find users by age greater than a value and email containing a string.

Spring Boot
List<User> findByAge[1]AndEmail[2][3](int age, String emailPart);
Drag options to blanks, or click blank then click option'
AGreaterThan
BContaining
CIgnoreCase
DStartsWith
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keywords for numeric and string fields.
Forgetting to add 'IgnoreCase' for case insensitive search.