[英]App Engine JDO Persistent class migrate from com.google.appengine.api.datastore.Key to Long
I've been working to get an app that runs on GAE to support other platforms like a single instance of a Jetty Server. 我一直在努力获得在GAE上运行的应用程序,以支持其他平台,例如Jetty Server的单个实例。
A Persistent JDO class with a primary key defined like this: 具有主键定义的持久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;
The key is a com.google.appengine.api.datastore.Key; 密钥是com.google.appengine.api.datastore.Key;
Short of doing a data migration, is it possible to somehow convert this field to a Long or something that's supported in other platforms like mySQL and not needing to use an app-engine library? 如果不进行数据迁移,是否有可能以某种方式将此字段转换为Long或其他平台(例如mySQL)支持的内容,而无需使用应用程序引擎库?
ok looks like it's possible to just convert it to a string and i'm good to go. 好的,看起来有可能将其转换为字符串,我很高兴。
@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;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.