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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:27:40+00:00 2026-05-23T22:27:40+00:00

I just wanna know how made a many to many relationship between two entity´s

  • 0

I just wanna know how made a many to many relationship between two entity´s using the low level api in the datastore, I’ve been looking but I could not find documentation that explains how to do this kind of relationship. i hope some one can help.

but if I have the entity A and entity B in a many to many relationship how can i stored in the datastore. i mean, This a good solution to store a many to many realtionship in the datastore or what is a good solution? this code is ok or is wrong?

Entity entityA = new Entity("TypeA");
entityA.setProperty("name", "nameUserA");

Entity entityB = new Entity("TypeA");
entityA.setProperty("name", "nameUserB");

ds.put(entityA);
ds.put(entityB);

Entity entityChild = new Entity("entityChild",entityAKey);
entityChild.setProperty("name","child");

 ds.put(entityChild);

Entity entityChild = new Entity("entityChild",entityBKey);
entityChild.setProperty("name","child");

 ds.put(entityChild);
  • 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-23T22:27:41+00:00Added an answer on May 23, 2026 at 10:27 pm

    AppEngine doesn’t provide any functionality for many-to-many relationship.

    You can emulate it, by creating your own entity, with two fields:

    class AtoBRelations {
      Key entityA 
      Key entityB
    }
    

    I’s common pattern to have an extra table for many-to-many relationship, even for other databases

    BTW, for most cases it will be not optimal solution. Optimal solution depends on how this many-to-many relation have to be used, and there is few different solutions

    for example there is second solution: you can store a list of related entities, like:

    class EntityA {
       List<Key> entitiesB
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wanna know using org.eclipse.jdt.core.dom.ASTParser if it is possible to parse only a
I am using a BufferedReader. I just wanna know how to clear the BufferedReader
i am using vb.net i just wanna ask if we can place a picture
I just wanna know how I get the value of a text field in
I just wanna know if it is possible to pause a playing SWF file
I just wanna know if there exists simple drawer (move up and down certain
I just wanna know how to do an if -statement in simple HTML. Like
I am new to LINQ and just wanna know; is there any application in
I am a new newbie to android. Just wanna know how could we create
just for knowledge sake, i wanna know that how good is to use a

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.