enum properties

3 views
Skip to first unread message

Marcus Better

unread,
Sep 13, 2010, 4:43:05 AM9/13/10
to inconse...@googlegroups.com
Hi,

I have some properties with enum types in my domain objects, but it
appears they are not supported yet. Would that be complicated to do?

Cheers,

Marcus

Message has been deleted

Marcus Better

unread,
Sep 13, 2010, 11:01:07 AM9/13/10
to inconse...@googlegroups.com
On 2010-09-13 16:56, Cory Hacking wrote:
> Can you give me an example of what you're doing? There may be some nuance
> that's not supported, but I am using them regularly.

Sure. This test case fails:

diff --git
a/spring-datastore-core/src/test/groovy/org/springframework/datastore/mapping/GormMappingSyntaxTests.groovy
b/spring-datastore
index 0c18f77..daf51ac 100644
---
a/spring-datastore-core/src/test/groovy/org/springframework/datastore/mapping/GormMappingSyntaxTests.groovy
+++
b/spring-datastore-core/src/test/groovy/org/springframework/datastore/mapping/GormMappingSyntaxTests.groovy
@@ -44,7 +44,16 @@ class GormMappingSyntaxTests {
def strategy = context.mappingSyntaxStrategy
def props = strategy.getPersistentProperties(TestEntity,context)
assert props.size() == 3
+ }

+ @Test
+ void enumProperties() {
+ def context = new TestMappingContext()
+ def e = context.addPersistentEntity(TShirt)
+ def strategy = context.mappingSyntaxStrategy
+ def props = strategy.getPersistentProperties(TShirt, context)
+ assert props.size() == 2
+ assert e.getPropertyByName('sz')
}

@Test
@@ -157,3 +166,11 @@ class SecondEntity {
static transients = ['bar']
}

+enum Size {
+ SMALL, MEDIUM, LARGE
+}
+
+...@grails.persistence.Entity
+class TShirt {
+ Size sz
+}

Cory Hacking

unread,
Sep 13, 2010, 11:10:04 AM9/13/10
to Inconsequential
Sorry Marcus, I thought you were referring specifically to the gorm-
couchdb plugin. I have started adding couchdb support to
inconsequential, but it'll be a little while before I get it ready to
release.

-Cory
Reply all
Reply to author
Forward
0 new messages