2013-10-17 37 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; 
相關問題