Hi all,
Ok, I'm saving data to 4 tables in an application:
One table uses a db generated key, the other three use assigned keys.
The table which uses a db generated key saves fine, and one of the tables that
use an assigned key also saves with out issue.
My issue is with both of the other two tables.
The table which uses an assigned key's mapping and saves fine is below:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="SalamanderSoft.OnlineReporting.Core"
namespace="SalamanderSoft.OnlineReporting.Core.Domain.CachedDataMapper">
<class name="ExtractedPersonData">
<composite-id>
<key-many-to-one name="Type"/>
<key-property name="ExtractedPersonDataID"/>
</composite-id>
<property name ="Forename" not-null="true"/>
<property name ="Surname" not-null="true"/>
<property name ="Data" not-null="true"/>
</class>
</hibernate-mapping>
The following two tables don't seem to save at all.
There appears to be no problem with the configuration as the config is created
with out issue and the schema update works fine.
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="SalamanderSoft.OnlineReporting.Core"
namespace="SalamanderSoft.OnlineReporting.Core.Domain.CachedDataMapper">
<class name="ExtractedPhotoData">
<id name="ExtractedPhotoDataID">
<generator class="assigned"/>
</id>
<property name="Image" not-null="true"/>
</class>
</hibernate-mapping>
And now the second table:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="SalamanderSoft.OnlineReporting.Core"
namespace="SalamanderSoft.OnlineReporting.Core.Domain.CachedDataMapper">
<class name="ExtractedData">
<composite-id>
<key-many-to-one name="Type"/>
<key-property name="ExtractedDataID"/>
</composite-id>
<property name ="Data" not-null="true"/>
</class>
</hibernate-mapping>
Does anyone have any ideas where the problem could be.
My code that does a save is below:
public T Save<T>(T entity) where T : class
{
if (entity == null)
{
throw new ArgumentNullException("Entity");
}
object id = session.Save(entity);
return session.Get<T>(id);
}
Thanks for any help.
Regards
Sean.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.