【问题标题】:App Engine JDO Persistent class migrate from com.google.appengine.api.datastore.Key to LongApp Engine JDO Persistent 类从 com.google.appengine.api.datastore.Key 迁移到 Long
【发布时间】:2013-10-17 18:24:16
【问题描述】:

我一直在努力开发一个在 GAE 上运行的应用程序,以支持其他平台,例如 Jetty 服务器的单个实例。

具有如下定义的主键的持久 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)支持且不需要使用应用引擎库的内容?

【问题讨论】:

    标签: java mysql google-app-engine


    【解决方案1】:

    好的,看起来可以将其转换为字符串,我很高兴。

    @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;
    

    【讨论】:

      猜你喜欢
      • 2013-03-01
      • 2011-07-15
      • 1970-01-01
      • 1970-01-01
      • 2015-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多