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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:20:20+00:00 2026-05-13T11:20:20+00:00

Right, I don’t know if I’m barking entirely up the wrong tree here –

  • 0

Right, I don’t know if I’m barking entirely up the wrong tree here – I’m finding JDO and the Google AppEngine a bit tricky to get the hang of. Anyway, here goes.

I have a class that contains another class as one of it’s internal variables (see player1)

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
   public class JDOGame 
   {    
    @PrimaryKey 
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) 
    private Long id; 

    @Persistent
    private String map; 

    @Persistent
    private RPCDataPlayer player1;

   // getters, setters, constructors etc...
   }

The class RPCDataPlayer is Serializable and very basic….

public class RPCDataPlayer implements IsSerializable 
{
    public String name;
    public int id;

        // getters & setters & constructors oh my

        public int getId() { return id; }
}

So, my question is…how do I create a query where I can get all the JDOGames that contain an RPCDataPlayer with id = x?

I can’t do a query like…

SELECT FROM JDOGame.class.getName() WHERE player1.getId() == x

…so what techniques or suggestions do people have for this to work?

Thanks in advance.

  • 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-13T11:20:20+00:00Added an answer on May 13, 2026 at 11:20 am

    The Google App Engine Database is not a relational database so you can not do joins. You can persist RPCDataPlayer as a table.

    @PersistenceCapable(identityType = IdentityType.APPLICATION)
    public class RPCDataPlayer {
    
        @PrimaryKey
        @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
        private Key key;
    
        @Persistent(mappedBy = "player1")
        private List<JDOGame> jdoGames = new ArrayList<JDOGame>();
    
        @Persistent
        public String name;
    
        @Persistent
        public int id;
    
        public int getId() {
            return id;
        }
    
        public Key getKey() {
            return key;
        }
    
        public void setJdoGames(List<JDOGame> jdoGames) {
            this.jdoGames = jdoGames;
        }
    
        public List<JDOGame> getJdoGames() {
            return jdoGames;
        }
    
    }
    

    And then you can just query this like this.

    SELECT FROM RPCDataPlayer.class.getName() WHERE id == x
    

    Once you have and instance of RPCDataPlayer you can get get JDOGame by calling:

    List<JDOGame> jdoGames = rpcDataPlayer.getJdoGames();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if it's right to ask this question here or not. I'm
I don't know what's wrong. It seems like I'm doing this right. I'm trying
I don't know if the title is right. The thing is that I have
I don't know if I am on right track or not still asking this
I don't know if I'm thinking of this the right way, and perhaps somebody
I don't know if variadic is actually the right word, but I'm talking about
I don't know if this is a right question, but i need to understand
I don't know if this is the right place to ask a question like
I don't know if Nested python decorator? is the right way to state this
I don't know if I'm saying this right, so I'll just ask by explaining

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.