Commit Graph

2166 Commits

Author SHA1 Message Date
mdb dc2ba271cf Updated the README for external users of the library. Switched to junit4 and a
version agnostic servlet-api.jar.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2218 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-28 20:18:12 +00:00
zell f2e59a1107 Let's note what we're doing here.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2217 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-27 16:22:46 +00:00
zell 85fe8b09c3 Fall back to the simple case: a query on a concrete record without overrides can be stripped of all JOINs and external WHERE clauses in the second pass.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2216 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-27 16:11:26 +00:00
zell f7ee27230c We can't replace the original WHERE clause while keeping the original JOINs. Unfortunately, figuring out precisely which JOINs may be safely deleted seems rather complicated. For now, trust the database to do the right thing when our second-pass query is identical to the first one, except with an additional WHERE condition that restricts the primary key columns according to the results of the first pass.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2215 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-24 16:22:27 +00:00
mdb 968a0d8f02 I'm assuming it's valid for a CachedValue to exist but have a null value as we
properly ignore those elsewhere, so we should ignore them when traversing the
cache as well.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2214 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-24 01:46:40 +00:00
mdb c672fb0184 More useful debug information.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2213 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-24 01:13:27 +00:00
mdb f0be01f851 Let's not stick a fork in things if we don't have to. This is rendering Whirled
inoperable right now, but just returning what we got would be perfectly fine.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2212 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-24 01:07:45 +00:00
zell c61110e348 Replace insane implementation with one that does not rely on the database to magically know in which order we want results returned.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2211 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 20:30:20 +00:00
mdb 5a62ad7962 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2210 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2007-08-22 18:19:40 +00:00
mdb 6e232554c1 shadowOf is never null, rather it is the default value (PersistentRecord.class)
which we should studiously ignore.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2209 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 18:03:44 +00:00
zell 652a77cd4f Yet another attempt at glorious audacity, after the realization that different kinds of clauses really do need to handle overrides differently. This should re-enable cache-friendly collection queries even on clones, which are the most complex things we do.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2208 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 17:44:06 +00:00
zell 16302a71b9 Automatically bring any shadowOf class into play without an explicit FromOverride clause. This needs some more thought.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2207 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 17:40:48 +00:00
zell 5b22ae2d69 Even in load() we can be without a where clause, for e.g. loading a count(*) style record.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2206 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 17:18:15 +00:00
zell 3bc33872c5 If we declare an entity-level @Computed(shadowOf=...) then use that class as the default FROM table, duh.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2205 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 05:55:57 +00:00
mdb 0be54aa3ae Hack in a default value for integer types so that Postgres doesn't freak out
when we add a new non-null integer column. Maybe we should just specify default
values for all our integer columns, but decades of programming history point
toward zero as a pretty sensible default.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2204 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 02:40:44 +00:00
mdb ed88407fe9 Don't depend on MySQL TIMESTAMP column behavior.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2203 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-22 02:28:06 +00:00
zell b97e3c20d3 Break a much gentler FieldDefinition out of FieldOverride. The former *must* be supplied for any computed field; the latter must *only* be supplied for fields that would otherwise reference concrete columns. This lets us be more intelligent about what we expand where. Also bring back the old semi-conservative selection criterion for two-pass cache-happy collection queries; it gets simply too hairy when parts of an object's primary key comes from a separate table.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2202 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-21 23:11:14 +00:00
mdb 7434384261 Small formatting tweaks.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2201 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-21 21:40:31 +00:00
mdb d31d988945 Note our transition before we apply it so that multiple processes don't run the
same transition and then all note that they ran it.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2200 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-21 21:39:28 +00:00
zell 2a9afb6bc5 Turn off field overrides when evaluating a join condition. This is all getting hairy -- sometimes you want FooRecord.BAR_C to point to the field 'under' the override, sometimes you want the actual overide expression. Hrm. Michael feels we probably shouldn't do any field expansion magic past the FROM clause. I am hoping we can preserve some of it in some intuitive way. This is a stop gap measure.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2199 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-21 19:06:55 +00:00
zell aec84a3432 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2198 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2007-08-21 15:07:07 +00:00
zell b3886e92fe Generalize the automatic key value generation code so that it works on any column, and on any number of columns within a record.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2197 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-21 15:02:12 +00:00
zell 795e6d9536 Let's explain that a bit more hands-on
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2196 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-20 18:54:40 +00:00
zell 3e9da62572 Fully respect the complexities of persistent records whenever we expand field references in a query. For example, a WHERE clause that operates on a field that's been overridden will correctly use the override. This is much more complicated than what we had before (which was fundamentally broken in its own way) so this patch could introduce strange behaviour. Please be on the lookout for SQL errors in your logs and/or data fields showing unexpected values.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2195 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-20 18:35:43 +00:00
zell 1e9c4df219 Roll back 2192 with comment.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2194 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-17 22:24:37 +00:00
zell 51daf9237a git-svn-id: https://samskivert.googlecode.com/svn/trunk@2193 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2007-08-16 20:26:12 +00:00
zell a41f50cba5 Another place where it's safest to be explicit about whence the column comes.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2192 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-16 20:24:15 +00:00
zell 0ac1b1cf46 We have to carefully convert the user's query input to the boolean lexeme language TO_TSQUERY() expects. We may ultimately have to do more complicated things here, too.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2191 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-16 16:54:52 +00:00
mdb bfc74d92ea Column migration in Postgres is more complicated. There may be other things
than nullability that will fuck us in the future, but this'll do for now.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2190 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 23:35:20 +00:00
zell 2ef61dbe17 Add the primary key on columns, not fields.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2189 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 22:18:54 +00:00
mdb 2a96e97d2c Let's not force validation on every Tom, Dick and Harry. This is a little
verbose, so maybe I'll change my mind again later and do something yet again
different.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2188 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 19:47:16 +00:00
mdb 242781749a More sanity checking.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2187 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 19:03:47 +00:00
mdb c904aa1917 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2186 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2007-08-15 19:00:50 +00:00
mdb 07cdffa7cd Added some sanity checks to notice and catch programmer errors as early as
possible.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2185 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 18:44:35 +00:00
mdb 3c8b020d6c If a persistent record is abstract, do not generate ColumnExp() constants for
it; if it extends another record, generate ColumnExp() constants for persistent
fields inherited from its parents.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2184 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 02:39:42 +00:00
mdb 5b5ffd38ea Make sure the record in question is not computed.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2183 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-15 01:16:02 +00:00
mdb 83acd3d195 The logging output already contains the enclosing method name. So instead of
repeating the method name:

