Use of @OneToMany or @ManyToMany targeting an unmapped class Exception in hibernate
<p>Forgive me since I am rookie to hibernate and other answers on similar questions didn't quite fix this issue(I am sure my issue is quite basic). I am trying to have a OneToMany and ManyToOne mapping in my persistence classes.
I have following tables:</p>

<pre><code>city (
    id INT AUTO_INCREMENT,
    name VARCHAR(255),
)

pincode (
    id INT AUTO_INCREMENT,
    pincode VARCHAR(6),
    city_id INT FOREIGN KEY fk_city_id ON city(id)
)

area (
    id INT AUTO_INCREMENT,
    name VARCHAR(255),
    pincode_id INT FOREIGN KEY fk_pincode_id ON pincode(id)
)
</code></pre>

<p>The following persistence class I wrote:
For City:</p>

<pre><code>@Table(name="city")
@Entity
City {
    @Id
    private Integer id;

    @Column(name="name")
    private String name;
}
</code></pre>

<p>For PinCode:</p>

<pre><code>@Table(name="pincode")
@Entity
PinCode {
    @Id
    private Integer id;

    @Column(name = "pincode")
    private String pinCode;

    @ManyToOne
    @JoinColumn(name = "city_id")
    private City city;  //Multiple pincodes may be mapped to one city

    //One pincode may have multiple areas
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "pincode_mapping")
    @Fetch(value = FetchMode.SELECT)
    private List&lt;Area&gt; area;
}
</code></pre>

<p>For Area:</p>

<pre><code>@Entity
Area {
    @Id
    private Integer id;

    @Column(name = "name")
    private String name;

    @ManyToOne(fetch = FetchType.EAGER, targetEntity = PinCode.class)
    @Column(name = "pincode_id")
    private PinCode pinCode;    //Multiple areas may be mapped to one pincode

}
</code></pre>

<p>Facing the following exception:</p>

<pre><code>Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with
name 'sessionFactory' defined in class path resource [applicationContext-resources.xml]: Invocation of init method failed; 
nested exception is org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: com.mycompany.model.PinCode.area[com.mycompany.model.Area]
</code></pre>