我一直在努力获得一个在GAE上运行的应用程序,以支持其他平台,例如Jetty Server的单个实例。
持久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)支持的内容,而不需要使用app-engine库?
答案 0 :(得分: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;