Just via public static final class variables. For example,
Code:
public static final ObjectGraphHydrationSpecification TIME_READS_WELL =
new AssayPlateHydrationSpecification("htpPlateReads.{htpTimeReads.{well}}");
The string passed to the constructor is an OGNL construct. This one means for all members of the collection htpPlateReads access the collection htpTimeReads and for all members of that collection get the well.
Typically, each domain model class will have multiple allowed hydration levels. Some are valid both pre and post fetch, some only post fetch. The client of the services then passes the hydration levels it needs to the service. In this way the division of responsibilty is clear. Domain model classes are responsible for defining allowed levels. Service clients are responsible for specifying which levels they require. DAO's are responsible for interpreting the levels and doing whatever is needed to get the data.

Originally Posted by
fschroder
Hello Johny,
That´s interesting because it adds another level of customization to the dao. How do your classes expose the allowed levels?
Federico.