title: App Engine JPA Entity relationships
body: <p>I'm new to App Engine and trying to figure out how to use relationships between entities.
  I'm using JPA and having trouble to understand how to organize the relationships.</p>
  
  <p>I have three classes City, Hotel and Attraction. I want cities to be standalone and able to be created on it's own. Every city has a list of all available hotels in the city. The hotel always need a city and can only have one city. Attractions have to have a city, but a city doesn't need to know about the attractions. </p>
  
  <p>Classes:</p>
  
  <pre><code> @Entity(name = "City")
   public class City {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
      private String name;
  
      @OneToMany(??)
      private List&lt;Hotel&gt; hotels;
  
  
      //getters and setters
  }
  
  @Entity(name = "Hotel")
  public class Hotel {
  
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key key;
  
    private String name;
  
    @ManyToOne(??)
    private City city;
  }
  
  
  @Entity(name = "Attraction")
  public class Attraction {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
  
    private String name;
  
    @Unowned??
    private City city;
  
    //getters and setters
  }
  </code></pre>
  
  <p>I've been looking all over the web, but i can't find any good tutorials on this. Would really appreciate any pointers in the right direction!</p>