Commit Graph

1877 Commits

Author SHA1 Message Date
mdb ac0ed6ae03 Don't duplicate the project name.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1929 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-26 20:35:31 +00:00
mdb 60bd39e8b6 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.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1928 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-26 19:51:58 +00:00
mdb eaa520044b 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.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1927 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-26 19:41:40 +00:00
mdb f0a8a76238 Added missing import.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1926 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-26 19:27:59 +00:00
mdb d79766f9f5 Extracted the dependency checking into a shared build file which is also used
by the tests build file. Added a call to build the tests to the standard dist
call to discourage test rot. Modified build process to copy library
dependencies into dist/lib during build so that dist/ contains all build
dependencies and build results at the end of the build.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1925 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-26 19:07:55 +00:00
mdb c29a7e91d3 Allow the scope of globally scoped annotations to be managed explicitly instead
of making them shared across a JVM.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1924 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-22 18:59:48 +00:00
mdb f45349dca7 External table primary key generation from Zell, with some rearranging.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1923 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-22 18:06:43 +00:00
mdb 77b4adba34 Support @Length on byte[] fields.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1922 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-21 01:31:04 +00:00
mdb 121b864558 Added support for byte arrays and full table loads.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1921 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-21 00:31:21 +00:00
mdb d68fdb8106 Allow XHTML generation to be deactivated for Java's old skool HTML viewing
code.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1920 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-20 22:32:07 +00:00
mdb 4fb11519a8 (Hackily) handle duplicate key exceptions.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1919 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-20 00:34:50 +00:00
mdb a95babcc00 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.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1918 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-20 00:15:34 +00:00
mdb 7aa0c42d5f Collection queries will be invoked directly, though things will likely evolve
once we implement caching.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1917 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 23:56:49 +00:00
mdb d2a1f87f5a 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).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1916 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 22:45:33 +00:00
mdb 68558e11bd Added reset().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1915 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 22:42:21 +00:00
mdb 5b983f8e19 Javadoc fixes.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1914 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 20:45:39 +00:00
mdb 0c1e0c6966 Finished most of the basic implementation. Now on to magical table creation.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1913 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 20:29:58 +00:00
mdb d6b44eefd9 Close <input> tags in XHTML compliant way (<input/>).
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1912 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-19 19:41:35 +00:00
mdb f19377411f Untested support for partial object updates.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1911 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-18 23:11:13 +00:00
mdb e4d6a0266b Added getName().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1910 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-18 23:08:43 +00:00
mdb a755572474 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.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1909 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-15 01:48:29 +00:00
mdb 9ed739ba61 Brought some test bits up to date.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1908 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-15 01:45:43 +00:00
mdb 6c9a29b4bd Allow custom Label derivations to be used with MultiLineLabel.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1907 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-15 01:19:55 +00:00
ray 900dd533ea StringBuilder instead of StringBuffer.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1906 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-14 23:33:16 +00:00
mdb 5fcb5b907b The beginnings of a new persistence framework which leverages the annotation
goodness of the new EJB3 persistence framework but is not "managed" (ie. is not
real ORM).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1905 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-14 21:10:33 +00:00
mdb a39c1bac86 Moved static methods to the top of the class; added configureAction() which
complements createActionButton() but gives you control over creating the button
(and works for any AbstractButton derivation).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1904 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-13 21:27:50 +00:00
mdb 05abb4dea4 Allow IntTuple to be serialized.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1903 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-13 00:41:04 +00:00
mdb 420b86f2db Type safety is a goodness.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1902 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-12 23:24:03 +00:00
ray bb500f938e Use varargs instead of having a few different overloaded versions of the
same methods. But then I went ahead and added String varargs versions,
otherwise any old code that passes a String[] would have to cast to
Object[] to avoid compiler warnings. (Because the args don't quite match,
the compiler is unsure whether you want your String[] to be the first Object
arg or whether the whole String[] should be cast to the Object[].)


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1901 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-11 22:15:46 +00:00
mdb 1b16a084bb Cache resolved resource bundles based on our path to avoid stepping on other
message managers.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1900 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-10 16:47:30 +00:00
ray b04e96dc27 Now (actually, a while back...) that the Object[] version of splice is
genericized, we don't need a separate version for String[].


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1899 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-06 00:02:37 +00:00
mdb 41b316229a Added insert() to complement append(), made append() use insert().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1898 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-05 23:30:02 +00:00
mdb b1bbd5cef3 Was calling wrong method.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1897 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-05 21:57:04 +00:00
mdb 55910b495d Displaying an arbitrary value as currency in the caller's locale is almost
certainly *never* what you want. However, I don't know who's calling these
methods (and they are doing so through Velocity so I can't just recompile
everything to find out; yay for dynamic languages), so I won't remove them
outright. I did remove the dangerous methods from CurrencyUtil.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1896 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-05 21:24:11 +00:00
ray 56e58fa431 Genericized methods that benefit from it.
I originally had append have the signature:

    public static <T extends Object, E extends T> T[] append (
        T[] values, E value)

