Par Winzell
44fd01cc2d
Switch to nulls here, too, making migration work right for HSQLDB.
2008-12-10 23:02:34 +00:00
Par Winzell
b3cb1d6214
Cut and paste error.
2008-12-10 21:09:56 +00:00
Michael Bayne
50d31cfcc5
Unused import nixage.
2008-12-10 20:05:34 +00:00
Par Winzell
f0f08f9516
More HSQL support:
...
- HSQL doesn't have full text search, so we just OR up a bunch of LIKE conditions to catch any and all matches. This is not efficient, but it'll do just fine for things like unit tests and development work.
- HSQL doesn't have & and |, it calls them BITAND and BITOR.
- HSQL doesn't have MySQL's unix_timestamp() or a way to get an 'epoch' from a date like PostgreSQL, so we count the number of seconds since 1970-01-01. I have not investigated to make sure this is exact, but it should at least be internally consistent.
- HSQL has a very neat list of data types that (no surprise) map very well to Java types.
2008-12-09 23:26:11 +00:00
Par Winzell
96dfa3ca04
Break up the function that generates ColumnDefinitions for our fields and pass around a mutable instance of that object so as to give subclasses more freedom to do whatever weird stuff they need to to generate SQL for all the incompatible dialects out there. This is not elegant, and I feel this code along with ColumnDefinition and some of DatabaseLiaison, should pperhaps find a new home in the SQLBuilder structure.
2008-12-09 23:20:14 +00:00
Par Winzell
b9bb84d3af
Cope with the new ColumnDefinition.
2008-12-09 23:18:17 +00:00
Par Winzell
7eaaea15e7
Instead of enumerating columns for which values will be auto-generated and supplying magical DEFAULT arguments for them, simply don't include those columns in the insert.
2008-12-09 23:00:50 +00:00
Par Winzell
cc07817238
Remove an ancient TODO: Get rid of SELECT FOR UPDATE and instead locklessly claim the next available primary key value.
2008-12-09 22:56:55 +00:00
Par Winzell
817857d20e
HSQL doesn't think 'false' is a proper condition in a DELETE statement, and I suppose it has a point. This should always work.
2008-12-09 20:28:20 +00:00
Michael Bayne
14a85d0de6
Differentiate between explicit queries and decomposed queries.
2008-11-25 22:02:15 +00:00
Michael Bayne
8ab95ec10e
Unconcretification of QueryClause. I concreted it a while back when it did
...
something and then those needs went away and now it's just a marker that
differentiates arbitrary SQLExpression instances from those that represent
clauses of a query.
2008-11-25 20:53:33 +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
980be19918
Unused import pruning and other cleaning.
2008-11-25 20:14:09 +00:00
Michael Bayne
0b439978fb
Stubbed out Depot support for HSQLDB. This also doesn't work yet but will some
...
day be made to work and enable more sophisticated unit testing of Depot and
systems that use Depot.
2008-11-25 20:13:43 +00:00
Michael Bayne
bc44c4e58e
A cache adapter for testing.
2008-11-25 00:57:22 +00:00
Michael Bayne
9e2dbeb174
Finished collection caching implementation. Our databases will shortly breath a
...
great sigh of relief.
2008-11-25 00:57:04 +00:00
Michael Bayne
ae34697c8d
KeySet is going to get stuffed into the cache, so we're making it more memory
...
efficient.
Also switched from Collection to Iterable in some internal spots where we don't
need anything other than an iterator. I wanted to push this all the way out to
DepotRepository but ran into some snags. I'm leaving in this change in case I
feel like desnaggling the external bits later.
2008-11-24 22:05:04 +00:00
Michael Bayne
ae414006bc
These don't *really* override anything so we can't mark them as such as JDK 1.5
...
will do le freak out.
2008-11-21 06:30:32 +00:00
Michael Bayne
f6339978bf
Missed a spot.
2008-11-21 06:11:57 +00:00
Michael Bayne
475200849c
Extract query and record cache tracking into parent.
2008-11-21 03:19:44 +00:00
Michael Bayne
e347f4ac17
More toString()ery. Changed KeyUtil to DepotUtil so I could jam some more
...
useful stuff in it.
2008-11-21 03:15:47 +00:00
Michael Bayne
e98ad09588
If loadAll() can return its results entirely from the cache before invoke(),
...
have it do so. Down to the last couple of steps for collection caching.
2008-11-21 02:50:16 +00:00
Michael Bayne
22c086f64e
Extracted findAllKeys() query into a helper class, made it possible for Query
...
to request a read-write connection.
2008-11-21 02:30:08 +00:00
Michael Bayne
3cf711e083
More toString()s.
2008-11-21 02:04:07 +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
5f26eb28c9
Fixed sed error.
2008-11-20 00:16:57 +00:00
Michael Bayne
566ebcf7f9
Only release the connection if we didn't report it as failed.
2008-11-17 21:55:02 +00:00
Michael Bayne
1f86dbd9c4
Google Collectivised.
2008-11-16 18:31:25 +00:00
Michael Bayne
9c0dbb5b47
Fixed up packages.
2008-11-16 08:01:19 +00:00
Michael Bayne
c60181a484
We need a GWT module.
2008-11-16 07:53:22 +00:00
Michael Bayne
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.
2008-11-16 07:30:20 +00:00
Michael Bayne
b32b4eecc3
Updated the source headers and added the license file.
2008-11-16 06:17:45 +00:00
Michael Bayne
40c1480039
More tidying, added Javadoc overview.
2008-11-16 06:08:56 +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
Michael Bayne
6959383b6c
Unified Query and Modifier under Operation which cleans up some niggles in
...
PersistenceContext.
2008-11-13 23:35:12 +00:00
Par Winzell
f653e59a66
That was broken code-in-progress and not meant to be commnitted.
2008-11-05 00:19:59 +00:00
Par Winzell
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.
2008-11-05 00:18:21 +00:00
Par Winzell
bac0348951
Change these hard-coded defaults. Should also be made configurable.
2008-11-04 19:20:33 +00:00
Michael Bayne
05f499736e
Nixed unused import, commented out others that go with commented out code.
2008-11-01 05:39:27 +00:00
Michael Bayne
8ec25c5a6d
Make the 1.5 compiler happy.
2008-10-31 00:42:53 +00:00
Michael Bayne
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.
2008-10-31 00:17:36 +00:00
Michael Bayne
ec76d4d29f
Oops, avoid introducing a bug when nulls == zeros == values.length. We want to
...
return null in that case.
2008-10-24 05:18:50 +00:00
Michael Bayne
2309c490f7
Compromise on our 0 == null stance for primary key columns. See the code
...
comments for further details.
2008-10-24 05:13:28 +00:00
Michael Bayne
ba97743754
Make sure we use the up to date metadata when doing our stale column check.
2008-10-22 01:09:22 +00:00
Michael Bayne
19287550f4
More javadoc cleanup.
2008-09-30 00:23:57 +00:00
Michael Bayne
4c94296b67
Javadoc fixes.
2008-09-30 00:12:08 +00:00
Michael Bayne
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.
2008-09-25 23:40:01 +00:00
Michael Bayne
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.
2008-09-25 22:27:58 +00:00
Michael Bayne
2c9c9b47c1
Let's preserve the ability for callers with uncomplicated needs to create and
...
initialize a persistence context in one fell swoop.
2008-09-24 19:09:17 +00:00
Michael Bayne
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.
I also introduced DepotRepository.init() where database fooling around is OK.
The general idea is that you register schema migrations in your constructor and
then if you have data migrations to be done (or initialization that requires
reading things from the database), you do that in init().
2008-09-24 18:33:25 +00:00