Commit Graph

333 Commits

Author SHA1 Message Date
Par Winzell 3a99decfce Rename @Index(columns) to @Index(fields) and do the proper translation to column name during table creation / migration. 2007-08-13 22:57:09 +00:00
Michael Bayne 632b8684be Classes go after methods. 2007-08-13 21:59:25 +00:00
Michael Bayne d72ad79705 Catch marshaller initialiation failure and report it more informatively. 2007-08-13 21:47:56 +00:00
Michael Bayne f76ab3592a More Zell changes:
- Re-read the table metadata after we run pre-default migrations, since those
are pretty much guaranteed to change the table.
- Changed EntityMigration.Rename to a pre-default rather than a post-default
migration.
- Made all the static EntityMigration subclasses use the generic liaison rather
than JDBCUtil.
2007-08-13 19:42:46 +00:00
Michael Bayne f4dfccbf97 Patch from Zell to quell warnings about mismatched schemas for database-
specific auxiliary columns (specifically Postgres's FTS column).
2007-08-13 19:37:09 +00:00
Michael Bayne 9b87020fe5 Added getCacheAdapter(). 2007-08-11 00:48:59 +00:00
Michael Bayne f9b6414270 Patch from Zell to properly walk the inheritance tree and aggregate all
index-related annotations.
2007-08-08 23:58:43 +00:00
Michael Bayne 30681979ea Nixed unused bits. 2007-08-08 23:49:15 +00:00
Michael Bayne e21fbd9df1 From Zell: select text and binary column types based on the @Column(length)
annotation.
2007-08-08 23:47:50 +00:00
Michael Bayne c7150cabdc Small fix from Zell. 2007-08-07 18:05:49 +00:00
Michael Bayne eb9c7c9c74 Reinstate automatic schema migration, per Zell. 2007-08-06 21:52:52 +00:00
Michael Bayne 8eb5d24be9 Full text index support from Zell, also a fix for deletion. 2007-07-31 21:36:02 +00:00
Michael Bayne ddf40eb5c4 Always use an explicit query if we aren't using a cache. 2007-07-31 02:09:32 +00:00
Michael Bayne 92c54a5325 Synchronize on the connection while we're using it to cooperate with
SimpleRepository + StaticConnectionProvider.
2007-07-30 20:10:47 +00:00
Michael Bayne b9d14f57c7 Missed a spot. 2007-07-26 19:13:57 +00:00
Michael Bayne 07666e16a6 Added PersistenceContext.shutdown(), exposed shutdown() in ConnectionProvider. 2007-07-26 19:13:34 +00:00
Michael Bayne 3628ec528d Zell patch to factor caching code into pluggable CacheAdapter class. Allows us
to disable caching and/or replace it with less industrial strength system
during development.
2007-07-26 19:07:20 +00:00
Michael Bayne cf4f640ab3 Deprecation begone! 2007-07-25 23:30:07 +00:00
Michael Bayne 9f544c9174 El Giganto Depot database dialects support from Zell. PostgresSQL here we
come. Automatic schema migration is currently disabled and remains to be
dialectified.
2007-07-25 20:53:40 +00:00
Michael Bayne f0bae6ff8d Header updates. 2007-07-13 00:20:09 +00:00
Michael Bayne 68d9be57eb @Override is our friend. It helps to keep us warm and safe. 2007-07-12 21:50:36 +00:00
Michael Bayne 083cb788d8 Another Zell Depot patch:
- refactoring query construction;
- modified collection lookup to first look up the matching primary keys, then
check the cache for hits then look up the remainder from the database;
- other small renamery and cleanup.
2007-07-12 20:02:54 +00:00
Michael Bayne e472fc6de8 Check that our schema does not contain stale columns and issue a warning if it
does.
2007-06-29 00:25:40 +00:00
Michael Bayne 5b845c0ca7 2007-06-18 23:14:26 +00:00
Michael Bayne 15f3d6be4d Add a delete() that takes a Key. 2007-06-15 01:13:28 +00:00
Mark Johnson 41acbbdeca 2007-06-12 22:30:48 +00:00
Michael Bayne 2532edba80 We need to initialize migrations here as well. 2007-06-02 00:07:41 +00:00
Michael Bayne 9de9835b52 Patch from Zell to fix cache keys. 2007-06-01 19:53:09 +00:00
Michael Bayne ffa1f10e6b Oops, we were using _result to pass the record into the modifier in the first
place. We'll continue to do that and clear out _result during invoke() which is
a wee bit clearer anyway.
2007-05-23 18:20:08 +00:00
Michael Bayne f711b36527 Flush our record from the cache if we update just some fields in the record. In
the future we'll be extra clever and update just those fields in the cached
record if we have one.
2007-05-23 00:54:15 +00:00
Michael Bayne 54def9fe17 Run our Rename and Retype migrations after the default migrations so that we
don't freak out if a field is added, then renamed or retyped all in the same
migration. Now the column will be added with its proper name by the default
migrations and then the Rename migration will not freak out and the Retype
migration will NOOP.
2007-05-03 00:32:45 +00:00
Michael Bayne 55c4764192 Require a name for Index annotations because managing indices without a name is
a pain in the ass that we don't particularly need to spend time on.
2007-05-01 19:38:44 +00:00
Ray Greenwell 83148842ce Order by random. Probably this isn't very optimal. 2007-04-27 03:13:10 +00:00
Ray Greenwell d6a4f3fe6f List is as specific as we want to be here. 2007-04-20 01:56:43 +00:00
Ray Greenwell a3e9509cec Return values should be as specific as possible.
(Method parameters should be as generic as possible.)
2007-04-20 01:37:44 +00:00
Michael Bayne 17c6e9a2f6 Let's do that abstract check up here as well. 2007-04-19 21:27:18 +00:00
Michael Bayne b4051ef67e Whoops, we want declared fields for generating the constants but all fields for
determining the public key. As always, the plot is thicker.
2007-04-19 21:25:45 +00:00
Michael Bayne fce254db55 Let's put that check in the right place. 2007-04-19 21:21:49 +00:00
Michael Bayne 5e7d5e9df4 Three things:
- don't try to generate getKey() for abstract classes;
- get all of our class's fields, not just the ones declared in this class; do
  so using ClassUtil.getFields() rather than Class.getFields() because the
  latter returns the fields in a random order which is annoying whereas
  ClassUtil.getFields() returns them in an intuitive order (declaration order
  of the super-most class, then declaration order of the first derived class
  and so on);
- use Field.getAnnotations() rather than Field.getDeclaredAnnotations() just
  for consistency, even though you can't "override" a field and inherit
  annotations from your parent class (but if someday we have annotated
  PersistentRecord methods we'll want to use getAnnotations() not
  getDeclaredAnnotations() so we should provide appropriate copy and paste
  fodder).
2007-04-19 21:16:50 +00:00
Michael Bayne 420509be8d Introspection is expensive and the number of persistent classes is small, so
we'll cache the introspected primary key fields and reuse them. This has the
added benefit that we can eliminate storing the key fields entirely because we
know they must be exactly the set of primary key fields for the object which
never changes.

We will have to ensure that we flush our caches whenever we do a new release,
but we would have to do that anyway for a variety of reasons. Actually, we
could perhaps make use of the persistent object's versions and note the version
number of the cached instances in the cache and ignore the cache if they
differ.
2007-04-17 18:09:42 +00:00
Michael Bayne 2d9e812e65 Oops, forgot to strip whitespace from blank lines. 2007-04-17 17:44:41 +00:00
Michael Bayne e3e515b087 Patch from Zell to ensure that Key objects are only constructed with primary
key fields and also don't leave any out.
2007-04-17 17:42:56 +00:00
Michael Bayne 41d75ff59b Generate getKey() methods for our PersistentRecord classes in addition to
adding the field/column constants. Moved some of GenUtil into samskivert in the
process.
2007-03-16 20:50:10 +00:00
Michael Bayne 02de60a49d Improved @Computed support for subset record queries, from Zell. 2007-03-16 00:21:27 +00:00
Michael Bayne bd1359e7bb Return whether we updated or inserted. 2007-03-02 04:36:04 +00:00
Michael Bayne 9e42f3b319 When we create a table for a persistent record, set the starting version to the
correct value to avoid spuriously trying to migrate it immediately thereafter.
2007-03-01 23:43:21 +00:00
Michael Bayne 9c5765c38d This should really be automagic but for now we'll have a manual migration. 2007-02-28 00:25:43 +00:00
Michael Bayne 39a4d5463f 2007-02-20 19:14:21 +00:00
Michael Bayne 2daf15da71 Do that more nicely. 2007-02-20 19:12:30 +00:00
Michael Bayne 9556b9b0a2 Stop if we get to a generic type declaration. 2007-02-20 19:09:13 +00:00