-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: mappingException : Could not determine type for
PostPosted: Wed Sep 19, 2007 6:11 am 
Newbie

Joined: Wed Mar 22, 2006 5:43 am
Posts: 15
Location: Belgium
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 ...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 20, 2007 3:55 am 
Newbie

Joined: Wed Mar 22, 2006 5:43 am
Posts: 15
Location: Belgium
Code:
      <many-to-one name="parent" class="my.package.Document"/>
      <property name="parent"/>


damn took me a long time to find the obvious ... duplicate entry of 'parent'


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.