Commit Graph

669 Commits

Author SHA1 Message Date
zell 2da510c744 Don't try to build an UPDATE statement at all if no key were set on the record sent into store(). Also throw a sensible (if scaredy-cat) exception rather than an NPE if no WHERE clause were given to an UPDATE. We probably do want to allow rampant nutty 20,000-row UPDATEs at some point, but not because of an accidental null key.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2277 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-03-10 22:28:11 +00:00
mdb 195c16e06a It used to be that if you created a TextLayout with a font render context that
indicated the use of antialiasing, rendering that TextLayout would render with
antialiasing. However, it seems that some JVMs don't do that, so we need to
manually enable antialiasing before rendering the TextLayout. Such are the
millions of tiny inconsistencies that undermine write once run anywhere.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2276 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-29 20:11:03 +00:00
mdb 8b7610f188 Added sha1hex(), moved protected methods down below public.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2275 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-26 22:46:40 +00:00
mdb 75d4cd3f72 We need to guard against simultaneous calls to getCache().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2274 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-14 18:55:21 +00:00
mdb fa3bb14298 Added NotEquals.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2273 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-12 21:52:44 +00:00
mdb c5d9fbe949 None of these constructors actually throw a PersistenceException, so we'll go
ahead and not declare that they do.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2272 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-07 19:59:54 +00:00
mdb 93670b9d30 Operate on List not ArrayList. Widening.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2271 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-07 19:54:57 +00:00
samskivert@gmail.com c96bcb7bce Added a brevifying factory method:
ExpiringReference<OMGLongName> ref = ExpiringReference.create(foo, 1000);


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2270 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-02-06 21:45:53 +00:00
ray 24f524549b Don't require intervention to work in applets, just fix ourselves.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2269 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-01-31 04:27:48 +00:00
mdb 2338ec8e32 Spelling fixes from Dave.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2268 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2008-01-14 23:41:09 +00:00
mdb 6954e1a61b Optimization suggested by Ray.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2267 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 22:25:57 +00:00
mdb 43ec6f629c Let's encapsulate Sun's signal stuff so that we can avoid having their verbose
annoying (unsuppressable) warning messages in our various projects that
actually want to receive signals.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2266 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 22:23:25 +00:00
mdb f35af58377 Added ObjectUtil.compare(Comparable,Comparable) which sorts nulls before
non-nulls; added ComparableTuple which sorts first on its left element (nulls
sorting before non-nulls) and then on its right.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2265 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 21:56:17 +00:00
mdb 47c97d6356 Nixed redundant cast.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2264 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 19:47:27 +00:00
mdb f0b4c1f338 Another type clarification.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2263 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 19:46:28 +00:00
mdb 13bab282c7 Let the type system know that we don't care what type our classes are.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2262 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-12-17 19:45:35 +00:00
andrzej 1a29ddd025 git-svn-id: https://samskivert.googlecode.com/svn/trunk@2261 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2007-11-29 02:16:44 +00:00
mdb a4931c3af3 Use our fancy toString().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2260 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-28 00:02:06 +00:00
mdb d534360150 Support taking a List as well as a varargs array. There are no doubt other
places where this could be done.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2259 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-26 21:50:54 +00:00
zell 8074cba636 Utility method from David Hoover.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2258 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-20 19:06:18 +00:00
zell b3cabed72a Convert nulls to instances of a special NullValue class when we store them, and back again when retrieved. EHCache's replication mechanism flips out if you cache actual nulls (I have no idea why, nulls are obviously serializable). Also fix up some comments -- very soon we are going to have to add better (probably runtime) configurability to the Caches, and probably also write some code to display/collate their statistics.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2257 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-18 19:13:39 +00:00
mdb e9ab7a2bab close() needs to be synchronized. Also some widening.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2256 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-12 19:32:42 +00:00
zell 04ced65ed9 So while the JRE is happy to serialize arrays, EHCache is reluctant to do so in at least one place (presumably an explicit Serializable test). Let's switch to an ArrayList until further notice.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2255 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-11 20:29:38 +00:00
zell 6654fe01e8 This is actually starting to look hopeful. We have to add the cache replicator to each cache as we programmatically create them. Make sure we only do so when we have a distributed configuration.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2254 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-11 20:28:10 +00:00
mdb 6586d7534b Nix unused imports.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2253 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-10 01:18:06 +00:00
zell 2df9227d77 Implement the SQL 'exists' operator. I think this is our first serious subquery clause. Seems to work well.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2252 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-05 16:05:06 +00:00
mdb a858f07888 Widening.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2251 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-01 20:50:26 +00:00
mdb 539035f97b Added setDefaultLongThreshold().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2250 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-11-01 00:59:12 +00:00
mdb 685d9cfb8f Provide a constructor that takes a collection.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2247 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-26 23:03:32 +00:00
mdb 6599842a6f Imitation is the sincerest form of flattery.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2244 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-23 07:08:33 +00:00
mdb f34b9dcf7f Cleaned up some redundant casts and deprecated calls.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2243 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-23 00:15:37 +00:00
zell 3dedb868ea I made a mistake originally allowing IDENTITY value generators some partial configuration (e.g. start value and increment value). This only ever worked on PostgreSQL, and so would cause completely different behaviour under MySQL. That's obviously a bad idea.
So, IdentityValueGenerator's init() was meant only to be called upon table creation, but in r2234 I began calling it in all of a table's generators after every auto-migration. Needless to say this was bloody stupid, and caused MemberRecord's primary key generator to reset in production just now.

