Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase property names in method names.
Using unrelated property names.
✗ Incorrect
The method name must include the property name 'LastName' to query by last name.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Equals' instead of 'GreaterThan' for comparison.
Using string-related keywords like 'Contains' for numeric fields.
✗ Incorrect
The keyword 'GreaterThan' is used to find records with age greater than the given value.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Contains' or 'StartsWith' when case insensitivity is needed.
Omitting the case-insensitive keyword.
✗ Incorrect
The correct keyword to ignore case sensitivity is 'IgnoreCase'.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names.
Not capitalizing property names properly.
✗ Incorrect
The method name must include both 'FirstName' and 'LastName' to query by these fields.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up keywords for numeric and string fields.
Forgetting to add 'IgnoreCase' for case insensitive search.
✗ Incorrect
Use 'GreaterThan' for age comparison, 'Containing' for partial email match, and 'IgnoreCase' to ignore case in email.