Commit Graph

10 Commits

Author SHA1 Message Date
Michael Bayne 76c8d59c56 Let's have the exception here as well so that we know where to fix. 2009-04-14 16:17:30 +00:00
Par Winzell 859b357d7b Give Depot the ability to evaluate SQL expressions without contacting the database. This code is not yet tied into anything, but possible applications, in increasing order of amazingness:
*) 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.
2009-04-13 17:19:01 +00:00
Par Winzell 03ca344984 Don't freak out on empty In()'s, just scold the developer. 2009-04-10 18:11:13 +00:00
Par Winzell 34599bc760 Adapt Depot's full-text search capabilities for PostgreSQL 8.3. This is a fairly minimal change, excepting support for associating FullTextIndex configurations with PostgreSQL search configurations. The legacy stuff to support 8.2 is unlikely to last long. 2009-03-26 20:14:45 +00:00
Par Winzell fa7d2c0a7f 1) Broaden FullText to include ranking abilities along with matching, 2) Implement CASE WHEN ELSE END, 3) Let the people do 1 + 2 + 3 rathern 1 + (2 + 3), and so forth. 2009-03-18 19:01:20 +00:00
Michael Bayne a9c992bb44 Great big revampage: no more strings anywhere. It's all ColumnExps all the way
down (well, all the way to the public API anyway).

Revamped index creation while I was in there because that was one of the big
string users. Now you just put @Index on the field you want indexed, and if you
want a multi-column index you do things with a magical static method just like
we do for complex (function) indices.

@UniqueConstraint may still go away since it's basically exactly the same thing
as @Index(unique=true), so it's kind of pointless to support both.
2009-01-08 02:10:54 +00:00
Michael Bayne 8fec576663 Moved things that are not part of the Depot public API into an impl package.
Also moved WhereClause into depot.clause since it really wanted to be there.
2008-11-25 20:44:22 +00:00
Michael Bayne 9880ff326c A whole bunch of revampery on the way to collection caching, including some
basic stats reporting and query and cache logging.

PersistenceContext no longer sticks its nose so deeply into the business of
Query and Modifier. It just passes itself along and allows them to do any cache
activity they need during their normal execution. The one situation where we
keep our nose in their business is to allow a Query to return a result from the
cache before it is even invoked so that we can avoid requesting a database
connection if we won't ever need one.
2008-11-21 01:49:28 +00:00
Michael Bayne b32b4eecc3 Updated the source headers and added the license file. 2008-11-16 06:17:45 +00:00
Michael Bayne 745c380e8d Repackage Depot as com.samskivert.depot as it is now a standalone library.
We're also going to allow ourselves the luxury of a Google Collections
dependency.
2008-11-16 05:59:28 +00:00