Hibernate version:
3.2.3
Mapping documents:
Code:
<hibernate-mapping>
<class name="my.package.Document" table="document">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="name"/>
<property name="created"/>
<property name="updated"/>
<property name="location"/>
<many-to-one name="owner" class="my.package.User" not-null="true"/>
<property name="contentType"/>
<property name="size"/>
<many-to-one name="parent" class="my.package.Document"/>
<property name="parent"/>
<property name="directory"/>
</class>
</hibernate-mapping>
Code:
public class Document {
private Integer id = 0;
private String name = null;
private Date created = null;
private Date updated = null;
private File file = null;
private long size = 0;
private User owner = null;
private String contentType = CONTENT_TYPE_UNDEF;
private Document parent = null;
private boolean directory = false;
... getters and setters
Full stack trace of any exception that occurs:Code:
org.hibernate.MappingException: Could not determine type for: my.package.Document, for columns: [org.hibernate.mapping.Column(parent)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
i had it working when the property 'parent' was still 'private Integer parentId = 0'
but i thought it would be nicer to use the Object directly ... but now i get this error and i have no clue ...