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.
Michael Bayne
2007-05-23 00:54:15 +00:00
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.
Michael Bayne
2007-05-03 00:32:45 +00:00
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.
Michael Bayne
2007-05-01 19:38:44 +00:00
83148842ce
Order by random. Probably this isn't very optimal.
Ray Greenwell
2007-04-27 03:13:10 +00:00
d6a4f3fe6f
List is as specific as we want to be here.
Ray Greenwell
2007-04-20 01:56:43 +00:00
a3e9509cec
Return values should be as specific as possible. (Method parameters should be as generic as possible.)
Ray Greenwell
2007-04-20 01:37:44 +00:00
17c6e9a2f6
Let's do that abstract check up here as well.
Michael Bayne
2007-04-19 21:27:18 +00:00
b4051ef67e
Whoops, we want declared fields for generating the constants but all fields for determining the public key. As always, the plot is thicker.
Michael Bayne
2007-04-19 21:25:45 +00:00
fce254db55
Let's put that check in the right place.
Michael Bayne
2007-04-19 21:21:49 +00:00
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).
Michael Bayne
2007-04-19 21:16:50 +00:00
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.
Michael Bayne
2007-04-17 18:09:42 +00:00
2d9e812e65
Oops, forgot to strip whitespace from blank lines.
Michael Bayne
2007-04-17 17:44:41 +00:00
e3e515b087
Patch from Zell to ensure that Key objects are only constructed with primary key fields and also don't leave any out.
Michael Bayne
2007-04-17 17:42:56 +00:00
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.
Michael Bayne
2007-03-16 20:50:10 +00:00
02de60a49d
Improved @Computed support for subset record queries, from Zell.
Michael Bayne
2007-03-16 00:21:27 +00:00
bd1359e7bb
Return whether we updated or inserted.
Michael Bayne
2007-03-02 04:36:04 +00:00
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.
Michael Bayne
2007-03-01 23:43:21 +00:00
9c5765c38d
This should really be automagic but for now we'll have a manual migration.
Michael Bayne
2007-02-28 00:25:43 +00:00
39a4d5463f
Michael Bayne
2007-02-20 19:14:21 +00:00
2daf15da71
Do that more nicely.
Michael Bayne
2007-02-20 19:12:30 +00:00
9556b9b0a2
Stop if we get to a generic type declaration.
Michael Bayne
2007-02-20 19:09:13 +00:00
3277012a55
Behold, a column identifier generator for our keystroke saving needs.
Michael Bayne
2007-02-20 18:52:28 +00:00
2896b256ec
Do the same magic for DATETIME that we do when adding a TIMESTAMP column.
Michael Bayne
2007-02-20 02:17:56 +00:00
7fa2a1a2b8
Expanded convenience methods, from Zell.
Michael Bayne
2007-02-20 00:12:06 +00:00
3dc159b59b
Why fail when we can just complain without loss of integrity.
Michael Bayne
2007-02-19 19:47:18 +00:00
853c6f8b81
Cache invalidation patch from Zell.
Michael Bayne
2007-02-19 19:30:48 +00:00
2bc9c26119
Only log one line and don't create a Statement and then decide not to use it because the migration has already been performed.
Michael Bayne
2007-02-18 21:43:08 +00:00
84c842aeeb
More informative error message.
Michael Bayne
2007-02-18 21:41:20 +00:00
0a3ac07001
Make drop migrations idempotent.
Michael Bayne
2007-02-18 21:40:13 +00:00
be56250d8e
>= and <= operators.
Michael Bayne
2007-02-10 19:04:36 +00:00
5b9f06f933
Make our Rename migration more lenient about having already been performed.
Michael Bayne
2007-02-09 20:41:30 +00:00
4df78e2e08
Added a Like operator courtesy of Mr Winzell.
Michael Bayne
2007-01-31 18:34:45 +00:00
916dfb3cfa
Michael Bayne
2007-01-30 22:40:24 +00:00
d6156c201a
Patch from Zell to fix index bits.
Michael Bayne
2007-01-30 20:57:38 +00:00
0a3bcdbfcc
Two operators from Zell.
Michael Bayne
2007-01-19 00:01:16 +00:00
f7caf53511
Type safety and varargs don't play nicely together. Funny that it only freaks out when you try to compile code that calls a varargs method with more than one class. At that point it tries to create an array with a generic element type which is disallowed.
Michael Bayne
2007-01-16 05:33:58 +00:00
180e4626c1
Modifications to clone() on insertion and extraction from cache, from Zell. A whole bunch of type safety jockeying and concretification of QueryClause by yours truly.
Michael Bayne
2007-01-16 05:30:02 +00:00
4f6a334018
@Table(uniqueConstraints) support from Zell.
Michael Bayne
2007-01-15 01:57:35 +00:00
935bd34621
Some fixes and documentation from Zell.
Michael Bayne
2007-01-14 20:40:54 +00:00
8f4b37d9dc
Caching support from Zell. Hard drives the world round rejoice!
Michael Bayne
2007-01-11 00:43:08 +00:00
58439d0285
Collections are a goodness.
Michael Bayne
2007-01-08 21:16:33 +00:00
2c54bc97c9
Don't auto-remove indices either. Deciphering whether that's the right thing to do is a PITA and not really worth the trouble.
Michael Bayne
2007-01-02 22:12:05 +00:00
ea85c1d500
Missed a space.
Michael Bayne
2006-12-24 01:30:44 +00:00
0235cd80ac
The plot thickens. Support all the varieties of modes with or without query expansion.
Michael Bayne
2006-12-22 00:34:45 +00:00
679a762247
Support different query modes.
Michael Bayne
2006-12-22 00:30:20 +00:00
20c6e167e1
Them thar columns was all jammed together. Give 'em some breathin' room with commas.
Michael Bayne
2006-12-22 00:06:45 +00:00
fce4c8af63
Added Conditionals.Match for MySQL full text query operator.
Michael Bayne
2006-12-21 23:33:37 +00:00
b071e8449d
Nix auto-column dropping, add simple concrete migrations that can be used to easily register a column drop or a column rename should the need arise.
Michael Bayne
2006-12-21 22:55:27 +00:00
358d74325c
Automatically add and remove indices and primary key (though it's extremely unlikely that one would do the latter), automatically remove obsolete columns (might be dangerous, I could be pursuaded to reconsider).
Michael Bayne
2006-12-21 22:34:06 +00:00
b1ed8b0211
Index handling. Automatic addition and removal of indices not yet implemented.
Michael Bayne
2006-12-21 20:53:55 +00:00
d9a5cdaec8
Added support for hand-registered migrations (untested).
Michael Bayne
2006-12-21 19:06:18 +00:00
79c8d020c3
Added Entity.postamble, wired it and Entity.name up properly.
Michael Bayne
2006-12-21 18:06:59 +00:00
f3a14252ed
TableKeyGenerator was not using the annotation specified initial value.
Michael Bayne
2006-12-20 21:51:46 +00:00
e494281ea1
No need to require a concrete map class.
Michael Bayne
2006-12-20 19:33:53 +00:00
9d7eda16f9
Added a version of updatePartial() that takes a Map of keys and values which it converts to a list and calls the existing version.
Michael Bayne
2006-12-20 19:31:46 +00:00
cf15c7c998
Support for more operators and functions from Zell.
Michael Bayne
2006-12-15 23:08:26 +00:00
d06b9685dc
Add some hackery to work around MySQL's strange habit of assigning 0 instead of the current time when adding a TIMESTAMP column to a table (even if you explicitly define the TIMESTAMP column with DEFAULT CURRENT_TIMESTAMP).
Michael Bayne
2006-12-11 21:35:05 +00:00
14c8d8cfb2
Support the specification of default values for columns.
Michael Bayne
2006-12-11 21:34:11 +00:00
9c13c0e1e7
Added LessThan and GreaterThan operators.
Michael Bayne
2006-11-30 23:38:52 +00:00
54195b45f9
Michael Bayne
2006-11-29 19:39:40 +00:00
5526c9d823
The plot thickens. OrderBy wasn't handling multiple columns properly, which requires individual ordering instructions for each column. So we've modified it to do so which required some signature changes and renders the static methods only really appropriate for a single column (which is what you want 90% of the time anyway).
Michael Bayne
2006-11-29 02:40:45 +00:00
04a1eb09cb
Provide a concise way to create ascending and descending order by clauses.
Michael Bayne
2006-11-29 02:24:21 +00:00
9cb2c68bbf
Naughty naughty, creating an array of Equals[] and assigning to to an array of SQLOperator[].
Michael Bayne
2006-11-21 23:29:46 +00:00
f5ba22ce14
Needing the fully qualified column expression is not the common case, so let's add unqualified constructors to make it easy to simply issue queries on a single table based on values in columns.
Michael Bayne
2006-11-21 23:10:12 +00:00
36eb333624
Added Conditionals.IsNull. Modified Key() to use IsNull if a null value is passed in for a column value.
Michael Bayne
2006-11-21 23:00:01 +00:00
24411263b8
Need to get that column as a byte so that it is boxed into a Byte otherwise we'll end up with an Integer which reflection doesn't convert to a Byte when coercing the method parameters.
Michael Bayne
2006-11-21 17:13:55 +00:00
2ab575aa05
Fields that have no @Column must now default to non-nullable.
Michael Bayne
2006-11-20 23:35:46 +00:00
6c777cebcb
Switched to our own set of annotation classes, provided by Zell. This removes the dependency on the EJB3 persistence library.
Michael Bayne
2006-11-20 21:03:22 +00:00
71549aab6f
We've got to notify the connection provider that the connection went sour so that it disposes of it.
Ray Greenwell
2006-11-08 19:51:45 +00:00
877029368d
A whole heap of new Depot stuff from Zell. Clauses, operators, expressions, oh my!
Michael Bayne
2006-11-08 02:34:42 +00:00
00aa0f2d96
Have the depot retry on transient failures. Untested, until tomorrow morning!
Ray Greenwell
2006-11-08 00:30:10 +00:00
e60dd15486
Some refactoring of query generation; addition of "for update" support. From Zell.
Michael Bayne
2006-10-23 23:12:55 +00:00
a28231755a
Key convience constructors from Zell.
Michael Bayne
2006-10-20 23:49:41 +00:00
d5d4eaf6c3
Another @Computed related patch.
Michael Bayne
2006-10-20 18:52:49 +00:00
1845859344
@Computed enhancements from Zell.
Michael Bayne
2006-10-20 04:26:27 +00:00
2fabde7b1c
Out vile extra space!
Michael Bayne
2006-10-13 21:42:25 +00:00
93bbbf06a9
@Computed support from Zell.
Michael Bayne
2006-10-13 21:39:49 +00:00
02126dcce9
Support for query clauses, joins, field overriding and a bunch of other useful stuff from Zell. Adjusted formatting to 100 columns.
Michael Bayne
2006-10-13 02:36:21 +00:00
af53ed7913
Merge Key2 into Key.
Michael Bayne
2006-10-11 20:37:14 +00:00
979a1fd17b
Promoted a number of classes out of DepotRepository because they are used all across the package. Moved marshaller creation and management into the PersistenceContext because marshallers should be shared across a persistence context.
Michael Bayne
2006-10-11 20:07:05 +00:00
7dd3eeaa7e
The Java compiler uses the platform's default encoding when reading source files which explains why Ray's "there are no languages but English" system resulted in complaints and my "named after the African word for community" system did not. Fortunately we can just tell the Java compiler what to expect.
Michael Bayne
2006-10-11 18:36:53 +00:00
d9c7a0ca58
Go through the fields in declaration order when doing the migration otherwise we might try to add a field after a field that we haven't yet added.
Michael Bayne
2006-10-11 02:46:41 +00:00
4ccbc4fd2e
Changed these to make me (and the compiler) happy. I'm pretty sure source files should be ISO-8859-1. If you're more comfortable with entity tags appearing in a /* */ style comment, then maybe that's what we should use for the header text. (The Java Coding Guidlines say you should use a /* */ comment at the top of the file.)
Ray Greenwell
2006-09-30 02:34:36 +00:00
a71dabebbd
Copyright date and header fiddling.
Michael Bayne
2006-09-29 18:51:30 +00:00
a90a32498e
Michael Bayne
2006-09-29 18:40:04 +00:00
a01240e95a
Multi-column primary key support from Zell.
Michael Bayne
2006-09-29 18:38:33 +00:00
e903948eb1
Always update then insert in case for whatever reason the zeroth schema version is not one (like for ItemRecord).
Michael Bayne
2006-09-29 01:28:53 +00:00
18491c5565
Added auto-migration for adding new columns.
Michael Bayne
2006-09-29 01:21:53 +00:00
b9b199b725
Update our Modifier's key on an insert (and store) so that it can (eventually) properly cache the results of our insert based on the newly assigned primary key. Also avoid freakout if an attempt is made to store() a non-primary-key using object.
Michael Bayne
2006-09-26 19:51:58 +00:00
dbe7d69162
Unbork handling of objects with no primary key. Added a comment indicating where we will need to cache the results of a modifier (like an insert or an update). Added hasPrimaryKey() to DepotMarshaller which we will soon use externally.
Michael Bayne
2006-09-26 19:41:40 +00:00
dafeeec087
Allow the scope of globally scoped annotations to be managed explicitly instead of making them shared across a JVM.
Michael Bayne
2006-09-22 18:59:48 +00:00
a69c139e3d
External table primary key generation from Zell, with some rearranging.
Michael Bayne
2006-09-22 18:06:43 +00:00
17e63530c4
Support @Length on byte[] fields.
Michael Bayne
2006-09-21 01:31:04 +00:00
8620ace13d
Added support for byte arrays and full table loads.
Michael Bayne
2006-09-21 00:31:21 +00:00
dd9ffec684
Don't force an id generation strategy. The default is to assume the code will provide one. Separate out logging for depot so that fine grained logging can be enabled if needed without turning on such logging for all of samskivert.
Michael Bayne
2006-09-20 00:15:34 +00:00
e4628ed6e3
Collection queries will be invoked directly, though things will likely evolve once we implement caching.
Michael Bayne
2006-09-19 23:56:49 +00:00
add43aba13
Automagic table creation. The migration stuff is not yet implemented and various fancy things like embedded objects and constraints and kitchen sinks are not yet implemented, but the basic bits are functional (including IDENTITY column primary key handling).
Michael Bayne
2006-09-19 22:45:33 +00:00
4c89cdea33
Finished most of the basic implementation. Now on to magical table creation.
Michael Bayne
2006-09-19 20:29:58 +00:00
7727c5cfde
Untested support for partial object updates.
Michael Bayne
2006-09-18 23:11:13 +00:00