According to grails definition of dynamic finders you can say that play framework finders are also defined in a dynamic fashion by using dot notation with the finder object. So a query such as:
SELECT * FROM PERSON WHERE name = 'Fred'
Would be created like so
public class Person extends Model {
public Integer id;
public String name;
public static Finder<Integer,Person> find = new Finder<Integer,Person>(
Integer.class, Person.class);
}
and you would write your dot-notation query where-ever like
List<Person> people = Person.find.where.eq("name", "Fred").findList();
Alternatively you can make the Finder object private and then write methods within the Person class which have method signatures defining the query such as:
public static List<Person> findByName(String name) {
return find.where().eq("name", name).findList();
}
I find that writing all of the dot-notation queries within methods of the class to be more maintainable especially if you are working with a larger code base.
You can read a little more about it here