It was probably an implementation detail (I've seen the XSD but not the
parser).
Anyway, considering there's a well-defined schema (nhibernate-mapping.xsd)
that you can use at design time to catch errors and provide intellisense,
what would be the benefit in supporting arbitrary ordering of the elements?

I'm not saying the current behavior is the only possibility, only that it
works without problems, so there's no reason to invest in changing it (one
could also argue that it IS important to define the id, discriminator and
version before "regular" properties...)

   Diego


On Mon, Nov 30, 2009 at 08:09, Mark <[email protected]> wrote:

> It appears that <id> must be the first thing defined in a <class>,
> then any <version> or <timestamp>, then the properties.  Seems a bit
> arbitrary to me given the declarative nature of the mapping process.
> Can't find this subtlety documented anywhere.  Is there a good
> technical reason for not allowing me to order the sub-elements of
> <class> as I see fit?
>
> Example:
>
>   <class name="Trade" table="trade">
>      <id name="Id" column="id">
>         <generator class="native"/>
>      </id>
>      <version name="Revision" type="timestamp" generated="always" />
>      <property name="Data" column="data"/>
>      <set name="Details" table="trade_details" lazy="false"
> cascade="all">
>        <key column="trade_id"></key>
>        <one-to-many class="TradeDetail"/>
>      </set>
>   </class>
>
> This works, but if you move <version> or <id> down below, it fails
> with XmlSchema error: Invalid start element.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.


Reply via email to