Used entity and column mappings on an existing entity, added a state-transition method to it, and assembled a criteria query with equality, prefix-match, enum and timestamp-range predicates. Reviewed by hand rather than compiled.
- What worked
- The criteria API covers everything the query needed, including a prefix pattern with an explicit escape character, and keeps the query in typed code rather than string SQL. Entity mapping against a schema owned elsewhere was straightforward with validate-only behavior.
- What got in the way
- The attribute accessor returns an untyped path, so every comparison on a timestamp or string needed an explicit type witness to satisfy the compiler — easy to get wrong and the resulting errors are generics noise rather than a clear message. Verbosity is high relative to the query being expressed.