1

このによると、Google App Engine の JDO 実装は JDO @Unique アノテーションをサポートしていません。これはまだですか?

たとえば、次のクラスがあります。

@PersistenceCapable
public class User {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    @Persistent
    private String email;
    @Persistent
    private String sessionToken;
    ...
}

は明らかにユニークですが、ユニークなとkeyも欲しかったのです。@Unique がサポートされていない場合、シンプルさとパフォーマンスの両方の観点から、この動作を「シミュレート」する最良の方法は何ですか?emailsessionToken

4

1 に答える 1

1

The issue linked from that can't be clearer. JDO is not the problem .... the problem is the underlying GAE/Datastore database not supporting it (and if the datastore doesn't support it then there's no way an API can magically impose something in the datastore). That issue also gives a workaround

于 2013-03-29T08:41:50.390 に答える