glaforge/gaelyk — Issue #100: @Key Strings  Entity to POGO coercion is broken
Author: codeconsole
Created: 2012-01-06 20:10:38+00:00
State: open

import groovyx.gaelyk.datastore.Ignore
import groovyx.gaelyk.datastore.Key
import groovyx.gaelyk.datastore.Unindexed
import com.google.appengine.api.datastore.Entity
import groovy.transform.Canonical

@Canonical
class Person {
@Key String name
}

def scott = new Person('Scott')
println scott.name
def entity = scott as Entity
println entity.key.name
def scottClone = entity as Person
println scottClone.name

result:
Scott
Scott
null