Commit Graph

2355 Commits

Author SHA1 Message Date
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
samskivert 744b73cddf Let's go all the way up to Short.MAX_VALUE.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2371 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-25 16:27:43 +00:00
samskivert 90db99953d Don't try to use an IN() clause with more than 16738 entries.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2370 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-25 15:57:43 +00:00
mdb 695f3c3609 Ability to name BasicRunQueue instances, from Charlie.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2369 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-21 00:26:42 +00:00
mdb 2fcce480cd Nixed unneeded log message.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2368 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 18:17:52 +00:00
mdb 85da2e609c We surely want to not run a transition if we try to note it and discover that
another process has noted it first.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2367 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 16:45:52 +00:00
mdb 7081b141b1 Comment out imports that go with commented out code.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2366 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 16:23:22 +00:00
mdb db0eec0c1a Don't require a schema version for computed records.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2365 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 01:28:31 +00:00
mdb 1229864e8b A couple of changes:
1. Schema version is now always required. The "support" for unversioned schemas
was half-baked anyway.

2. Migration and table creation is now done in such a way that multiple
processes can start up and won't step on one another as they all try to migrate
the same schemas. Instead one will get a lock and do the migration and the
others will patiently wait.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2364 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 00:35:12 +00:00
mdb c06c9039ef Leftovers from some random testing.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2363 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 00:23:55 +00:00
mdb 0d3612377a Report a better error message if a bogus rename is attempted. Some formatting
cleanup.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2362 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-20 00:22:41 +00:00
mdb e5788bdfdd Unfiddle long lines.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2361 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-16 20:30:52 +00:00
andrzej b3317c7943 Added WeakObserverList, which allows observers to be
garbage-collected.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2360 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-09 01:36:33 +00:00
zell 91ccc5a77b PreparedStatement.setObject() does a lot of runtime type checking, so we don't have to do setShort(), setString(), etc. But we do have to convert ByteEnum's to their byte representation.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2359 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-07 06:02:41 +00:00
zell 984698e793 The PostgreSQL datatypes for float and double are REAL and DOUBLE PRECISION.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2358 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-08-07 05:45:25 +00:00