Commit Graph

2369 Commits

Author SHA1 Message Date
samskivert f7025032c2 Missed a spot.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2429 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-15 18:46:48 +00:00
samskivert 067e4ebdb6 Name things a bit more clearly to indicate that we're manipulating field
definitions, not necessarily field overrides.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2428 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-15 18:42:12 +00:00
samskivert 58d2b7d2fe Zell reminds me that I want to use FieldDefinition rather than FieldOverride
which is meant to be used only in certain circumstances.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2427 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-15 18:37:04 +00:00
samskivert 9739e50761 Don't log a warning if we don't get a result for every primary key provided
when we're doing a query with primary keys provided by a random caller. We have
know idea where they got those keys or where they have been before we got our
filthy mitts on them.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2426 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-15 18:33:21 +00:00
samskivert bc98a28af8 We're going to allow FieldOverride on @Computed records, just not on @Computed
fields. Maybe Zell will remind me why this was disallowed, but it seems that to
disallow this is to make FieldOverride useless.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2425 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-15 18:22:18 +00:00
samskivert 610b03df80 Ah, entities.keySet() is misleading because it contains records that were found
in the cache as well as records loaded from earlier passes in cases where we
split our query up to avoid database breaking in() clause sizes. Now we track
exactly what we got this time around and report that.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2417 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-12 01:55:54 +00:00
samskivert 63f3e00279 Let's have a stack trace here because these mismatches are just plain bizarre.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2416 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-12 01:49:06 +00:00
samskivert b82bf914d9 If we're going to magically convert ByteEnum to an integer type, then we should
magically assign it a default value of 0 like we do for our other integer types.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2415 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-12 00:24:14 +00:00
samskivert 858560ca69 Nixing the savedoc target.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2414 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-11 08:16:02 +00:00
samskivert 193e2e5853 We're seeing some weirdness here, so let's log the original statement along
with the actual set of wanted and obtained keys when we have a mismatch.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2412 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-10 18:09:23 +00:00
samskivert f4ff354621 Let's log a stack trace on lazy initialization so that we can see who the
culprit is.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2411 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-10 18:01:24 +00:00
samskivert 845f1f47b6 Some invoker jockeying requested by Charlie.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2410 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-10 02:13:57 +00:00
samskivert d45da29c7b Created an explicit EntityMigration.Add for when you want to add a column to a
database and need to provide a defaultValue at the time that you add it, but
don't want to have to define a permanent default value on the field.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2409 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-10 02:00:19 +00:00
samskivert e0d3f6b2c9 Don't try to do the primary key lookup on delete for records that define no
primary key.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2408 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-08 19:01:30 +00:00
samskivert ae552d1696 Cope with the goddamned broken generics implementation in JDK 1.5.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2407 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-08 18:58:12 +00:00
samskivert 155a188da2 We need Key to export a Key.Expression which we can use inside the SQL for a
KeySet so that the "where" keyword is not repeated every time we bind a key.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2406 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-08 17:54:11 +00:00
samskivert 35c90b8926 Beans/frank.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2405 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-08 16:48:32 +00:00
samskivert 5b6d4895e8 Automatically add the shadow to our type set for @Computed(shadowOf=FooRecord)
record classes.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2404 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 02:38:20 +00:00
samskivert e1f211dc8e We need to set up our _builder in WithKeys. Also moved loadRecords() down below
loadAndResolve().


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2403 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 02:27:53 +00:00
samskivert 9ee3f47e3e Actually, if we use Key we don't need to specify the type. It's already in the
keys. So we can have loadAll(Class,Collection<Comparable>) and
loadAll(Collection<Key>) and not run into type erasure problems. Yay!


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2402 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 02:06:44 +00:00
samskivert 367e118bd5 Type jockeying.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2401 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 01:59:52 +00:00
samskivert 8972c0089e Added loadAll() which takes a collection of primary keys. Since we've already
got the primary keys, this goes right to phase two wherein we check the cache
for hits and load the remaining records by primary key (and cache them).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2400 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 01:54:08 +00:00
samskivert 4b4fccc62a Allow the cache to be explicitly bypassed.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2399 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 00:34:29 +00:00
samskivert 8d490b3b2e Be sure to report that we throw DatabaseException for documentation purposes.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2398 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 00:30:25 +00:00
samskivert 315ea2d87a Tidying.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2397 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 00:17:52 +00:00
samskivert f8fd195327 We need to use the key in our or clause, not its non-existent where expression.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2396 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-06 00:13:05 +00:00
samskivert 1066186765 Use the SelectClause to obtain our types so that the main record class is
always properly added. Also made SelectClause freak out if it's provided with
bogus clauses.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2395 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 23:17:37 +00:00
samskivert 8eeff2c670 Nixed unused import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2394 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 23:03:49 +00:00
samskivert 018f4e96d3 We need to let you express whether or not you want your keys from the master
server or if it's OK to get them from a (potentially slightly out of date)
replica. If you're going to modify rows based on the results of findAllKeys(),
you should probably get them from the master server, if you're just reading
data, you can talk to a replica.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2393 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 23:03:08 +00:00
samskivert 2d98053b6b Added findAllKeys() for when you only need the keys.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2392 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:58:05 +00:00
samskivert 8accd6b495 One more unused import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2391 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:43:38 +00:00
samskivert d37e8079a8 Unused import patrol.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2390 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:43:06 +00:00
samskivert ed70e30023 Some method ordering.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2389 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:37:23 +00:00
samskivert 4ba1d015c9 We're handling Key query construction directly instead of letting it look like
a WhereClause, so we need to add our own where.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2388 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:36:53 +00:00
samskivert 741f868cc5 PrimaryKeySet -> KeySet.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2387 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 22:16:55 +00:00
samskivert 5e68665b34 Now we don't have to provide our values as an ArrayList.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2386 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 20:07:43 +00:00
samskivert 90bf8e0e68 Ah, Key actually is PrimaryKey and does not in fact keep the primary key
columns around. Cleaned some things up along those lines.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2385 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 20:05:44 +00:00
samskivert 6ac58edef3 Formalized the two-phase "get primary keys that match an arbitrary query, then
load or modify the rows that match those keys" pattern so that we can almost
always just magically do the right thing with regard to the cache. Added a
version of deleteAll() that makes use of this.

