Commit Graph

  • f8480b1f5b Update the copyright year. Par Winzell 2009-04-29 18:41:10 +00:00
  • 259da94d3f Wrapped some long lines, nixed unwanted blankness. Michael Bayne 2009-04-29 17:01:03 +00:00
  • 273b0b8fd0 Handle ByteEnums. Not actually tested. Par Winzell 2009-04-29 16:22:37 +00:00
  • 27b108b0c4 Overrides, from David Hoover (belatedly): 'Also nukes trailing whitespace, foreaches a couple loops and varags one thing that leapt out at me while i was skimming it.' Par Winzell 2009-04-29 16:17:39 +00:00
  • 95212f57e2 Added as(). Michael Bayne 2009-04-28 06:27:04 +00:00
  • 825b15d5f7 Driver wants 'varchar' not 'character varying'. For future reference, these mappings seem to be in appendix B of the JDBC specification. Michael Bayne 2009-04-27 22:48:14 +00:00
  • cbde87c6a2 Detect our type based on the first element of the array rather than the type of the array which may be Comparable[] or Object[] and therefore not informative. Michael Bayne 2009-04-27 22:42:23 +00:00
  • 5a1dfdc306 I should be shot for writing this code originally. I can hardly think of a place where the exception is more important to see. Par Winzell 2009-04-27 21:58:31 +00:00
  • 262ef317ad Remove confusing and pointless incrementing. Par Winzell 2009-04-27 21:21:50 +00:00
  • 9bb640f334 Detect our JDBC major version when starting Depot. If we are using JDBC4 then use JDBC4's array support when doing In() clauses for Postgres. Michael Bayne 2009-04-27 19:45:07 +00:00
  • d2e1ea6eda We need the connection during the binding step for Postgres array machinations. Michael Bayne 2009-04-27 18:06:55 +00:00
  • 1468275c18 Patch from Charlie to update to Google Collect rc1. Michael Bayne 2009-04-24 23:19:18 +00:00
  • ae2f7316f6 Oops. Can't do that. Michael Bayne 2009-04-17 22:58:39 +00:00
  • 02d782e7e5 Allow 1.6 source but continue to target 1.5 bytecode. Michael Bayne 2009-04-17 22:50:54 +00:00
  • 76c8d59c56 Let's have the exception here as well so that we know where to fix. Michael Bayne 2009-04-14 16:17:30 +00:00
  • 093387b603 Oops. We can't use Java 1.6 stuff in Depot (yet). Thanks Mr. Hoover. Par Winzell 2009-04-13 18:15:36 +00:00
  • 44789e36ee Pointer equality between Doubles does not seem like a good idea. Par Winzell 2009-04-13 17:28:37 +00:00
  • d860091612 Forgot the main evaluator class in the previous commit. Hee. Par Winzell 2009-04-13 17:27:51 +00:00
  • 859b357d7b Give Depot the ability to evaluate SQL expressions without contacting the database. This code is not yet tied into anything, but possible applications, in increasing order of amazingness: Par Winzell 2009-04-13 17:19:01 +00:00
  • b8ac3750eb The MultiKey is a lot of complicated code to optimize an obscure situation. I know it's obscure because there's not a single use of this class anywhere that I can find. Par Winzell 2009-04-13 15:56:00 +00:00
  • 03ca344984 Don't freak out on empty In()'s, just scold the developer. Par Winzell 2009-04-10 18:11:13 +00:00
  • a4dc9860de Fix index creation for MySQL. Par Winzell 2009-04-08 18:52:08 +00:00
  • 9df2415678 There was never a good reason to do the SQL parameter binding as a second ExpressionVisitor recursion, and duplicating the logic structures for each visitor was getting increasingly cumbersome. Just encapsulate the binding actions and list'em up as we generate the SQL, then just iterate over them simple-like in the second pass. This permanently gets rid of anything BindVisitorish. Par Winzell 2009-04-01 05:48:11 +00:00
  • b2bd4b51f7 Oops. We were not taking the size of the matched-against column into account at all. That's not intuitive. The more precise the match, the higher we want to rank it. Par Winzell 2009-03-29 19:55:24 +00:00
  • 34599bc760 Adapt Depot's full-text search capabilities for PostgreSQL 8.3. This is a fairly minimal change, excepting support for associating FullTextIndex configurations with PostgreSQL search configurations. The legacy stuff to support 8.2 is unlikely to last long. Par Winzell 2009-03-26 20:14:45 +00:00
  • 51e43b6545 Fix bug that was adding extra commas for non-required computed columns. Andrzej Kapolka 2009-03-25 00:11:55 +00:00
  • 398164f2df Changed some Thread.dumpStack() calls into stack traces properly logged via the logging system. Michael Bayne 2009-03-24 18:49:03 +00:00
  • e62608a69f Let's make sure the overriding subclasses have something to override. Java 6 hid this from me. Par Winzell 2009-03-18 19:21:56 +00:00
  • fa7d2c0a7f 1) Broaden FullText to include ranking abilities along with matching, 2) Implement CASE WHEN ELSE END, 3) Let the people do 1 + 2 + 3 rathern 1 + (2 + 3), and so forth. Par Winzell 2009-03-18 19:01:20 +00:00
  • 830e830100 Nixed these two updatePartial() convenience methods because they are dangerous. The "key" (which identifies the rows you want to change) was [ColumnExp, Comparable, ...] and the data that you would be changing was [ColumnExp, Object]. So if you happened to pass a comparable object as the first value you wanted to change, say: Michael Bayne 2009-03-10 23:30:36 +00:00
  • a9dc596d3e Javadoc fixes, make deleteAll() do the right thing if you pass a KeySet into the WhereClause-only version. Michael Bayne 2009-03-03 23:40:55 +00:00
  • bb510ca506 Allow for distinguishing long-term caching from brief caching. For example, a public list of high scores may well lag 5 minutes behind database updates, whereas responses in a forum thread should perhaps never be more than 10 seconds out of date. The exact numbers are up to to the ehcache.xml configuration. Par Winzell 2009-02-06 16:09:10 +00:00
  • ce03952b3c Javadoc fix, unused import nix. Michael Bayne 2009-02-03 01:46:29 +00:00
  • db3dd861f4 Lose the spammy debug logging, collect some histogram information instead. These are not currently hooked up to Depot's Stat mechanism. Par Winzell 2009-02-02 18:14:26 +00:00
  • 3b65bc9b01 The 50 ms warning triggers every couple of thousand stores for a relatively large cache, usually with times in the 60-70 ms range which is certainly acceptable as long as they're that rare. Let's bump it to 100 ms since we're still on guard for gremlins. Par Winzell 2009-01-29 16:38:52 +00:00
  • efb2799167 Let's accept ColumnExp's or Strings for field identifiers and handle SQLExpression field values too. Par Winzell 2009-01-28 18:32:42 +00:00
  • 495399fc66 A little more information in our paranoid logging. Par Winzell 2009-01-28 05:54:23 +00:00
  • 4cab181df0 We'll use a ConcurrentHashMap for the bin, and then the enumerator will make a copy of it for returning. Par Winzell 2009-01-26 22:20:48 +00:00
  • 5a93e48e4d Oops. Let's actually wire these guys up... Par Winzell 2009-01-25 00:16:09 +00:00
  • bbcf7c8607 Don't try to build the old EHCacheAdapter either, if we don't have ehcache. Par Winzell 2009-01-24 23:26:46 +00:00
  • 9119cc9313 Update the test too. Par Winzell 2009-01-24 23:11:46 +00:00
  • 9e41b41994 Bring back the old EHCacheAdapter for transitional use until we can figure out what's up with the new one. Also, the enumeration API changed again. Par Winzell 2009-01-24 22:54:03 +00:00
  • 918405ec02 While investigating problems, add much paranoid profiling. Also let's do an explicit keyset copy during enumeration rather than the fancy concurrent hashmaps and iterable mappings. Finally, let's fully synchronize the other maps we're using. Par Winzell 2009-01-24 18:53:42 +00:00
  • db33c89b66 Get rid of some awful debug bits. Par Winzell 2009-01-23 19:51:12 +00:00
  • fc52b277a3 The CacheAdapter interface has changed: * No more CacheBins, operations happen directly on the adapter. * Each cache write must supply a CacheCategory value that identifies its type. Current values are RECORD, KEYSET and RESULT. We will probably need a MISC or USER or something along those lines, too. Par Winzell 2009-01-23 16:12:11 +00:00
  • 07d848a3a0 Oops, we need to replicate what Depot does elsewhere to construct a database-unique identifier for the index. Par Winzell 2009-01-23 15:17:51 +00:00
  • c654606a2d Add a convenience migration for dropping indexes. Par Winzell 2009-01-23 15:05:08 +00:00
  • 0569f8f8ff The buildIndex() magic expects an array of colums, not a list. Par Winzell 2009-01-22 16:43:21 +00:00
  • 7dbc58d426 Function and Literal expressions can be non-deterministic but in most cases they are safe, and giving them proper toString()'s will help caching quite a bit. Par Winzell 2009-01-21 21:39:48 +00:00
  • 017d9242ac Better log message. Par Winzell 2009-01-12 15:13:34 +00:00
  • 062a8efcac Let the EHCache adapter be a little more configurable. Par Winzell 2009-01-10 01:47:11 +00:00
  • a5de1295f9 Let the EHCache adapter be a little more configurable. Par Winzell 2009-01-10 01:46:50 +00:00
  • a8b3e24e87 Allow caching to be skipped for single record loads, ensure that we don't cache DepotMigrationHistoryRecord. Michael Bayne 2009-01-09 21:40:30 +00:00
  • c46535cffd Nixed unused imports, variables. Michael Bayne 2009-01-08 22:15:46 +00:00
  • 53358e74c9 Nixed unused import. Michael Bayne 2009-01-08 22:08:35 +00:00
  • 60c681ff74 Introduce a new cache strategy that does collection queries in two stages, but does not cache the keyset. This is a safe strategy, and we use it in places where an out-of-date result set is dangerous or annoying. Par Winzell 2009-01-08 18:22:40 +00:00
  • 87b547743c Moved some implemention detail clauses into impl.claus. I'd like to move SelectClause in there as well, but peskily two things on MSOY are using it to do subselects. I'd prefer there was some less "reaching into the internals" way to do subselects. Michael Bayne 2009-01-08 02:31:28 +00:00
  • a9c992bb44 Great big revampage: no more strings anywhere. It's all ColumnExps all the way down (well, all the way to the public API anyway). Michael Bayne 2009-01-08 02:10:54 +00:00
  • a66f15e355 Minor edits. Michael Bayne 2009-01-07 19:36:43 +00:00
  • f5fc65f1e1 More cache configuration options for findAll(), especially a new CONTENTS strategy which will cache the entire result set of the supplied query, without the restrictions of the KEYS approach. This is very lovely and perhaps a little scary. Par Winzell 2009-01-07 19:32:24 +00:00
  • 269a3ffb92 Let's make this an insertion-ordered set so that all logically identical queries get assigned table abbreviations in the same order. This is mostly cosmetic, but has no significant cost. Par Winzell 2009-01-01 17:10:34 +00:00
  • 68aac7fd11 Progress notification during migration soothes the soul. Par Winzell 2009-01-01 15:47:42 +00:00
  • c41534c7e6 We need these two fellows for the previous patch to make sense. Par Winzell 2008-12-31 00:59:28 +00:00
  • 0ccd8bdb82 Extend our Index annotation to accept a 'complex' attribute. If an index ixFoo is marked complex for a given record, Depot will call the static method ixFooDefinition on that record class and expect a List<Tuple<SQLExpression, OrderBy.Order>> return value. Par Winzell 2008-12-31 00:25:29 +00:00
  • e3aed39330 Document our thrown exceptions. Michael Bayne 2008-12-16 00:00:52 +00:00
  • 44fd01cc2d Switch to nulls here, too, making migration work right for HSQLDB. Par Winzell 2008-12-10 23:02:34 +00:00
  • b3cb1d6214 Cut and paste error. Par Winzell 2008-12-10 21:09:56 +00:00
  • 50d31cfcc5 Unused import nixage. Michael Bayne 2008-12-10 20:05:34 +00:00
  • 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. Par Winzell 2008-12-09 23:26:11 +00:00
  • 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. Par Winzell 2008-12-09 23:20:14 +00:00
  • b9bb84d3af Cope with the new ColumnDefinition. Par Winzell 2008-12-09 23:18:17 +00:00
  • 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. Par Winzell 2008-12-09 23:00:50 +00:00
  • cc07817238 Remove an ancient TODO: Get rid of SELECT FOR UPDATE and instead locklessly claim the next available primary key value. Par Winzell 2008-12-09 22:56:55 +00:00
  • 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. Par Winzell 2008-12-09 20:28:20 +00:00
  • 76268a7fb1 This should have been deleted. Michael Bayne 2008-12-01 18:17:14 +00:00
  • 14a85d0de6 Differentiate between explicit queries and decomposed queries. Michael Bayne 2008-11-25 22:02:15 +00:00
  • 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. Michael Bayne 2008-11-25 20:53:33 +00:00
  • 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. Michael Bayne 2008-11-25 20:44:22 +00:00
  • 980be19918 Unused import pruning and other cleaning. Michael Bayne 2008-11-25 20:14:09 +00:00
  • 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. Michael Bayne 2008-11-25 20:13:43 +00:00
  • bc44c4e58e A cache adapter for testing. Michael Bayne 2008-11-25 00:57:22 +00:00
  • 9e2dbeb174 Finished collection caching implementation. Our databases will shortly breath a great sigh of relief. Michael Bayne 2008-11-25 00:57:04 +00:00
  • ae34697c8d KeySet is going to get stuffed into the cache, so we're making it more memory efficient. Michael Bayne 2008-11-24 22:05:04 +00:00
  • ae414006bc These don't *really* override anything so we can't mark them as such as JDK 1.5 will do le freak out. Michael Bayne 2008-11-21 06:30:32 +00:00
  • f6339978bf Missed a spot. Michael Bayne 2008-11-21 06:11:57 +00:00
  • 475200849c Extract query and record cache tracking into parent. Michael Bayne 2008-11-21 03:19:44 +00:00
  • e347f4ac17 More toString()ery. Changed KeyUtil to DepotUtil so I could jam some more useful stuff in it. Michael Bayne 2008-11-21 03:15:47 +00:00
  • 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. Michael Bayne 2008-11-21 02:50:16 +00:00
  • 22c086f64e Extracted findAllKeys() query into a helper class, made it possible for Query to request a read-write connection. Michael Bayne 2008-11-21 02:30:08 +00:00
  • 3cf711e083 More toString()s. Michael Bayne 2008-11-21 02:04:07 +00:00
  • 9880ff326c A whole bunch of revampery on the way to collection caching, including some basic stats reporting and query and cache logging. Michael Bayne 2008-11-21 01:49:28 +00:00
  • 5f26eb28c9 Fixed sed error. Michael Bayne 2008-11-20 00:16:57 +00:00
  • 22a3c138b7 We need our template files as well. Michael Bayne 2008-11-20 00:13:21 +00:00
  • c4eb78e0b8 Use the correct variable name. Michael Bayne 2008-11-20 00:10:15 +00:00
  • 566ebcf7f9 Only release the connection if we didn't report it as failed. Michael Bayne 2008-11-17 21:55:02 +00:00
  • 42aa622551 Added README and build target descriptions. Michael Bayne 2008-11-17 19:10:33 +00:00
  • ceafda9f83 We need google-collect.jar. Michael Bayne 2008-11-17 18:47:46 +00:00
  • 76aa7f2cef Tell Eclipse about our dependency on samskivert. Michael Bayne 2008-11-17 18:43:30 +00:00
  • bc30c2061c Some Eclipse bits. Michael Bayne 2008-11-17 18:41:06 +00:00
  • 1f86dbd9c4 Google Collectivised. Michael Bayne 2008-11-16 18:31:25 +00:00