Created
August 15, 2014 18:43
-
-
Save husayt/8d4311dae659b61df383 to your computer and use it in GitHub Desktop.
Some Objectify question
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public class Person { | |
@Id | |
private Long id; | |
@Index | |
boolean archived; | |
PersonInfo personInfo; | |
} | |
public class PersonInfo { | |
@Container | |
Person person; | |
@Index(IfNotArchivedEmbed.class) | |
String name; | |
@Index(IfNotArchivedEmbed.class) | |
String surname; | |
protected static class IfNotArchivedEmbed extends PojoIf<PersonInfo> { | |
@Override | |
public boolean matchesPojo(PersonInfo pojo) { | |
return !pojo.person.isArchived(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem: in
matchesPojo
method inIfNotArchivedEmbed
class I get a NullPointer Exception when trying to obtain person instance. It seems @container field is not populated when accessed matchesPojo method on index,From other places