title: Hibernate Annotations not working for getters but working for attributes
body: <p>I am facing problem with hibernate annotations.For the code shown below I have a hotel class ,customer class and i use customerhotelbooking to keep track of which customer has booked which hotel and vice-versa.
  but when i place annotations on getters of hotel and customer it gives an exception and surprisingly it works when i place it on attributes.
  can somebody tell why is it so??</p>
  
  <pre><code>`Caused by: org.hibernate.MappingException: Could not determine type for: com.xebia.hotelBooking.domain.Customer, at table: CustomerHotelBooking, for columns: [org.hibernate.mapping.Column(customer)]
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:290)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:274)
   at org.hibernate.mapping.Property.isValid(Property.java:217)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:464)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:236)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1193)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1378)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
   at org.jboss.seam.persistence.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:165)
   at org.jboss.seam.persistence.HibernateSessionFactory.startup(HibernateSessionFactory.java:79)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
   at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
   at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
   at org.jboss.seam.Component.newInstance(Component.java:2132)`
  </code></pre>
  
  <p>I have Hotel bean as shown `</p>
  
  <pre><code>@Id
   @GeneratedValue
   private int id;
  
   private String description;
  
   private String city;
  
   private String name;
  
   private String rating ;
  
   private int isBooked; 
   `
  </code></pre>
  
  <p>Cusomer bean as `</p>
  
  <pre><code>        @Id
   @GeneratedValue
   private int id;
  
   private String userName;
  
   private String password;
  </code></pre>
  
  <p>`</p>
  
  <p>and CustomerHotelBooking class as</p>
  
  <pre><code>       @Id
   @GeneratedValue
   private int id;
  
   private Hotel hotel;
  
   private Customer customer;
  
  
          @ManyToOne
   @Cascade(value = { CascadeType.ALL })
   public Customer getCustomer() {
    return customer;
   }
  
   /**
    * @param customer the customer to set
    */
   public void setCustomer(Customer customer) {
    this.customer = customer;
   }
  
   /**
    * @return the user
    */
  
  
  
   /**
    * @return the hotel
    */
          @ManyToOne
   @Cascade(value = { CascadeType.ALL })
   public Hotel getHotel() {
    return hotel;
   }
  
   /**
    * @param hotel
    *            the hotel to set
    */
   public void setHotel(Hotel hotel) {
    this.hotel = hotel;
   }
  </code></pre>