Michael Bayne
79c8d020c3
Added Entity.postamble, wired it and Entity.name up properly.
2006-12-21 18:06:59 +00:00
Michael Bayne
f3a14252ed
TableKeyGenerator was not using the annotation specified initial value.
2006-12-20 21:51:46 +00:00
Michael Bayne
e494281ea1
No need to require a concrete map class.
2006-12-20 19:33:53 +00:00
Michael Bayne
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.
2006-12-20 19:31:46 +00:00
Michael Bayne
cf15c7c998
Support for more operators and functions from Zell.
2006-12-15 23:08:26 +00:00
Michael Bayne
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).
2006-12-11 21:35:05 +00:00
Michael Bayne
14c8d8cfb2
Support the specification of default values for columns.
2006-12-11 21:34:11 +00:00
Michael Bayne
9c13c0e1e7
Added LessThan and GreaterThan operators.
2006-11-30 23:38:52 +00:00
Michael Bayne
54195b45f9
2006-11-29 19:39:40 +00:00
Michael Bayne
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).
2006-11-29 02:40:45 +00:00
Michael Bayne
04a1eb09cb
Provide a concise way to create ascending and descending order by clauses.
2006-11-29 02:24:21 +00:00
Michael Bayne
9cb2c68bbf
Naughty naughty, creating an array of Equals[] and assigning to to an array of
...
SQLOperator[].
2006-11-21 23:29:46 +00:00
Michael Bayne
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.
2006-11-21 23:10:12 +00:00
Michael Bayne
36eb333624
Added Conditionals.IsNull. Modified Key() to use IsNull if a null value is
...
passed in for a column value.
2006-11-21 23:00:01 +00:00
Michael Bayne
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.
2006-11-21 17:13:55 +00:00
Michael Bayne
2ab575aa05
Fields that have no @Column must now default to non-nullable.
...
Added experimental support for Enum fields that are mapped to bytes.
2006-11-20 23:35:46 +00:00
Michael Bayne
6c777cebcb
Switched to our own set of annotation classes, provided by Zell. This removes
...
the dependency on the EJB3 persistence library.
2006-11-20 21:03:22 +00:00
Ray Greenwell
71549aab6f
We've got to notify the connection provider that the connection went sour
...
so that it disposes of it.
2006-11-08 19:51:45 +00:00
Michael Bayne
877029368d
A whole heap of new Depot stuff from Zell. Clauses, operators, expressions, oh
...
my!
2006-11-08 02:34:42 +00:00
Ray Greenwell
00aa0f2d96
Have the depot retry on transient failures.
...
Untested, until tomorrow morning!
2006-11-08 00:30:10 +00:00
Michael Bayne
e60dd15486
Some refactoring of query generation; addition of "for update" support. From
...
Zell.
2006-10-23 23:12:55 +00:00
Michael Bayne
a28231755a
Key convience constructors from Zell.
2006-10-20 23:49:41 +00:00
Michael Bayne
d5d4eaf6c3
Another @Computed related patch.
2006-10-20 18:52:49 +00:00
Michael Bayne
1845859344
@Computed enhancements from Zell.
2006-10-20 04:26:27 +00:00
Michael Bayne
2fabde7b1c
Out vile extra space!
2006-10-13 21:42:25 +00:00
Michael Bayne
93bbbf06a9
@Computed support from Zell.
2006-10-13 21:39:49 +00:00
Michael Bayne
02126dcce9
Support for query clauses, joins, field overriding and a bunch of
...
other useful stuff from Zell. Adjusted formatting to 100 columns.
2006-10-13 02:36:21 +00:00
Michael Bayne
af53ed7913
Merge Key2 into Key.
2006-10-11 20:37:14 +00:00
Michael Bayne
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.
Also moved the actual "get a connection and do the query" code into the
persistence context which is sort of a nice separation. The repository and
friends now just put together Query and Modifier objects and pass them to the
context for execution. The context will eventually handle interaction with the
cache as well (exposing manual manipulation mechanisms as needed to the
DepotRepository).
2006-10-11 20:07:05 +00:00
Michael Bayne
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.
2006-10-11 18:36:53 +00:00
Michael Bayne
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.
2006-10-11 02:46:41 +00:00
Ray Greenwell
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.)
2006-09-30 02:34:36 +00:00
Michael Bayne
a71dabebbd
Copyright date and header fiddling.
2006-09-29 18:51:30 +00:00
Michael Bayne
a90a32498e
2006-09-29 18:40:04 +00:00
Michael Bayne
a01240e95a
Multi-column primary key support from Zell.
2006-09-29 18:38:33 +00:00
Michael Bayne
e903948eb1
Always update then insert in case for whatever reason the zeroth schema version
...
is not one (like for ItemRecord).
2006-09-29 01:28:53 +00:00
Michael Bayne
18491c5565
Added auto-migration for adding new columns.
2006-09-29 01:21:53 +00:00
Michael Bayne
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.
2006-09-26 19:51:58 +00:00
Michael Bayne
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.
2006-09-26 19:41:40 +00:00
Michael Bayne
dafeeec087
Allow the scope of globally scoped annotations to be managed explicitly instead
...
of making them shared across a JVM.
2006-09-22 18:59:48 +00:00
Michael Bayne
a69c139e3d
External table primary key generation from Zell, with some rearranging.
2006-09-22 18:06:43 +00:00
Michael Bayne
17e63530c4
Support @Length on byte[] fields.
2006-09-21 01:31:04 +00:00
Michael Bayne
8620ace13d
Added support for byte arrays and full table loads.
2006-09-21 00:31:21 +00:00
Michael Bayne
638a52ff2a
(Hackily) handle duplicate key exceptions.
2006-09-20 00:34:50 +00:00
Michael Bayne
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.
2006-09-20 00:15:34 +00:00
Michael Bayne
e4628ed6e3
Collection queries will be invoked directly, though things will likely evolve
...
once we implement caching.
2006-09-19 23:56:49 +00:00
Michael Bayne
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).
2006-09-19 22:45:33 +00:00
Michael Bayne
4c89cdea33
Finished most of the basic implementation. Now on to magical table creation.
2006-09-19 20:29:58 +00:00
Michael Bayne
7727c5cfde
Untested support for partial object updates.
2006-09-18 23:11:13 +00:00
Michael Bayne
5639410725
Further progress on the ORM stuff. Miraculously, upon running this nearly
...
thousand lines of super funny looking generics and reflection filled code the
first time, it just worked. Yay for static typing or something.
2006-09-15 01:48:29 +00:00