Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8019105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:17:09+00:00 2026-06-04T21:17:09+00:00

Hi I am using Objectify and I have the following: public static final Key<A>

  • 0

Hi I am using Objectify and I have the following:

public static final Key<A> TopParent = new Key<A>(A.class,1)

class A {
}

class B {

 @Parent
 Key parent;

 Key referenceKeyToC 
}

class C {
  @Parent 
  Key parent;
}

I am then trying to get ALL B-objects in an TRANSACTION with Ancestor(TopParent) and some Reference Key C – but it keep returning 0 elements.

This is my query:
List> bKeys = oft.query(B.class).ancestor(TopParent).filter(“referenceKeyToC”, new Key(C.class), b.referenceKeyToC).listKeys();

When I SAVE B it has BOTH parent and referenceKeyToC set correctly ..

IF I run the Query without the Key Filter like:
List> bKeys = oft.query(B.class).ancestor(TopParent).listKeys();

It returns all the B-objects – and those B-objects all Contains their referenceKeyToC
Any ideas??

Jesper

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T21:17:10+00:00Added an answer on June 4, 2026 at 9:17 pm

    This is almost certainly an indexing issue. In order for that query to work, you must define two indexes:

    • A single-property index on referenceKeyToC
    • A multi-property index on {ancestor, referenceKeyToC}

    In Objectify 3.x, properties have single-property indexes by default, but if you have added @Unindexed to the class B then you need to put @Indexed on referenceKeyToC.

    The multi-property index is defined in datastore-indexes.xml. If you run this query in dev mode, the environment should provide you with the snippet of xml needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using 10gen mondgo db c# driver.I have following class [BsonId] public ObjectId Id {
I am using spring and I have a child model with a objectify key
I have the following code in my application: using (var database = new Database())
I have the following object model: class ObjectA{ public string Description {get;set;} } class
I have the following class: public class UserSettings : IMongoEntity { [BsonId] public ObjectId
I have to migrate the following code from Jackson 1.9 to 2.0 public class
I am new to Objective-C and iPhone I have to sort a NSDictionary using
I have the following which opens TextEdit using a Cocoa objective-c application: [[NSWorkspace sharedWorkspace]
So, I have the following tables: Using LLBLGen 2.6 (Adapter Version - No Linq),
I have the following ViewController class #import <UIKit/UIKit.h> @interface SampleViewController : UIViewController { IBOutlet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.