My fix is not to revert r2234, however, but to explicitly state init()'s expected behaviour: it should certainly not reset a generator if it already exists, but only ensure that it's operational -- creating it only if necessary.

We now never reset an IDENTITY generator, ever. The whole point of them is, after all, that they're auto-created by the database.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2242 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-18 01:50:11 +00:00
mdb 7443ad7b67 Don't assign default values to columns that have a @GeneratedValue annotation
because those will have their values set at insertion time and the database
might rightly freak out about the inconsistency of saying that the field has a
constant default value.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2241 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-17 00:42:17 +00:00
mdb c555c4280b Nix the thread dumps, we've got everything mostly in hand.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2240 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-15 23:56:48 +00:00
zell 0648698b24 If the search begins with non-word characters, the array returned by join() will have as its first element. We don't want in the array. So lo, we remove it.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2239 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-15 18:33:21 +00:00
mdb b602999a8b Let's use a warning so we see this in the dev server logs.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2238 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 19:56:25 +00:00
mdb 09392a402d Let's temporarily set up the bomb on anyone using the PrefsConfig on servers so
that we can track down these culprits and nix 'em.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2237 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 19:36:40 +00:00
zell c0913656d3 I was the shadow of the waxwing slain.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2236 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 18:49:57 +00:00
zell b319fd25be Oops, haha, this could've been amusing.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2235 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 18:31:49 +00:00
zell 0bfeae4553 Match the changes in com.samskivert.jdbc.* by ridding ourselves of static column defining SQL strings. Also give ValueGenerators an option to calculate their initial value based on MAX() of the column for which values are being generated. As part of this we also make sure to initialize new ValueGenerators after all migrations take place, and add a way for them to clean up after themselves as well.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2234 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 18:14:49 +00:00
zell 1e50256ca2 Don't pass around and store column definitions as SQL strings, but introduce an object to contain that data. PostgreSQL's extensions does column alteration in individual tweaks, where MySQL just accepts a raw string and figures out what to do.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2233 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-11 18:12:37 +00:00
mdb 05b6eb6fd9 Add a default handleFailure() implementation like PersistingUnit.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2232 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-08 23:58:40 +00:00
mdb 08cbbc0b0f Per Sarah: only strip the hostname if we have reason to believe we have a
hostname (foo.bar.com), prepend a "." to what appears to be a hostless domain
(bar.com), and don't call setDomain() at all if we don't have someting that
looks like a domain (localhost).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2231 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-08 21:38:35 +00:00
mdb df9f08d316 Per Mike T: we may want to create an array list of type B and then sort it
using a comparator on type A which is a superclass of B.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2230 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-10-08 15:17:34 +00:00
mdb b43faf07ec Fixed @Transient handling.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2229 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-27 16:57:05 +00:00
mdb 1eb87ed0f3 Let's not downgrade our databases.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2228 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-26 21:40:18 +00:00
mdb dd9d9df690 Catch IOException when writing our response so that we don't freak out if the
client ungracefully stops listening to us.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2227 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-24 16:42:37 +00:00
mdb e0d4d4302e getFullTextIndex() is not expected to return null, so throw an informative
exception if it would rather than letting the caller NPE. Also switched to
the Zell-style single-letter studly _pClass.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2226 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-19 17:52:18 +00:00
zell ada6b6d872 We need to look for FTI declarations in superclasses, too, just as we already do with @Entity indexes and @Table unique constraints. Ripped out the pointless RecordMetaData while I was at it. This is a lot cleaner.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2225 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-19 00:13:19 +00:00
zell 47c4d1cc12 Aii, indexes and triggers reside in the database-wide namespace and have to be qualified. I'll need to cook up migrations for the places where we already use FTS...
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2224 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2007-09-19 00:11:46 +00:00