Allow primary keys to be any type, and test it.
authorMurray Cumming <murrayc@murrayc.com>
Fri, 30 Nov 2012 20:41:45 +0000 (21:41 +0100)
committerMurray Cumming <murrayc@murrayc.com>
Fri, 30 Nov 2012 20:41:45 +0000 (21:41 +0100)
commitd778a980d57acb673e17d2c218d1f835410a6eca
treee95306213ec584cef3989ee1cbf3cb4a4189db0f
parent76ee0b41be9bed663af39ae2c1094563c4a39b84
Allow primary keys to be any type, and test it.

        * src/main/java/org/glom/web/shared/TypedDataItem.java:
Add overrides for the other set*() methods, to set the type.
        Added getValue() which returns a generic Object.
* src/main/java/org/glom/web/server/SqlUtils.java:
buildSimpleWhereExpression(): Use TypedDataItem.getValue() instead of
getNumber().
        * src/test/java/org/glom/web/server/SelfHostExampleNonNumericPrimaryKeysTest.java:
Added this test, which is much like SelfHostExampleTest, but which uses this
test file, take from Glom:
        * src/test/resources/org/glom/web/server/test_example_music_collection_text_pk_fields.glom:
which has all the primary keys changes to text instead of numbers.

However, parts of the UI code still assume that primary keys are numbers.
ChangeLog
src/main/java/org/glom/web/client/place/DetailsPlace.java
src/main/java/org/glom/web/server/SqlUtils.java
src/main/java/org/glom/web/shared/TypedDataItem.java
src/test/java/org/glom/web/client/place/DetailsPlaceTest.java
src/test/java/org/glom/web/server/SelfHostExampleNonNumericPrimaryKeysTest.java [new file with mode: 0644]
src/test/resources/org/glom/web/server/test_example_music_collection_text_pk_fields.glom [new file with mode: 0644]