views:

15

answers:

0

Hello,

I would like to build a query which looks like that query.setFilter("parentID == 123 && langauge == en")

because I have an owned OneToMany Relationshiop between Article and Description and I am looking for an effektiv way to get a specific description.

Thanks, Ralph

@PersistenceCapable(identityType = IdentityType.APPLICATION) public class ArticleDatastore { ... @Persistent private List descriptions = new ArrayList(); ... }

Description is using as Key the ArticleID + his own field language

@PersistenceCapable(identityType = IdentityType.APPLICATION) public class Description { ... @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private String language;

public Description(Article article, String country, String language) {
 this.id = KeyFactory.createKey(article.getId(), Description.class.getSimpleName(), language);
 this.language = language;
}

... }