Also nixed a bunch of checked exception tomfoolery which was almost entirely
unnecessary and now with DatabaseException is completely unnecessary.

A few things remain to be done:

- PrimaryKeySet tries to be "smart" if its passed 0 keys and use
LiteralExp("false") but that causes things to freak out because Depot then
doesn't know what primary class it's dealing with. I'm probably going to make
All and None expressions that match all and none of the records in a table
respectively.

- deleteAll() doesn't currently split its keys into chunks small enough to be
digestible by the database if we match more than 32,768 rows. I'll see if I
can't abstract out that code from FindAllQuery so that we can easily use it
everywhere. It would be cool to handle that a a lower level and allow the
WhereClause to say that it needs to be run in phases, but that would probably
complicate the crap out of the low-level code.

- I need to create PrimaryKey to go between Key and PrimaryKeySet so that we
can avoid duplicating the primary key columns thousands of times in a large
PrimaryKeySet.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2384 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 19:39:08 +00:00
samskivert af9ecae442 Added a genrecord target. Cleaned up some other bits.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2383 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 19:32:17 +00:00
samskivert c02372cad6 Export our samskivert code as a module as well.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2382 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 17:05:37 +00:00
samskivert 5facd275b1 Nix dependence on StringUtil.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2381 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 01:19:43 +00:00
samskivert 9c071fd67f Widening, removal of MessageFormat import just for the javadoc since that
breaks GWT.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2380 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 01:16:57 +00:00
samskivert 74f5e24eb1 Format tightening. Really this is just a test to see if Google will mail me my
goddamned commit diffs.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2379 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 00:42:15 +00:00
samskivert 936dfeee35 Well hell, let's just export ByteEnum to GWT.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2378 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-05 00:40:48 +00:00
samskivert 847607538c Export MessageUtil for use by GWT.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2377 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-04 23:35:09 +00:00
samskivert 1a0c3cc241 Changed Depot to throw a RuntimeException on unexpected database error instead
of a checked exception. Invariably, we don't do anything with our
PersistenceExceptions except let them percolate all the way to the top and then
log a warning. We can probably automate the process of logging a warning with
useful information and save ourselves the trouble of doing it manually
everywhere.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2376 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-03 16:10:06 +00:00
samskivert 79a466c42a Any collection of anything that extends QueryClause is generally all we need.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2375 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-09-03 00:55:07 +00:00
andrzej@threerings.net add5867c13 Checking in Ray's update to ServiceWaiter.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2374 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-28 23:08:04 +00:00
andrzej@threerings.net 403200041e Added prune method to remove collected observers from list.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2373 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-28 22:51:56 +00:00
samskivert 70476a54f5 Nixed unused import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2372 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-25 18:16:35 +00:00