Commit Graph

  • c3c651340b Guava 10.0. Ray Greenwell 2011-09-28 22:32:02 +00:00
  • 710d2ffaf2 From Bruno Garcia: Add a mode for FullText to search for rows that match all the words in a query rather than any of them. Par Winzell 2011-08-24 15:04:43 +00:00
  • 3c1e6f7538 Depot needs java 1.6 Dave Hoover 2011-07-01 18:11:14 +00:00
  • 27f33b8d90 Don't need that semicolon. Dave Hoover 2011-07-01 18:11:11 +00:00
  • 3f8f15af9f Added support for clearing caches. Michael Bayne 2011-06-27 21:08:01 +00:00
  • d5b06f23e2 Fixed javadoc classpath, samskivert apidocs URL. Michael Bayne 2011-06-27 21:07:51 +00:00
  • b6942ec74a Remove and ignore Eclipse files in favor of letting people generate their own using m2eclipse Charlie Groves 2011-06-27 20:51:07 +00:00
  • c26d9b29fb Had this laying around... - Added an IntegerIterable Transformer. - Document that these *Iterable transformers work with List/Set/Collection... In case it wasn't clear. - Added a sizeHint argument to the createCollectionBuilder method, take advantage of that in the IntegerIterable since we don't need to do any work to find the size. Ray Greenwell 2011-06-24 20:17:02 +00:00
  • d5eb7cf3ff Bump to ooo-build 2.5 since the maven-ant-tasks jar 2.1 uses is no longer available Charlie Groves 2011-06-24 20:11:48 +00:00
  • cef1461109 Warning cleanup Charlie Groves 2011-06-24 19:47:18 +00:00
  • 7ba475e61c Use default values for the values section of an insert statement for hsqldb as well as postgres Charlie Groves 2011-06-24 19:25:57 +00:00
  • a28990116c Some test cleanup from Eclipse Charlie Groves 2011-06-24 19:22:24 +00:00
  • e3ff96745d Added support for limit to deleteAll. Michael Bayne 2011-06-23 22:12:47 +00:00
  • ee93f91e61 Preparing for depot-1.5-SNAPSHOT development. Dave Hoover 2011-05-24 20:57:26 +00:00
  • 6c47a9c4ac Preparing for 1.4 release. Dave Hoover 2011-05-24 20:50:06 +00:00
  • eb6d48d054 Changed selectCount() to not alter the state of the Query, so that I can select a count of matching rows and then go on to add an ordering and limit and select a particular page of results. Ray Greenwell 2011-05-13 16:43:31 +00:00
  • 5d9a584e4c Because MySQL can't abide parentheses around its intervals, let's put them around the entire expression rather than around the operands (which matches the behavior of the binary operator method). Andrzej Kapolka 2011-05-12 01:48:24 +00:00
  • 607f63a7a1 Fixed a problem where the Postgres JDBC driver would call toString() on an enum, when we need it to be using name() instead. We just take care to send it the results of name() instead of the enum value itself. Michael Bayne 2011-05-05 19:02:38 +00:00
  • fe028a1e42 Override toString in the enum we use for testing, to be sure we don't rely on it in our internals. We actually do use the toString value, but only in constructing the cache key for a query, which should generally not result in badness, unless you override your enums to not return unique strings for different enum values. Michael Bayne 2011-05-05 18:56:39 +00:00
  • 4c1864ddd6 This is exactly the sort of place where it's useful to *not* turn a complex value into a string and then throw it away when doing debug logging. Michael Bayne 2011-05-05 18:56:33 +00:00
  • e53288b7c4 Compactified header, extracted copyright and license bits into LICENSE. Michael Bayne 2011-05-05 18:35:14 +00:00
  • 72c4782b3c We need to quote identifiers in MySQL so that we can handle columns with names like group. Michael Bayne 2011-05-04 18:40:24 +00:00
  • fd4be08c78 None would be best in this case. Michael Bayne 2011-04-30 23:21:35 +00:00
  • 531b9a3234 Some changes to allow the ability to subclass the stats class and record more extensive, per-table stats. Andrzej Kapolka 2011-04-01 04:44:04 +00:00
  • e41e3c9961 Match the SQLBuilder changes in HSQLBuilder to fix the build Charlie Groves 2011-03-29 19:36:35 +00:00
  • 903bb5181b From Mark Johnson: support long autogenerated fields. Ray Greenwell 2011-03-29 03:42:24 +00:00
  • 07e5b934b5 Patch from Mark Johnson: support long[] field types. Ray Greenwell 2011-03-29 01:52:59 +00:00
  • 1f7263c6fa Preparing for 1.4-SNAPSHOT development. Charlie Groves 2011-03-23 22:19:01 +00:00
  • 19d9821f66 Preparing for 1.3 release. Charlie Groves 2011-03-23 22:16:54 +00:00
  • cd9854a8ca Ignore dist and target Charlie Groves 2011-03-23 22:16:37 +00:00
  • 8d56a93538 Meh, I was wrong in r841. Because the target version is 1.6, anything that tries to build against depot with a 1.5 compiler is going to blow up with a mismatched version. Go back to 1.5 in build.xml and pom.xml, but leave Eclipse using a 1.6 JVM. This means if anyone regenerates the m2eclipse configuration, this will break in Eclipse again. Lame. Charlie Groves 2011-03-23 22:09:29 +00:00
  • 7129295906 Updates from running genrecord Charlie Groves 2011-03-23 20:42:45 +00:00
  • 1a2967b31f yohoho no longer cares if depot is built with 1.6, so build with that since we're using 1.6's Connection.createArrayOf in PostgreSQL4Builder. Sneak a ooo-buildification in with the compiler version bump. Charlie Groves 2011-03-23 20:42:00 +00:00
  • 1be9961245 Crap, missed a few Charlie Groves 2011-03-23 01:44:48 +00:00
  • 2dbfaa0ee6 Remove an @Override from an interface as that isn't 1.5 compatible, and remove some unused imports Charlie Groves 2011-03-23 01:43:52 +00:00
  • ad4f2c9970 Changed expressions that deal with count() results to Number because Postgres in its burning desire to support the amazing four hundred billion rows, returns a Long for count expressions. Michael Bayne 2011-02-28 22:58:38 +00:00
  • 677de3da03 Added notNull() at Ray's request. Michael Bayne 2011-02-28 19:12:52 +00:00
  • 89927523bc Let byte enum columns be nullable. Andrzej Kapolka 2011-02-21 20:58:34 +00:00
  • 86476b4494 Now that we accept a list of SQL statements to be executed individually (and committed after each statement), I no longer need to manually handle table population. Michael Bayne 2011-02-18 18:25:34 +00:00
  • 687de42168 Added needed import. Michael Bayne 2011-02-18 18:24:40 +00:00
  • 8499fc1c06 Implemented a framework for testing database migrations. Unfortunately, I am not filled with ideas on how to programmatically verify that the primary key migration I've just created a test for is actually working. I can visually inspect the logging output, but that's not useful for catching potential future regressions. Michael Bayne 2011-02-18 01:53:38 +00:00
  • 62fb0eac99 Allow a name and a series of initialization statements to be provided when creating a persistence context. Michael Bayne 2011-02-18 01:53:30 +00:00
  • 2565a292d1 Have the trivial fetcher do no stats updating by default. Michael Bayne 2011-02-18 01:53:23 +00:00
  • e59b20dd56 Report the pkName in both cases, and do so using valid Java code. Michael Bayne 2011-02-18 00:40:48 +00:00
  • adf914e156 Wired up handling of primary key changes (with some reorganization of a patch from Nathan). If we need to add our primary key, we do so, if we need to remove it, we do so, and only then do we consider whether we need to migrate it (in which case we drop and re-add it). Michael Bayne 2011-02-18 00:35:58 +00:00
  • 8670d0e109 Support creation of arrays of stock enum values (which are turned into strings). From Jamie. Michael Bayne 2011-02-16 02:13:35 +00:00
  • 10e97b55c9 PostgreSQL gets very confused when date_part() is used in a GROUP BY and the part bit isn't a constant. It doesn't recognize the selected values as being identical to the grouped-by values, and throws an error. So we use a literal here. Par Winzell 2011-02-15 23:21:11 +00:00
  • 6603fb7d81 Patches from Jamie: Michael Bayne 2011-02-15 22:20:53 +00:00
  • 51aa221606 Use the platform's line separator when generating code from templates. This assumes that the depot.jar in question was created on a LF-only platform, but that's probably a safe bet. Michael Bayne 2011-02-12 00:26:56 +00:00
  • d59717d025 No longer lazily initialized. Ray Greenwell 2011-02-10 17:28:39 +00:00
  • 5c52a84916 I can think of no reason why this was ever allowed to be null. Par Winzell 2011-02-10 17:21:06 +00:00
  • b8fec6cab5 Fixed a problem with binding transformed values in updatePartial. Michael Bayne 2011-02-05 00:22:53 +00:00
  • 9aba944105 Clean up after ourselves. Michael Bayne 2011-02-04 18:16:22 +00:00
  • 6c9d372510 Removed a final annotation that I had slipped in for testing. Michael Bayne 2011-02-04 18:14:45 +00:00
  • 71d3577074 Ur doin it wrong. The transforming field marshaller needs to operate on F (the non-persistent type), and transform in getFromSet/writeToStatement, rather than operate on T (the persistent type) and transform in getFromObject/writeToObject. Michael Bayne 2011-02-04 18:14:15 +00:00
  • ea676d5b9e Added Tuple2.toMap for those times when you really want a map from a to b rather than a list of (a, b). Michael Bayne 2011-01-31 17:50:18 +00:00
  • 80a34a035f Deploy a sources jar along with the code jar for IDE-happiness Charlie Groves 2011-01-20 00:42:33 +00:00
  • f4b25369ff Bugfix. Ray Greenwell 2011-01-18 21:52:47 +00:00
  • 8e3a690b79 Fixed one little thing that bothered me: null enum values could safely be stored, but if rehydrated into a Set then an EnumSet would be created and that can't store nulls. So, check to see if the encoded String has any nulls in it and have the builder create a HashSet instead. Ray Greenwell 2011-01-18 21:37:38 +00:00
  • b32c6753c1 Added EnumIterable, which can be used to transform an Iterable containing Enums. It extends StringBase, so the enums are stored similarly to how a Set<String> is stored, and not based on ordinal. Ray Greenwell 2011-01-17 22:20:25 +00:00
  • 354ed1aba2 Use m2eclipse for Eclipse configuration Charlie Groves 2011-01-11 23:46:04 +00:00
  • db0961a866 Nixed more obsolete references to build-ivy.xml. Michael Bayne 2011-01-07 22:44:58 +00:00
  • 9d37e15a55 Nixed obsolete reference to build-ivy.xml. Michael Bayne 2011-01-07 22:44:25 +00:00
  • a0999fb8a4 [maven-release-plugin] prepare for next development iteration Michael Bayne 2011-01-07 22:31:59 +00:00
  • e0a55fc3a8 [maven-release-plugin] prepare release depot-1.2 Michael Bayne 2011-01-07 22:31:45 +00:00
  • 16919c056b Use the latest stable samskivert: 1.2. Michael Bayne 2011-01-07 22:27:35 +00:00
  • 0040e18536 DRY: lib.name -> ant.project.name. Michael Bayne 2011-01-07 22:15:17 +00:00
  • 63816b421c Don't complain that indices created by hsqldb are stale Charlie Groves 2011-01-05 20:24:29 +00:00
  • 1b21df9994 Added Funcs.countStar() because it's such a common SQL operation. Michael Bayne 2010-12-18 18:01:57 +00:00
  • 5dc96f1ac0 We need to ascend or descend on a particular column. Michael Bayne 2010-12-18 17:47:31 +00:00
  • 2796b3992d Stop calling me Shirley. Michael Bayne 2010-12-18 17:37:23 +00:00
  • 5809a5e8c6 New deal: every time you call a builder method, a copy of the Query is created, so that partially constructed queries can be reused without any special care being taken by the caller. I also switched to the use of a functional list internally to make this whole process more pleasant and efficient. Michael Bayne 2010-12-18 17:32:31 +00:00
  • 7d99928d7c Maven makes using version ranges too annoying by constantly checking for new versions with the repository. Michael Bayne 2010-12-18 17:30:57 +00:00
  • 0fd6f66181 This was very confused. Unique columns are automatically indexed. Thus we should certainly not create an explicit index when we encounter a unique column, as we were doing, and we will even go so far as to forbid an explicit index. Par Winzell 2010-12-15 03:25:40 +00:00
  • f81b338cd9 Check for stale indexes, too. Use our knowledge of full text indexes to better decide if a column or index is internal to Depot's or the DB's workings. Finally, allow com.samskivert.depot.verifyschema to be set, forcing a staleness check (which slows down initialization somewhat). Par Winzell 2010-12-15 02:58:55 +00:00
  • 15cab8a6e2 Exclude impl packages and document only public members. Michael Bayne 2010-12-14 17:16:14 +00:00
  • 367c10cc52 Javadoc fixes. Michael Bayne 2010-12-14 17:09:43 +00:00
  • d0919f8239 Correctify the documentation for selectInto(). Michael Bayne 2010-12-14 16:41:16 +00:00
  • d34ee233f7 Boil some plates, whatever that means Charlie Groves 2010-12-13 20:58:42 +00:00
  • 5455490fcf PECS. Even if the columns are String, Integer, and Boolean; it's not unreasonable to accept a Builder that consumes Object, Number, and Comparable. Ray Greenwell 2010-12-13 19:48:46 +00:00
  • 5e10393463 Added a totally type-safe mechanism for selecting ad-hoc query results into pojos which hold the results of the query. The caller can decide if they want to use the magic of selectInto(), and be careful not to screw up the types and order of their pojo fields, or they can boil up some plates and create a builder for their pojo, which will be type-checked, soup to nuts. Michael Bayne 2010-12-13 19:29:50 +00:00
  • 90b04e68b8 Prevent confusion if someone uses selectCount() (which returns int) on a grouped query. They should be using select(Funcs.count(Exps.literal("*"))) (which returns List<Integer>) in such cases. Michael Bayne 2010-12-13 17:50:50 +00:00
  • 881a36bdca Log processed and skipped classes to ant's verbose logger to give some visibility into what's happening if run with -v. Charlie Groves 2010-12-11 00:10:15 +00:00
  • fa94063dc7 Missing @Overrides Charlie Groves 2010-12-10 21:40:35 +00:00
  • 4b59373559 Added a mechanism for selecting results into a simple result class that relies only on a matching public constructor. This version is not type-safe, but I'll also be adding an additional mechanism to do selections like this that uses a type-safe builder approach, which comes at the cost of a healthy dose of boilerplate code. Michael Bayne 2010-12-10 21:12:57 +00:00
  • dd6dec7b9a Handle arrays (potentially of nested types). Ray's got some crazy shit over in PX land. Michael Bayne 2010-12-10 04:50:26 +00:00
  • b6088302d5 Added a bunch of tests for the various functions appearing in a projection. This uncovered a lot of loose geese as far as the database was concerned, which necessitated turning a bunch of functions which had specific type into functions which have type Number. Michael Bayne 2010-12-10 00:48:52 +00:00
  • fc94473ec4 The beans were above the frank. Michael Bayne 2010-12-10 00:35:23 +00:00
  • f2842f87da QueryBuilder -> Query. Michael Bayne 2010-12-09 23:09:24 +00:00
  • a0a9acbf16 Query -> Fetcher because I want to next change QueryBuilder -> Query so that it looks nicer when you keep partially constructed queries around. Michael Bayne 2010-12-09 23:05:43 +00:00
  • 1b2df7b583 Return null from a load() with no matches, rather than throwing a NoSuchElement exception. I'm tempted to reinstate the NoSuchElement exception for a load() that attempts to project fields from the selected rows, but I think it makes more sense for a load() which aggregates over zero rows to return null than to throw a NoSuchElement exception. Michael Bayne 2010-12-09 22:55:49 +00:00
  • d93db7a0f7 Specify the types on Tuple.newTuple to make the captures line up Charlie Groves 2010-12-09 21:53:49 +00:00
  • 63ac28fcef Do so in a syntactically correct manner as well. Michael Bayne 2010-12-09 17:19:40 +00:00
  • eeb8f5eeb7 Allow newer versions of our samskivert and guava dependencies. Michael Bayne 2010-12-09 17:19:12 +00:00
  • 84738f9c57 Roll everything on up to Tuple5. We boil the plates so that you don't have to! Michael Bayne 2010-12-09 01:44:27 +00:00
  • de6feea1eb Split these tests up. Michael Bayne 2010-12-09 01:22:24 +00:00
  • 780d25866c Holy plans coming together Batman, selecting computed expressions is working. Some examples: Michael Bayne 2010-12-09 01:14:21 +00:00
  • 800c566fc6 Use DepotTypes to keep track of the types in our query. That's it's whole purpose in life. Michael Bayne 2010-12-09 00:42:34 +00:00
  • f629b267ba I'd like to be able to require that you at least can only call greatest and least on something that was Comparable, but unfortunately, the numeric type's only shared supertype is Number and that is not comparable. Michael Bayne 2010-12-09 00:21:44 +00:00
  • b01eaef2d8 The type safety turtles now go all the way down. This tightens up a bit more fast-and-looseness by propagating types through foo.eq(bar) expressions, foo.lessThan(bar) expressions and the like. Michael Bayne 2010-12-09 00:08:58 +00:00