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. :)
*) We do not currently invalidate cached keysets even when we know for a fact that the associated records have changed (and exactly how they've changed). By storing along with each cached keyset the query datastructure that was used to fetch the keys, we can use the SQLExpression evaluator to do a secondary invalidation sweep over the records when they're requested and make sure they still match the WHERE clause of the original query. If they don't, we toss'em from the cached keyset. This basically means we can trust our cached keysets much more and increase the amount of time we keep them around in the cache.
*) Extending the first idea, we can do more than lazily invalidate parts of cached collections. We can, in fact, automatically adjust every relevant cached collection each time a record is deleted, inserted or modified. In theory, we could guarantee perpetual veracity of all cached collection queries. It's not a given that this is in every way a good idea, but it's a very interesting one to investigate.
As part of this change, ExpressionVisitor methods have to return a value. Slightly less elegant, but of greater general utility.