that return a collection return an XList which extends List and adds the
method:
public <R> Iterable<R> map (Function<T, R> mapper);
which allows you to do things the following:
return findAll(CategoryRecord.class,
new Where(CategoryRecord.PARENT_ID.eq(parentId))).
map(CategoryRecord.TO_CATEGORY);
which is sufficiently awesome that I think it merits taking these liberties.
Plus it opens the door to adding other transformations that one might want to
do with a collection just loaded from the database.
java.sql.Date and java.util.Date and we support custom getters and setters to
do fancier aggregate conversion (multiple persistent fields into a single
runtime field and/or creation of partially initialized runtime objects from the
available persistent data).
foolish to complicate a bunch of client code. Either we'll do some magical
optimization on the Depot side and not even send queries to the server that we
know can't match anything, or we'll just suck it up and occasionally send a
query to the database that we know will match no rows. C'est la vie.
creating common operators and expressions that don't fit nicely into the fluent
style. For example: Ops.and(expr1, expr2) is preferable to expr1.and(expr2)
and Ops.not(expr) is definitely nicer than expr.not() (which we don't even
provide).
methods for expressions. Now you can do FooRecord.BAR.eq(5) instead of new
Equals(FootRecord.BAR, 5), which also saves you the Equals import. Added
methods for operators, some are probably missing and some don't make sense.
I'll fill this out more as I discover where else this style is useful.
tidier, it's a shame that ColumnExp is named as it is because really it's a
FieldExp as it represents the name of the Java object field, not the actual
name of the column which may be something different (if you use
@Column(name="foo")). Maybe next time.
only one character more to type FooRecord.getKey(someId) than to type
FooRecord.class, someId and with the new Key.newKey() methods, you can also
create ad hoc keys briefly when needed.
initialization to not hit the database at all in the up-to-date case (after a
single query to load the versions of all known records). This is about six
hundred fewer queries than we were doing on Whirled at server startup. To be
fair, they were pretty fast queries. :)