-->
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.  [ 5 posts ] 
Author Message
 Post subject: invalid child element 'property'
PostPosted: Thu Dec 01, 2005 7:43 pm 
Newbie

Joined: Thu Dec 01, 2005 7:32 pm
Posts: 2
I am new to NHibernate so please be patient with me. I keep getting the following error when I try to do and addAssembly to a configuration.:

The element 'class' in namespace 'urn:nhibernate-mapping-2.0' has invalid child element 'property' in namespace 'urn:nhibernate-mapping-2.0'. List of possible elements expected: 'urn:nhibernate-mapping-2.0:meta urn:nhibernate-mapping-2.0:jcs-cache urn:nhibernate-mapping-2.0:cache urn:nhibernate-mapping-2.0:id urn:nhibernate-mapping-2.0:composite-id'.

The hbx file looks like this:

<?xml version="1.0" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" namespace="CommonAuditingDAL" assembly="CommonAuditingDAL">
<class name="ApplicationSpecificField_Table" table="APPLICATION_SPECIFIC_FIELD_DEF">
<id name="AppSpecificFieldID" column="app_specific_field_id">
<generator class="genid"/>
</id>
<property name="SourceApplication" column="source_application"/>
<property name="FieldNumber" column="field_number"/>
<property name="FieldName" column="field_name"/>
<property name="FieldDescription" column="field_description"/>
<property name="LastUpdateUser" column="last_update_user" />
<property name="LastUpdateDate" column="last_update_date" />
</class>
</hibernate-mapping>

Any ideas or suggestions?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 10:45 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
to me the error sounds like is trying to load other mapping which does not have the id element following the class tag. What other mappings do you have in that assembly?

cheers,
Radu


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 12:49 pm 
Newbie

Joined: Thu Dec 01, 2005 7:32 pm
Posts: 2
Radu, you nailed it. That was exactly what was going on.

Just out of curiosity, do you use a tool to generate the hbx files? I've built the ones I'm using by hand just to see what is in them, but this would very quickly become tedious and error prone work.

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 02, 2005 4:20 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
Just curious, what is the "genid" generator class?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 03, 2005 9:56 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
I'm building the mapping files by hand. I didn't find any reliable tool that I can use with NHibernate. It can be tedious, yes, but I have total control, doing mistakes, but learning a lot. One can't say it masters (N)Hibernate without a very good understanding of the mapping process.

cheers,
Radu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.