Hello,

I have 2 base classes and a child class mapped as joined-subclass
(Entity (not mapped) <- Contact <- Company)

The Entity class got the fields "Id" and "Version"

Here's the mapping :

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-
access="">
    <class name="Contac" table="`Contact`" xmlns="urn:nhibernate-
mapping-2.2">
        <id name="Id" type="Guid" column="Id"><generator
class="guid.comb" /></id>
        <version name="Timestamp" type="binary" generated="always"
unsaved-value="null">
            <column not-null="false" sql-type="timestamp"
name="Timestamp" /></version>
        <joined-subclass name="Company">
            <key column="Id" />
            <property name="Name" type="String"><column name="Name" /
></property>
        </joined-subclass>
    </class>
</hibernate-mapping>

When I create a new company, I got no problme but when I update an
existing one I got this SQL exception :

 UPDATE [Contact] SET  WHERE Id = ? AND Timestamp = ?] --->
System.Data.SqlClient.SqlException: Incorrect syntax near the keyword
'WHERE'.

If I remove the Version field, the update is successfull. I understand
that NH tries to update the Contact table to get the new value of the
Version field but since my base class has no update (and so the SET is
empty ) I got this error.

Should I replicate my Version mapping inside the joined-class/tables
instead ?

Matthieu


--~--~---------~--~----~------------~-------~--~----~
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