Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Id private Long listId;
- @Parent private Key<User> userKey;
- private String name;
- private String listPic = "http://localhost/default"; // There must be a default source for pic
- private int memberCount;
- public UserList() {
- }
- public UserList(Key<User> userKey, String name, int memberCount) {
- this.userKey = userKey;
- this.name = name;
- this.memberCount = memberCount;
- }
- public Long getListId() {
- return listId;
- }
- public void setListId(Long listId) {
- this.listId = listId;
- }
- public Key<User> getUserKey() {
- return userKey;
- }
- public void setUserKey(Key<User> userKey) {
- this.userKey = userKey;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getListPic() {
- return listPic;
- }
- public void setListPic(String listPic) {
- this.listPic = listPic;
- }
- public int getMemberCount() {
- return memberCount;
- }
- public void setMemberCount(int memberCount) {
- this.memberCount = memberCount;
- }
- }
- public List<UserList> getUserList(@Named("userId") Long userId){
- // Get userList where ancestor is userId
- return ofy().load().type(UserList.class).ancestor(Key.create(User.class, userId)).list();
- }
- Caused by: com.fasterxml.jackson.databind.JsonMappingException: Direct self-reference leading to cycle (through reference chain: java.util.HashMap["items"]->$Proxy32[0]->org.octabyte.zeem1.Datastore.UserList["userKey"]->com.googlecode.objectify.Key["root"])
Add Comment
Please, Sign In to add comment