title: IllegalArgumentException, getter method of property, avoiding redundant data
body: <p>I am trying to add new trip and place into database. There is relation between them many-to-one, so that one place can be assigned into many places. Place is adding correctly, but during adding trip there is this exception... 
  I know there has been a lot similiar topics, but none of them helped me solving this problem. </p>
  
  <pre><code>ERROR: HHH000122: IllegalArgumentException in class: pl.th.java.biuro.hibernate.Place, getter method of property: idPlace
  Exception found while adding new trip: IllegalArgumentException occurred calling getter of pl.th.java.biuro.hibernate.Place.idPlace
  org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of pl.th.java.biuro.hibernate.Place.idPlace
  at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:192)
  </code></pre>
  
  <p>Hibernate trip mapping:</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="pl.th.java.biuro.hibernate.Trip" table="Trip"&gt;
      &lt;id column="idTrip" name="idTrip" type="int"/&gt;
      &lt;property column="date" name="date" type="date"/&gt;
      &lt;property column="cost" name="cost" type="int"/&gt;
      &lt;property column="profit" name="profit" type="int"/&gt;
      &lt;property column="organisator" name="organisator" type="string"/&gt;
      &lt;property column="period" name="period" type="int"/&gt;
      &lt;property column="food" name="food" type="string"/&gt;
      &lt;property column="transport" name="transport" type="string"/&gt;
      &lt;property column="persons" name="persons" type="int"/&gt;
      &lt;property column="kidsAmount" name="kidsAmount" type="int"/&gt;
      &lt;property column="idHotel" name="idHotel" type="int"/&gt;
      &lt;many-to-one name="idPlace" column="idPlace" class="pl.th.java.biuro.hibernate.Place" not-null="true" /&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p>Hibernate place mapping:</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="pl.th.java.biuro.hibernate.Place" table="Place"&gt;
      &lt;id column="idPlace" name="idPlace" type="int"&gt;
          &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property column="country" name="country" type="string"/&gt;
      &lt;property column="city" name="city" type="string"/&gt;
      &lt;property column="island" name="island" type="string"/&gt;
      &lt;property column="information" name="information" type="string"/&gt;
  &lt;/class&gt;
  </code></pre>
  
  <p></p>
  
  <p>Trip class:</p>
  
  <pre><code>public class Trip {
  
  private int idTrip;
  private int idPlace;
  private int idHotel;
  private Date date;
  private int cost;
  private int profit;
  private String organisator;
  private int period;
  private String food;
  private String transport;
  private int persons;
  private int kidsAmount;
  
  private String ownerName;
  private String ownerLastName;
  
  private Place place;
  
  public Trip() {
  
  }
  
  public Trip(int idTrip, Date date, int cost, int profit, String organisator, int period, String food, String transport, int persons, int kidsAmount) {
      this.idTrip = idTrip;
      this.date = date;
      this.cost = cost;
      this.profit = profit;
      this.organisator = organisator;
      this.period = period;
      this.food = food;
      this.transport = transport;
      this.persons = persons;
      this.kidsAmount = kidsAmount;
  }
  
  public Trip(int idTrip, Date date, int cost, int profit, String organisator, int period, String food, String transport, int persons, int kidsAmount, String ownerName, String ownerLastName, Place place) {
      this.idTrip = idTrip;
      this.date = date;
      this.cost = cost;
      this.profit = profit;
      this.organisator = organisator;
      this.period = period;
      this.food = food;
      this.transport = transport;
      this.persons = persons;
      this.kidsAmount = kidsAmount;
      this.ownerName = ownerName;
      this.ownerLastName = ownerLastName;
      this.place = place;
  }
  
  /**
   * @return the idTrip
   */
  public int getIdTrip() {
      return idTrip;
  }
  
  /**
   * @param idTrip the idTrip to set
   */
  public void setIdTrip(int idTrip) {
      this.idTrip = idTrip;
  }
  
      /**
   * @return the place
   */
  public Place getPlace() {
      return place;
  }
  
  /**
   * @param place the place to set
   */
  public void setPlace(Place place) {
      this.place = place;
  }
  And other get/set methods...
  </code></pre>
  
  <p>Place class:</p>
  
  <pre><code>public class Place {
  
  
  private int idPlace;
  private String country;
  private String city;
  private String island;
  private String information;
  
  public Place() {
  
  }
  
  public Place(String country, String city, String island, String information) {
      this.country = country;
      this.city = city;
      this.island = island;
      this.information = information;
  }
  
  /**
   * @return the idPlace
   */
  public int getIdPlace() {
      return idPlace;
  }
  
  /**
   * @param idPlace the idPlace to set
   */
  public void setIdPlace(int idPlace) {
      this.idPlace = idPlace;
  }
  </code></pre>
  
  <p><strong>EDIT1</strong>
  Adding proper entities is working for me now, but I am wondering is there any way to avoid redundant data? For example, I add a trip and a place X connected with this trip. When I add another trip, but in this same place - X, this place is added again into my database. How can I avoid such action?</p>