0fc1d68bbe
Fixed up svn:keywords property.
Michael Bayne
2008-11-16 08:03:33 +00:00
9c0dbb5b47
Fixed up packages.
Michael Bayne
2008-11-16 08:01:19 +00:00
c60181a484
We need a GWT module.
Michael Bayne
2008-11-16 07:53:22 +00:00
50053f5282
Oh boy, we have to build a GWT source jar file.
Michael Bayne
2008-11-16 07:34:30 +00:00
7a23a6bd49
Copy the tests over. I couldn't migrate these with the rest of the SVN migration because svndumpfilter is a royal pain in my ass.
Michael Bayne
2008-11-16 07:30:20 +00:00
711fd44911
No longer needed.
Michael Bayne
2008-11-16 06:55:13 +00:00
601a15c00f
Added snapshot target.
Michael Bayne
2008-11-16 06:49:09 +00:00
b32b4eecc3
Updated the source headers and added the license file.
Michael Bayne
2008-11-16 06:17:45 +00:00
b9604c2d56
Ignore the jar dependencies we keep in here.
Michael Bayne
2008-11-16 06:09:33 +00:00
40c1480039
More tidying, added Javadoc overview.
Michael Bayne
2008-11-16 06:08:56 +00:00
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.
Michael Bayne
2008-11-16 05:59:28 +00:00
6959383b6c
Unified Query and Modifier under Operation which cleans up some niggles in PersistenceContext.
Michael Bayne
2008-11-13 23:35:12 +00:00
f653e59a66
That was broken code-in-progress and not meant to be commnitted.
Par Winzell
2008-11-05 00:19:59 +00:00
49391b1995
When we reinitialize the Throttle with a smaller number of allowed operations within a time period, we should preserve the oldest rather than the newest ones, or we'll most likely be in immediate and unfair violation of the limit.
Par Winzell
2008-11-05 00:18:21 +00:00
bac0348951
Change these hard-coded defaults. Should also be made configurable.
Par Winzell
2008-11-04 19:20:33 +00:00
05f499736e
Nixed unused import, commented out others that go with commented out code.
Michael Bayne
2008-11-01 05:39:27 +00:00
8ec25c5a6d
Make the 1.5 compiler happy.
Michael Bayne
2008-10-31 00:42:53 +00:00
2b8bc0c97f
When we can switch entirely to 1.6 we can use Postgres's value = any(?::int[]) form to pass as many damned keys we want in a giant array. At that time we can nix all the >32,768 key fiddly business.
Michael Bayne
2008-10-31 00:17:36 +00:00
ec76d4d29f
Oops, avoid introducing a bug when nulls == zeros == values.length. We want to return null in that case.
Michael Bayne
2008-10-24 05:18:50 +00:00
2309c490f7
Compromise on our 0 == null stance for primary key columns. See the code comments for further details.
Michael Bayne
2008-10-24 05:13:28 +00:00
ba97743754
Make sure we use the up to date metadata when doing our stale column check.
Michael Bayne
2008-10-22 01:09:22 +00:00
19287550f4
More javadoc cleanup.
Michael Bayne
2008-09-30 00:23:57 +00:00
4c94296b67
Javadoc fixes.
Michael Bayne
2008-09-30 00:12:08 +00:00
fee6be6c2d
Added support for data migrations, which are run after all schema migrations have been run and are also coordinated between disparate processes by an in-database lock system.
Michael Bayne
2008-09-25 23:40:01 +00:00
2b21105dc1
Call EntityMigration SchemaMigration because that's what it's for and I want to add a new DataMigration mechanism so that people can stop using schema migrations to do data migration.
Michael Bayne
2008-09-25 22:27:58 +00:00
2c9c9b47c1
Let's preserve the ability for callers with uncomplicated needs to create and initialize a persistence context in one fell swoop.
Michael Bayne
2008-09-24 19:09:17 +00:00
0e68c8a599
Change the way initialization is handled (a bit). It is now possible to create a PersistenceContext and give it out to all of your repositories and delay activating the context until you are ready for everyone to start talking to the database. In this way you can enforce that no one does any database fooling around before it's OK.
Michael Bayne
2008-09-24 18:33:25 +00:00
81c25ae4f1
Properly handle int[] fields when encountered as unassociated values. We already do the right thing when we process them as fields of persistent records.
Michael Bayne
2008-09-23 17:18:23 +00:00
f33a376f7e
Formatting tweaks.
Michael Bayne
2008-09-23 17:17:05 +00:00
d7f864dfe4
Don't try to manage the cache manager. Push that burden out to the caller who may have their own needs and arrangements.
Michael Bayne
2008-09-20 03:30:49 +00:00
3e8ac68af6
Properly handle @GeneratedValue(strategy=GenerationType.IDENTITY, initialValue=N) for non-zero values of N. This is complicated. Depot used to "initialize" value generators pretty much every time a table schema was migrated. For TableValueGenerator it could just NOOP if the proper row was in the sequence table. IdentityValueGenerator was just broken and ignored any request to configure an initialValue, so it never did anything.
Michael Bayne
2008-09-17 19:09:08 +00:00
5ac15a99ca
Use varying size blobs for int[] columns like we do byte[].
Michael Bayne
2008-09-16 22:51:59 +00:00
b64658fd83
Handle conversion from int[] to byte[] manually rather than relying on the JDBC driver to know how to do it.
Michael Bayne
2008-09-16 22:49:11 +00:00
9112b3c7e2
Javadoc fix from Dave.
Michael Bayne
2008-09-16 21:54:21 +00:00
84dd3c6b5f
Amazingly, we had apparently never tried to insert a preconfigured row into a table that had field generators on its primary key. The code just blindly overwrite the supplied primary key and ran the generators anyway.
Michael Bayne
2008-09-16 21:33:22 +00:00
e25aa25bd6
Nixed unused imports.
Michael Bayne
2008-09-16 02:01:19 +00:00
2b1b2e8334
Missed a spot.
Michael Bayne
2008-09-15 18:46:48 +00:00
759fb587dc
Name things a bit more clearly to indicate that we're manipulating field definitions, not necessarily field overrides.
Michael Bayne
2008-09-15 18:42:12 +00:00
a507308c2b
Zell reminds me that I want to use FieldDefinition rather than FieldOverride which is meant to be used only in certain circumstances.
Michael Bayne
2008-09-15 18:37:04 +00:00
7e8c7fadcb
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.
Michael Bayne
2008-09-15 18:33:21 +00:00
2f57697c32
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.
Michael Bayne
2008-09-15 18:22:18 +00:00
98ac644ad9
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.
Michael Bayne
2008-09-12 01:55:54 +00:00
2611a1076b
Let's have a stack trace here because these mismatches are just plain bizarre.
Michael Bayne
2008-09-12 01:49:06 +00:00
d47e85fe9f
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.
Michael Bayne
2008-09-12 00:24:14 +00:00
96bd8b56a0
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.
Michael Bayne
2008-09-10 18:09:23 +00:00
27b619d59b
Let's log a stack trace on lazy initialization so that we can see who the culprit is.
Michael Bayne
2008-09-10 18:01:24 +00:00
c4ddf1853c
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.
Michael Bayne
2008-09-10 02:00:19 +00:00
00d6ae5492
Don't try to do the primary key lookup on delete for records that define no primary key.
Michael Bayne
2008-09-08 19:01:30 +00:00
ffeb6534c4
Cope with the goddamned broken generics implementation in JDK 1.5.
Michael Bayne
2008-09-08 18:58:12 +00:00
f1dd34e4b3
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.
Michael Bayne
2008-09-08 17:54:11 +00:00
56c4394b29
Beans/frank.
Michael Bayne
2008-09-08 16:48:32 +00:00
d5619a3b28
Automatically add the shadow to our type set for @Computed(shadowOf=FooRecord) record classes.
Michael Bayne
2008-09-06 02:38:20 +00:00
9a7a78080c
We need to set up our _builder in WithKeys. Also moved loadRecords() down below loadAndResolve().
Michael Bayne
2008-09-06 02:27:53 +00:00
2f335c4dc8
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!
Michael Bayne
2008-09-06 02:06:44 +00:00
9a21071c82
Type jockeying.
Michael Bayne
2008-09-06 01:59:52 +00:00
35f654a8c1
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).
Michael Bayne
2008-09-06 01:54:08 +00:00
52de64001d
Allow the cache to be explicitly bypassed.
Michael Bayne
2008-09-06 00:34:29 +00:00
089706427e
Be sure to report that we throw DatabaseException for documentation purposes.
Michael Bayne
2008-09-06 00:30:25 +00:00
fe1aff3842
Tidying.
Michael Bayne
2008-09-06 00:17:52 +00:00
84c32cc5e3
We need to use the key in our or clause, not its non-existent where expression.
Michael Bayne
2008-09-06 00:13:05 +00:00
263529c929
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.
Michael Bayne
2008-09-05 23:17:37 +00:00
8b6f575af8
Nixed unused import.
Michael Bayne
2008-09-05 23:03:49 +00:00
ae9e0acef8
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.
Michael Bayne
2008-09-05 23:03:08 +00:00
2e4decf18a
Added findAllKeys() for when you only need the keys.
Michael Bayne
2008-09-05 22:58:05 +00:00
95d316d28e
One more unused import.
Michael Bayne
2008-09-05 22:43:38 +00:00
709a6ce203
Unused import patrol.
Michael Bayne
2008-09-05 22:43:06 +00:00
cd8184f34f
Some method ordering.
Michael Bayne
2008-09-05 22:37:23 +00:00
fb64881c82
We're handling Key query construction directly instead of letting it look like a WhereClause, so we need to add our own where.
Michael Bayne
2008-09-05 22:36:53 +00:00
4c41561f0f
PrimaryKeySet -> KeySet.
Michael Bayne
2008-09-05 22:16:55 +00:00
249f4a5106
Now we don't have to provide our values as an ArrayList.
Michael Bayne
2008-09-05 20:07:43 +00:00
4bcfda861d
Ah, Key actually is PrimaryKey and does not in fact keep the primary key columns around. Cleaned some things up along those lines.
Michael Bayne
2008-09-05 20:05:44 +00:00
84622e56c7
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.
Michael Bayne
2008-09-05 19:39:08 +00:00
67bdfda3fe
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.
Michael Bayne
2008-09-03 16:10:06 +00:00
2fd131c0d2
Any collection of anything that extends QueryClause is generally all we need.
Michael Bayne
2008-09-03 00:55:07 +00:00
beef018b03
Nixed unused import.
Michael Bayne
2008-08-25 18:16:35 +00:00
43e1a38703
Let's go all the way up to Short.MAX_VALUE.
Michael Bayne
2008-08-25 16:27:43 +00:00
d54c633401
Don't try to use an IN() clause with more than 16738 entries.
Michael Bayne
2008-08-25 15:57:43 +00:00
01962836f7
Nixed unneeded log message.
Michael Bayne
2008-08-20 18:17:52 +00:00
8dec5386f2
Don't require a schema version for computed records.
Michael Bayne
2008-08-20 01:28:31 +00:00
a670beb665
A couple of changes:
Michael Bayne
2008-08-20 00:35:12 +00:00
64d186d08b
Report a better error message if a bogus rename is attempted. Some formatting cleanup.
Michael Bayne
2008-08-20 00:22:41 +00:00
22fb614f34
Unfiddle long lines.
Michael Bayne
2008-08-16 20:30:52 +00:00
338bb62d9f
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.
Par Winzell
2008-08-07 06:02:41 +00:00
86f3b1e293
The PostgreSQL datatypes for float and double are REAL and DOUBLE PRECISION.
Par Winzell
2008-08-07 05:45:25 +00:00
a48c93be4a
From Dave: a bunch of @Override annotating and some other cleanup.
Michael Bayne
2008-08-06 12:59:06 +00:00
a0731b34c1
Trimmed trailing whitespace.
Michael Bayne
2008-08-04 12:37:23 +00:00
f07694895e
Fixed some bogus null checks and assignments.
Michael Bayne
2008-08-04 00:49:37 +00:00
8f2cf98c17
Le metric crapload of generics cleanup.
Michael Bayne
2008-07-30 13:53:24 +00:00
4e002054e4
Unused import pruning.
Michael Bayne
2008-07-26 20:14:38 +00:00
e3adfea99e
Handle SEQUENCE strategies, which are not yet implemented. This'll fix David Hoover's super-strict compilation urges, besides being a generally good idea.
Par Winzell
2008-07-21 19:36:47 +00:00
eac0e214ef
Always do a (potentially distributed) cache remove on invalidation, regardless of what's in the local cache. From Kyle Sampson.
Par Winzell
2008-07-17 12:16:39 +00:00
8f1b3ad8b0
Ray Greenwell
2008-07-15 00:03:10 +00:00
33e159047d
Use new logging shim.
Michael Bayne
2008-05-27 18:40:39 +00:00
c16003177d
Ray Greenwell
2008-05-19 18:32:58 +00:00
7e93da6fc0
Ray Greenwell
2008-05-16 03:20:27 +00:00
195fabe2cc
We need parens so that operators are evaluated in the right order. This adds extra params around a bunch of things. I'll let the gods of Depot sort that out.
Ray Greenwell
2008-05-16 02:10:07 +00:00
31b886aed2
Michael Bayne
2008-04-25 18:32:44 +00:00
4eb7d9ecd3
Pass -Dcom.samskivert.jdbc.depot.debug=true to have Depot log queries before they are executed.
Michael Bayne
2008-04-23 23:29:07 +00:00
513ce9aa60
Yank our nomenclature into consistency -- indices, not indexes; fields(), not fieldNames(), as per Ray's suggestion.
Par Winzell
2008-04-14 20:18:45 +00:00
13121249cb
The query is in no way guaranteed to uniquely keyed rows, so let's stuff the result into a Set. We should probably add the 'unique' modifier to the actual query, but that requires a bit more cross-dialect-and-version research than I'm willing to give it just now.
Par Winzell
2008-04-06 14:57:14 +00:00