At first I thought I had done a good thing by ensuring that a subclass
element could be added, but then realized that E was pointless because
an E can be passed in for the T parameter anyway.

That got me thinking about generics and I found this:
http://weblogs.java.net/blog/arnold/archive/2005/06/generics_consid_1.html

Some of it made me laugh, and while I didn't read all the comments, I
spotted this gem:

[excerpt]
    The trouble with generics--and this has been known for many years--
    is what I'd like to call the Elvis/Einstein boundary. (Google for
    Mort/Elvis/Einstein if you wonder why the King enters the picture...)

    List<E>. solves a problem that Elvis had: What the !@#$ is in that
    collection?

    But before he knows it, he is at

    <T> int binarySearch(List<? extends Comparable<? super T>> list, T key). 

    That`s for Einstein, not Elvis.



git-svn-id: https://samskivert.googlecode.com/svn/trunk@1895 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-02 01:08:38 +00:00
ray 7cdbbd5fd7 Modified the behavior of truncate() that takes a third parameter:
the string is tested against maxLength, but is trimmed at a point
such that the result string will be maxLength after the addition of
the 'append' parameter.

I'm pretty sure nothing (around these parts) depended on the old behavior.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1894 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-09-01 01:00:12 +00:00
ray b053107fd8 A standard generic Predicate.
Sometimes we used the apache predicate, sometimes we rolled our own.
I'm rolling our own now because I want generic support.

Implementation details are subject to change, but two that we may want
to discuss sooner than later:

- I called the arbitration method "isMatch()", but almost went with
  "evaluate()" and considered "is()".
- I made Predicate an abstract class rather than an interface because I felt
  it was cool to be able to create filtered Iterators or views of collections
  using the Predicate.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1893 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-28 18:36:18 +00:00
ray 308f771857 Remove by reference as well.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1892 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-25 01:28:13 +00:00
ray 3351e80335 Implement indexOf and lastIndexOf using reference equality.
For observer lists, we do not care if two observers happen to
implement equals() such that they agree to be the same, we care 
only if they're the exact same observer.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1891 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-25 01:22:03 +00:00
mdb e00883856e Favor dynamic controller method dispatch with an unadulterated method name. We
used to prepend "handle" to an action and then look up the method (which we
still support) but now we also check for a method just named directly after the
action.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1890 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-24 18:20:27 +00:00
ray 6bb4640f0a This notation appears to be legal in jdk1.5.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1889 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-21 21:35:54 +00:00
ray d0cfcca2fa Don't do anything if there are no observers to notify.
Shrink our working array if it's much larger than it needs to be.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1888 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-21 21:31:44 +00:00
ray f2d299dc77 Allow unit names to be specified.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1887 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-14 18:05:54 +00:00
mdb 14de52cffb As Ray points out, there is danger in allowing any sort of iterating if we
automatically clear entries on get(). Since the point of this is to be a cache
and not to be iterable, we will simply remove all but the safe and necessary
functionality to keep people out of trouble.

Keep it simple! Put things it, get them out. Or not.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1886 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-11 01:24:10 +00:00
mdb cc1f0b34ab Implemented a map that maintains soft references to its values so that they may
be garbage collected. If you iterate over the keys, values or entries, you have
to cope with interleaved null values, doing the "right" thing there is a bit
PITA and iterating over the cache is wacky anyway because size() will most
likely never be right (unless we validated every entry in the cache at the time
you called size() which is also wacky).


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1885 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-08-10 23:05:45 +00:00
ray 4fcc4a60eb git-svn-id: https://samskivert.googlecode.com/svn/trunk@1884 6335cc39-0255-0410-8fd6-9bcaacd3b74c 2006-08-08 20:07:47 +00:00
mdb 652ad810f4 Catch any runtime exceptions also thrown by invokePersist().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1883 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-07-28 01:31:28 +00:00
mdb 31546d18bd Two extensions of Invoker.Unit that encapsulate a pattern we frequently find
ourselves repeating.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@1882 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-07-27 17:35:12 +00:00
andrzej cddcfa858e Added marshaller for longs.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1881 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-07-25 18:32:02 +00:00
ray 05054b0d09 Removed bogus line that was a result of a copy/paste error. Ancient!
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1880 6335cc39-0255-0410-8fd6-9bcaacd3b74c
2006-07-25 17:49:55 +00:00