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 3997978
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:28:05+00:00 2026-05-20T07:28:05+00:00

I have two value objects, Calendar and Event, that are persistent. Calendar has a

  • 0

I have two value objects, Calendar and Event, that are persistent. Calendar has a property that consists in a list of events, with a one to many relationship. Calendar is a parent of Events as shown below.

@Persistent
@Element(dependent = "true")
private List<Event> events;

Now, I would like to be able to retrieve via JDO query, Events corresponding to a Calendar, based on the Calendar object key. I am using encodedKey for both classes.

I want to run the query on the Event entity and not just retrieve the whole Calendar object, because I want to be able to retrieve only a set of events, for pagination purposes.

I tried to do this in any possible way, could not figure out how to query by parent key.

Any help would be appreciated.

  • 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-05-20T07:28:06+00:00Added an answer on May 20, 2026 at 7:28 am

    A few notes:

    List properties in Entities (like your List<Event> events) are stored as a serialized ProtocolBuffer. The problem is:

    1. If this property is indexed, they are limited to 5000 elements.

    2. Every time you query the list, whole list needs to be deserialized. This is the answer to your question if you can selectively retrieve list elements: you can’t.

    3. If you have multiple indexed list properties in entity then this can lead to Exploding Indexes.

    If you want to understand internals of GAE datastore then this vido is a must: http://www.youtube.com/watch?v=AgaL6NGpkB8

    Solutions:

    1. Use a solution from Slatkin’s video: make Calendar a parent (in datastore terms) of Event. Then add a parent condition to query: Query.setAncestor(Key calendarKey).

      Update: Entity parent relationship should be used to create “entity groups”, e.g. a unit on which transactions are scoped.

    2. Reverse the situation: Create Event entity that has Calendar property that points to Calendar to which event belongs. Then you can simply query Events that have ‘calendar == calendarKey`.

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

Sidebar

Related Questions

I have two List<T> objects: For example: List 1: ID, Value where Id is
I have two related objects: ProgramSession and ProgramTask, with a one-to-many relationship. A ProgramSession
I have a listbox that is populated with a list of objects that has
Say I have core data objects of type obj that has a property propertyA
I have two iterators, a list and an itertools.count object (i.e. an infinite value
I have two implementations of a method, one for value types and another for
I have two objects that contain some properties that are exactly the same (same
I have two IDbCommand objects that are created from an NHibernate session, and they
I have a List<> of objects containing two strings and a DateTime. I want
i have two mutable arrays that i am looping through when the objects are

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.