Hello,


I have a really annoying issue in some of my entity classes. Perhaps this is old news for some people but I haven't figured out how to solve this. A lot classes have "<many-to-one> attribute target should be entity" and "<one-to-many> attribute target should be entity" errors. Actually they're just warnings because everything goes ok at compile time and runtime. I only get these on getter methods. Could you please tell me what am I missing or what extra configuration should I make in order to resolve these warnings?



Here is an example of two relationships that generate such warnings:


The hibernate configuration file:


<hibernate-mapping>
<class name="com.treert.people.Person" table="Person">

....

<many-to-one name="primaryName" class="com.treert.people.Name" column="Primary_Name_Id" cascade="save-update"/>

<set name="names" cascade="save-update">
<key column="Person_Id"/>
<one-to-many class="com.treert.people.Name"/>
</set>

</class>
</hibernate-mapping>


The getters in the Person class:


-- this is one of the methods that generates a "<many-to-one> attribute target should be entity" warning

public Name getPrimaryName() {
return primaryName;
}


-- this is one of the methods that generates a "<one-to-many> attribute target should be entity" warning

public Set<Name> getNames() {
return names;
}


Thank you ...