2013-10-17 34 views
0

我一直在努力获得在GAE上运行的应用程序,以支持其他平台(如单个Jetty Server实例)。App Engine JDO持久类从com.google.appengine.api.datastore.Key迁移到Long

持久JDO类具有这样定义了主键:

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false") 
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) 
public abstract class Foo implements Bar { 


    @PrimaryKey 
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) 
    protected Key key; 

的关键是com.google.appengine.api.datastore.Key;

缺少数据迁移,是否有可能以某种方式将此字段转换为Long或其他平台(如mySQL)支持并且不需要使用应用程序引擎库?

回答

0

确定看起来像它可能只是将其转换为字符串,我很好去。

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "false") 
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) 
public abstract class EntityStore implements Entity { 


    @PrimaryKey 
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) 
    protected String key; 
相关问题