2007/08/14 16:07:52:157 INFO PersistenceContext.cacheStore: cacheStore: entry [key=...

we'll just say what we're doing:

2007/08/14 16:07:52:157 INFO PersistenceContext.cacheStore: storing [key=...


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2182 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 23:18:22 +00:00
mdb 252b417c9a Brevify our toString() output so that cache debug logging is readable.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2181 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 23:15:08 +00:00
mdb 364dbdaec0 Return the string value of our cached value as our own.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2180 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 23:12:53 +00:00
mdb ff56b6afa5 Add a mechanism for warning about records that are lazily initialized after an
attempt has been made to resolve all registered records.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2179 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 21:35:38 +00:00
mdb 5383d20418 Use IllegalArgumentException since those are basically illegal arguments. Also
use @exception because it's a nice way to let humans and tools know what's
going on.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2178 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 18:47:21 +00:00
mdb 23178d285a "List to Array to List to Set" becomes "to Set".
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2177 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 18:37:40 +00:00
zell 20e8de4702 Tighten up a few places where we return null to callers who really never want to see nulls -- throw exceptions instead.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2176 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 17:40:00 +00:00
zell d5b0b3ddcb Add dialect-agnostic auto-migration of full text indexes.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2175 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 17:00:26 +00:00
zell b2ea629149 Log the creation of a full text search index on the MySQL side.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2174 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 16:09:23 +00:00
zell c0a5cb690d Better comments explaining the hairiest bits of auto-migration.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2173 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 15:41:36 +00:00
mdb 86ed2e59b1 Tidied up SQL execution in liaisons; fixed MySQL column renaming.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2172 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-14 01:11:09 +00:00
zell 510955aa81 Remember the test.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2171 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-13 23:02:40 +00:00
zell 87d1cb6a6e Rename @Index(columns) to @Index(fields) and do the proper translation to column name during table creation / migration.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2170 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-13 22:57:09 +00:00
mdb bc41237e00 Classes go after methods.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2169 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-08-13 21:59:25 +00:00