Viewing candidate dynamic finder methods
A dynamic finder method is a finder method for which you don't need to write a JPA query. It fetches entity instances from the database based on one or more persistent fields of the entity class. The implementation of these dynamic finder methods is auto-generated by Roo when you add their names to a persistent entity. As Roo doesn't create a DAO layer of an application, dynamic finder methods are defined in the entity class. In this recipe, we will look at the finder list command, which introspects a persistent entity and suggests names of possible dynamic finder methods that can be added to the given persistent entity.
Getting ready
Create a sub-directory ch03-recipes
inside the C:\roo-cookbook
directory.
Execute the ch03_persistent_entities.roo
script to create a flight-app
Roo project. The script sets up Hibernate as a persistence provider and creates a Flight
entity, which has FlightKey
as its composite primary key class. Additionally, the script...