2010-05-03 5 views
1

Comment créer une clé parent qui est une chaîne codée? Exemple:Clé parent de type chaîne codée?

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; 
} 

ouais Je ne sais pas comment faire mParentEncKey un type de chaîne codée, parce que l'étiquette « clé » est déjà utilisé? J'aurais besoin de quelque chose comme ?:

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

pas sûr - est-ce possible?

Merci

Répondre

1

J'ai trouvé une solution pour cela, vous pouvez maintenant les relations map propriété de manière portable, consultez blog.

Questions connexes