This is what I have so far:
My DB table:
Code:
CREATE TABLE [dbo].[T_app_vuvh_605_xmlexp_sys_ui_report_vodovody] (
[id_report] int,
[id_vodovod] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS
)
ON [PRIMARY]
GO
NHibernate mapping:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-access="property">
<class name="ReportingBusiness.Sys_Ui_Report_Vodovody, ReportingBusiness" table="T_app_vuvh_605_xmlexp_sys_ui_report_vodovody">
<composite-id>
<key-property name="Id_Report" column="id_report"/>
<key-property name="Id_Vodovod" column="id_vodovod"/>
</composite-id>
</class>
</hibernate-mapping>
C# Class "Sys_Ui_Report_Vodovody":
Code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Text;
namespace ReportingBusiness
{
public class Sys_Ui_Report_Vodovody : BusinessBase
{
private int id_report;
private string id_vodovod;
public Sys_Ui_Report_Vodovody()
{
}
public int Id_Report
{
get { return id_report; }
set { id_report = value; }
}
public string Id_Vodovod
{
get { return id_vodovod; }
set { id_vodovod = value; }
}
public override bool Equals(object obj)
{
return base.Equals(obj);
}
public override int GetHashCode()
{
return base.GetHashCode();
}
}
}
When I try to save this object into the DB, everything seems to work fine. There are no errors, but nothing gets saved. The DB table is empty.
Here is the log from the Save operation:
Code:
2007-06-02 18:04:05,896 DEBUG 5732 NHibernate.Transaction.AdoTransaction - begin
2007-06-02 18:04:05,902 DEBUG 5732 NHibernate.Impl.SessionImpl - generated identifier: ReportingBusiness.Sys_Ui_Report_Vodovody
2007-06-02 18:04:05,906 DEBUG 5732 NHibernate.Impl.SessionImpl - saving [ReportingBusiness.Sys_Ui_Report_Vodovody#ReportingBusiness.Sys_Ui_Report_Vodovody]
2007-06-02 18:04:05,916 DEBUG 5732 NHibernate.Transaction.AdoTransaction - commit
2007-06-02 18:04:05,918 DEBUG 5732 NHibernate.Impl.SessionImpl - flushing session
2007-06-02 18:04:05,918 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushing entities and processing referenced collections
2007-06-02 18:04:05,919 DEBUG 5732 NHibernate.Impl.SessionImpl - Processing unreferenced collections
2007-06-02 18:04:05,919 DEBUG 5732 NHibernate.Impl.SessionImpl - scheduling collection removes/(re)creates/updates
2007-06-02 18:04:05,920 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushed: 1 insertions, 0 updates, 0 deletions to 2 objects
2007-06-02 18:04:05,920 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-06-02 18:04:05,920 DEBUG 5732 NHibernate.Impl.Printer - listing entities:
2007-06-02 18:04:05,921 DEBUG 5732 NHibernate.Impl.Printer - ReportingBusiness.Reporty{Kvartal=1, Nazov=NewReport, Rok=2000, Id=1018}
2007-06-02 18:04:05,921 DEBUG 5732 NHibernate.Impl.Printer - ReportingBusiness.Sys_Ui_Report_Vodovody{}
2007-06-02 18:04:05,922 DEBUG 5732 NHibernate.Impl.SessionImpl - executing flush
2007-06-02 18:04:05,925 DEBUG 5732 NHibernate.Persister.EntityPersister - Inserting entity: [ReportingBusiness.Sys_Ui_Report_Vodovody#ReportingBusiness.Sys_Ui_Report_Vodovody]
2007-06-02 18:04:05,929 DEBUG 5732 NHibernate.Impl.BatcherImpl - Opened new IDbCommand, open IDbCommands :1
2007-06-02 18:04:05,930 DEBUG 5732 NHibernate.Impl.BatcherImpl - Building an IDbCommand object for the SqlString: INSERT INTO T_app_vuvh_605_xmlexp_sys_ui_report_vodovody (id_report, id_vodovod) VALUES (:id_report, :id_vodovod)
2007-06-02 18:04:05,931 DEBUG 5732 NHibernate.Persister.EntityPersister - Dehydrating entity: [ReportingBusiness.Sys_Ui_Report_Vodovody#ReportingBusiness.Sys_Ui_Report_Vodovody]
2007-06-02 18:04:05,945 DEBUG 5732 NHibernate.Type.Int32Type - binding '1018' to parameter: 0
2007-06-02 18:04:05,946 DEBUG 5732 NHibernate.Type.StringType - binding 'T201' to parameter: 1
2007-06-02 18:04:05,948 DEBUG 5732 NHibernate.SQL - INSERT INTO T_app_vuvh_605_xmlexp_sys_ui_report_vodovody (id_report, id_vodovod) VALUES (@p0, @p1)
2007-06-02 18:04:05,948 DEBUG 5732 NHibernate.SQL - @p0 = '1018'
2007-06-02 18:04:05,949 DEBUG 5732 NHibernate.SQL - @p1 = 'T201'
2007-06-02 18:04:05,950 DEBUG 5732 NHibernate.Impl.BatcherImpl - Closed IDbCommand, open IDbCommands :0
2007-06-02 18:04:05,951 DEBUG 5732 NHibernate.Impl.SessionImpl - post flush
2007-06-02 18:04:05,953 DEBUG 5732 NHibernate.Impl.SessionImpl - transaction completion
2007-06-02 18:04:05,953 DEBUG 5732 NHibernate.Transaction.AdoTransaction - running AdoTransaction.Dispose()
2007-06-02 18:04:05,973 DEBUG 5732 NHibernate.Impl.SessionImpl - flushing session
2007-06-02 18:04:05,974 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushing entities and processing referenced collections
2007-06-02 18:04:05,974 DEBUG 5732 NHibernate.Impl.SessionImpl - Processing unreferenced collections
2007-06-02 18:04:05,974 DEBUG 5732 NHibernate.Impl.SessionImpl - scheduling collection removes/(re)creates/updates
2007-06-02 18:04:05,976 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushed: 0 insertions, 0 updates, 0 deletions to 2 objects
2007-06-02 18:04:05,976 DEBUG 5732 NHibernate.Impl.SessionImpl - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-06-02 18:04:05,978 DEBUG 5732 NHibernate.Impl.Printer - listing entities:
2007-06-02 18:04:05,978 DEBUG 5732 NHibernate.Impl.Printer - ReportingBusiness.Reporty{Kvartal=1, Nazov=NewReport, Rok=2000, Id=1018}
2007-06-02 18:04:05,979 DEBUG 5732 NHibernate.Impl.Printer - ReportingBusiness.Sys_Ui_Report_Vodovody{}
2007-06-02 18:04:05,979 DEBUG 5732 NHibernate.Impl.SessionImpl - executing flush
2007-06-02 18:04:05,980 DEBUG 5732 NHibernate.Impl.SessionImpl - post flush
2007-06-02 18:04:05,980 DEBUG 5732 NHibernate.Impl.SessionImpl - closing session
2007-06-02 18:04:05,980 DEBUG 5732 NHibernate.Impl.SessionImpl - disconnecting session
2007-06-02 18:04:05,980 DEBUG 5732 NHibernate.Connection.ConnectionProvider - Closing connection
2007-06-02 18:04:05,981 DEBUG 5732 NHibernate.Impl.SessionImpl - transaction completion
Any ideas, why this isn't saved into the DB, even though the INSERT statement seems to be executed with correct values?
Thanks,
Jerry