Parent key of type encoded string?

Posted by user246114 on Stack Overflow See other posts from Stack Overflow or by user246114
Published on 2010-05-03T15:54:29Z Indexed on 2010/05/03 15:58 UTC
Read the original article Hit count: 170

Filed under:

Hi,

How do we create a parent key which is an encoded string? Example:

class Parent {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String mEncKey;
}

class Child {

    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
    private String mEncKey;

    // In the doc examples, they have Key as the type here.
    @Persistent
    @Extension(vendorName="datanucleus", key="gae.parent-pk", value="true")
    private String mParentEncKey;
}

yeah I'm not sure how to make mParentEncKey an encoded string type, because the 'key' label is already being used? I would need something like?:

key="gae.parent-pk.encoded-pk"

not sure - is that possible?

Thanks

© Stack Overflow or respective owner

Related posts about google-app-engine