-->
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: dynamic-insert attribute does not work
PostPosted: Tue May 17, 2005 9:23 am 
In the NHibernate XML document that contains the O/R mappings I have defined in the class element the atribute dynamic-insert = "true". Why the hibernate Insert SQL statement contains all the columns of my database table?.
I am using the NHibernate version : 0.8.3.0
Thanks a lot for any Help!!!


Top
  
 
 Post subject:
PostPosted: Wed May 18, 2005 5:43 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Can you give us more details? A mapping, a class and a debug log would be nice, so that we know what's happening.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 19, 2005 1:24 am 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
Sergey,

I have seen this too. I will post my mappings and debug tomorrow.

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 10:03 am 
Dear Sergey,
Here is the information that you need
Thanks in advance!!!
/Vlad


-- LOG Data

2005-05-20 15:51:06,330 DEBUG - opened session
2005-05-20 15:51:06,330 DEBUG - begin
2005-05-20 15:51:06,330 DEBUG - Obtaining IDbConnection from Driver
2005-05-20 15:51:06,330 INFO - executing insertions
2005-05-20 15:51:06,330 DEBUG - Inserting entity: VUM.Jobat.Business.Domain.User (native id)
2005-05-20 15:51:06,330 DEBUG - about to open: 0 open IDbCommands, 0 open DataReaders
2005-05-20 15:51:06,346 DEBUG - Building an IDbCommand object for the SqlString: INSERT INTO Users (MailFormat, Country, Mail, Buitenland, Privacy, DateUnregistered, RichtingstypeId, Fax, Vaardigheden, EersteMailVerzonden, Letter_memo, MaritalStateID, DateLastSession, Number, AanvullendeOpleidingen, LanguageID, WorkSituationID, InteresseDeeltijds, Vertrouwelijk, PendelenKm, PartTime, SalaryID, InteresseVoltijds, Nationality, Prefix, Personal_memo, FirstName, BirthDate, Street, ZipCode, LastName, Deleted, Manager, DateRegistered, Informatica_Kennis, Phone, Box, Hobbys_memo, CVservice, Sessions, City, Pendelen, Password, VrijeTijd, OpleidingsNiveauId, Other_memo, Email, Views) VALUES (:MailFormat, :Country, :Mail, :Buitenland, :Privacy, :DateUnregistered, :RichtingstypeId, :Fax, :Vaardigheden, :EersteMailVerzonden, :Letter_memo, :MaritalStateID, :DateLastSession, :Number, :AanvullendeOpleidingen, :LanguageID, :WorkSituationID, :InteresseDeeltijds, :Vertrouwelijk, :PendelenKm, :PartTime, :SalaryID, :InteresseVoltijds, :Nationality, :Prefix, :Personal_memo, :FirstName, :BirthDate, :Street, :ZipCode, :LastName, :Deleted, :Manager, :DateRegistered, :Informatica_Kennis, :Phone, :Box, :Hobbys_memo, :CVservice, :Sessions, :City, :Pendelen, :Password, :VrijeTijd, :OpleidingsNiveauId, :Other_memo, :Email, :Views); select SCOPE_IDENTITY()
2005-05-20 15:51:06,346 DEBUG - Dehydrating entity: VUM.Jobat.Business.Domain.User#
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 0
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 1
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 2
2005-05-20 15:51:06,346 DEBUG - binding 'False' to parameter: 3
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 4
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 5
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 6
2005-05-20 15:51:06,346 DEBUG - binding '222' to parameter: 7
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 8
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 9
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 10
2005-05-20 15:51:06,346 DEBUG - binding '1' to parameter: 11
2005-05-20 15:51:06,346 DEBUG - binding '20/05/2005 15:51:06' to parameter: 12
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 13
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 14
2005-05-20 15:51:06,346 DEBUG - binding '1' to parameter: 15
2005-05-20 15:51:06,346 DEBUG - binding '4' to parameter: 16
2005-05-20 15:51:06,346 DEBUG - binding 'False' to parameter: 17
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 18
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 19
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 20
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 21
2005-05-20 15:51:06,346 DEBUG - binding 'False' to parameter: 22
2005-05-20 15:51:06,346 DEBUG - binding 'gfd' to parameter: 23
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 24
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 25
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 26
2005-05-20 15:51:06,346 DEBUG - binding '5/09/1971 0:00:00' to parameter: 27
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 28
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 29
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 30
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 31
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 32
2005-05-20 15:51:06,346 DEBUG - binding '20/05/2005 15:51:06' to parameter: 33
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 34
2005-05-20 15:51:06,346 DEBUG - binding '111' to parameter: 35
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 36
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 37
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 38
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 39
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 40
2005-05-20 15:51:06,346 DEBUG - binding 'False' to parameter: 41
2005-05-20 15:51:06,346 DEBUG - binding 't' to parameter: 42
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 43
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 44
2005-05-20 15:51:06,346 DEBUG - binding '' to parameter: 45
2005-05-20 15:51:06,346 DEBUG - binding 'vpf@uniway.be' to parameter: 46
2005-05-20 15:51:06,346 DEBUG - binding '0' to parameter: 47
2005-05-20 15:51:06,346 INFO - Preparing INSERT INTO Users (MailFormat, Country, Mail, Buitenland, Privacy, DateUnregistered, RichtingstypeId, Fax, Vaardigheden, EersteMailVerzonden, Letter_memo, MaritalStateID, DateLastSession, Number, AanvullendeOpleidingen, LanguageID, WorkSituationID, InteresseDeeltijds, Vertrouwelijk, PendelenKm, PartTime, SalaryID, InteresseVoltijds, Nationality, Prefix, Personal_memo, FirstName, BirthDate, Street, ZipCode, LastName, Deleted, Manager, DateRegistered, Informatica_Kennis, Phone, Box, Hobbys_memo, CVservice, Sessions, City, Pendelen, Password, VrijeTijd, OpleidingsNiveauId, Other_memo, Email, Views) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14, @p15, @p16, @p17, @p18, @p19, @p20, @p21, @p22, @p23, @p24, @p25, @p26, @p27, @p28, @p29, @p30, @p31, @p32, @p33, @p34, @p35, @p36, @p37, @p38, @p39, @p40, @p41, @p42, @p43, @p44, @p45, @p46, @p47); select SCOPE_IDENTITY()
2005-05-20 15:51:06,362 DEBUG - Natively generated identity: 113938
2005-05-20 15:51:06,362 DEBUG - done closing: 0 open IDbCommands, 0 open DataReaders
2005-05-20 15:51:06,362 DEBUG - refreshing [VUM.Jobat.Business.Domain.User#113938]
2005-05-20 15:51:06,362 DEBUG - Materializing entity: VUM.Jobat.Business.Domain.User#113938
2005-05-20 15:51:06,362 DEBUG - about to open: 0 open IDbCommands, 0 open DataReaders
2005-05-20 15:51:06,362 DEBUG - Building an IDbCommand object for the SqlString: SELECT user0_.UserID as UserID0_, user0_.MailFormat as MailFormat0_, user0_.Country as Country0_, user0_.Mail as Mail0_, user0_.Buitenland as Buitenland0_, user0_.Privacy as Privacy0_, user0_.DateUnregistered as DateUnre3_0_, user0_.RichtingstypeId as Richtin38_0_, user0_.Fax as Fax0_, user0_.Vaardigheden as Vaardig41_0_, user0_.EersteMailVerzonden as EersteM43_0_, user0_.Letter_memo as Letter_27_0_, user0_.MaritalStateID as Marital25_0_, user0_.DateLastSession as DateLast4_0_, user0_.Number as Number0_, user0_.AanvullendeOpleidingen as Aanvull40_0_, user0_.LanguageID as LanguageID0_, user0_.WorkSituationID as WorkSit46_0_, user0_.InteresseDeeltijds as Interes36_0_, user0_.Vertrouwelijk as Vertrou47_0_, user0_.PendelenKm as PendelenKm0_, user0_.PartTime as PartTime0_, user0_.SalaryID as SalaryID0_, user0_.InteresseVoltijds as Interes37_0_, user0_.Nationality as Nationa24_0_, user0_.Prefix as Prefix0_, user0_.Personal_memo as Persona29_0_, user0_.FirstName as FirstName0_, user0_.BirthDate as BirthDate0_, user0_.Street as Street0_, user0_.ZipCode as ZipCode0_, user0_.LastName as LastName0_, user0_.Deleted as Deleted0_, user0_.Manager as Manager0_, user0_.DateRegistered as DateRegi2_0_, user0_.Informatica_Kennis as Informa45_0_, user0_.Phone as Phone0_, user0_.Box as Box0_, user0_.Hobbys_memo as Hobbys_28_0_, user0_.CVservice as CVservice0_, user0_.Sessions as Sessions0_, user0_.City as City0_, user0_.Pendelen as Pendelen0_, user0_.Password as Password0_, user0_.VrijeTijd as VrijeTijd0_, user0_.OpleidingsNiveauId as Opleidi39_0_, user0_.Other_memo as Other_memo0_, user0_.Email as Email0_, user0_.Views as Views0_ FROM Users user0_ WHERE user0_.UserID = :user0_.UserID
2005-05-20 15:51:06,362 DEBUG - binding '113938' to parameter: 0
2005-05-20 15:51:06,362 INFO - SELECT user0_.UserID as UserID0_, user0_.MailFormat as MailFormat0_, user0_.Country as Country0_, user0_.Mail as Mail0_, user0_.Buitenland as Buitenland0_, user0_.Privacy as Privacy0_, user0_.DateUnregistered as DateUnre3_0_, user0_.RichtingstypeId as Richtin38_0_, user0_.Fax as Fax0_, user0_.Vaardigheden as Vaardig41_0_, user0_.EersteMailVerzonden as EersteM43_0_, user0_.Letter_memo as Letter_27_0_, user0_.MaritalStateID as Marital25_0_, user0_.DateLastSession as DateLast4_0_, user0_.Number as Number0_, user0_.AanvullendeOpleidingen as Aanvull40_0_, user0_.LanguageID as LanguageID0_, user0_.WorkSituationID as WorkSit46_0_, user0_.InteresseDeeltijds as Interes36_0_, user0_.Vertrouwelijk as Vertrou47_0_, user0_.PendelenKm as PendelenKm0_, user0_.PartTime as PartTime0_, user0_.SalaryID as SalaryID0_, user0_.InteresseVoltijds as Interes37_0_, user0_.Nationality as Nationa24_0_, user0_.Prefix as Prefix0_, user0_.Personal_memo as Persona29_0_, user0_.FirstName as FirstName0_, user0_.BirthDate as BirthDate0_, user0_.Street as Street0_, user0_.ZipCode as ZipCode0_, user0_.LastName as LastName0_, user0_.Deleted as Deleted0_, user0_.Manager as Manager0_, user0_.DateRegistered as DateRegi2_0_, user0_.Informatica_Kennis as Informa45_0_, user0_.Phone as Phone0_, user0_.Box as Box0_, user0_.Hobbys_memo as Hobbys_28_0_, user0_.CVservice as CVservice0_, user0_.Sessions as Sessions0_, user0_.City as City0_, user0_.Pendelen as Pendelen0_, user0_.Password as Password0_, user0_.VrijeTijd as VrijeTijd0_, user0_.OpleidingsNiveauId as Opleidi39_0_, user0_.Other_memo as Other_memo0_, user0_.Email as Email0_, user0_.Views as Views0_ FROM Users user0_ WHERE user0_.UserID = @p0
2005-05-20 15:51:06,362 INFO - Preparing SELECT user0_.UserID as UserID0_, user0_.MailFormat as MailFormat0_, user0_.Country as Country0_, user0_.Mail as Mail0_, user0_.Buitenland as Buitenland0_, user0_.Privacy as Privacy0_, user0_.DateUnregistered as DateUnre3_0_, user0_.RichtingstypeId as Richtin38_0_, user0_.Fax as Fax0_, user0_.Vaardigheden as Vaardig41_0_, user0_.EersteMailVerzonden as EersteM43_0_, user0_.Letter_memo as Letter_27_0_, user0_.MaritalStateID as Marital25_0_, user0_.DateLastSession as DateLast4_0_, user0_.Number as Number0_, user0_.AanvullendeOpleidingen as Aanvull40_0_, user0_.LanguageID as LanguageID0_, user0_.WorkSituationID as WorkSit46_0_, user0_.InteresseDeeltijds as Interes36_0_, user0_.Vertrouwelijk as Vertrou47_0_, user0_.PendelenKm as PendelenKm0_, user0_.PartTime as PartTime0_, user0_.SalaryID as SalaryID0_, user0_.InteresseVoltijds as Interes37_0_, user0_.Nationality as Nationa24_0_, user0_.Prefix as Prefix0_, user0_.Personal_memo as Persona29_0_, user0_.FirstName as FirstName0_, user0_.BirthDate as BirthDate0_, user0_.Street as Street0_, user0_.ZipCode as ZipCode0_, user0_.LastName as LastName0_, user0_.Deleted as Deleted0_, user0_.Manager as Manager0_, user0_.DateRegistered as DateRegi2_0_, user0_.Informatica_Kennis as Informa45_0_, user0_.Phone as Phone0_, user0_.Box as Box0_, user0_.Hobbys_memo as Hobbys_28_0_, user0_.CVservice as CVservice0_, user0_.Sessions as Sessions0_, user0_.City as City0_, user0_.Pendelen as Pendelen0_, user0_.Password as Password0_, user0_.VrijeTijd as VrijeTijd0_, user0_.OpleidingsNiveauId as Opleidi39_0_, user0_.Other_memo as Other_memo0_, user0_.Email as Email0_, user0_.Views as Views0_ FROM Users user0_ WHERE user0_.UserID = @p0
2005-05-20 15:51:06,377 DEBUG - processing result set
2005-05-20 15:51:06,377 DEBUG - result row: 113938


-- Mapping

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="VUM.Jobat.Business.Domain.User, VUM.Jobat.Business" table="Users" dynamic-update="true" dynamic-insert="true" >

<id name="Userid" column="UserID" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
<property column="DateRegistered" name="DateRegistered" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property column="DateUnregistered" name="DateUnregistered" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate"/>
<property column="DateLastSession" name="DateLastSession" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />
<property column="Mail" type="Byte" name="Mail" />
<property column="CVservice" type="Byte" name="Cvservice" />
<property column="Sessions" name="Sessions" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" />
<property column="Prefix" type="Byte" name="Prefix" not-null="true" />
<property column="LastName" type="String" name="LastName" length="50" />
<property column="FirstName" type="String" name="FirstName" length="50" />
<property column="BirthDate" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" name="BirthDate" />
<property column="Email" type="String" name="Email" not-null="true" length="100" />
<property column="Password" type="String" name="Password" not-null="true" length="15" />
<property column="Street" type="String" name="Street" length="70" />
<property column="Number" type="String" name="Number" length="20" />
<property column="Box" type="String" name="Box" length="5" />
<property column="ZipCode" type="String" name="ZipCode" length="50" />
<property column="City" type="String" name="City" length="80" />
<property column="Country" type="String" name="Country" length="50" />
<property column="Phone" type="String" name="Phone" length="20" />
<property column="Fax" type="String" name="Fax" length="20" />
<property column="PartTime" type="Byte" name="PartTime" not-null="true" />
<property column="Manager" type="Byte" name="Manager" />
<property column="Nationality" type="String" name="Nationality" length="25" />
<property column="MaritalStateID" type="Int32" name="MaritalStateid" />
<property column="LanguageID" type="Int32" name="Languageid" not-null="true" />
<property column="Letter_memo" type="String" name="LetterMemo" length="2147483647" />
<property column="Hobbys_memo" type="String" name="HobbysMemo" length="2147483647" />
<property column="Personal_memo" type="String" name="PersonalMemo" length="2147483647" />
<property column="Other_memo" type="String" name="OtherMemo" length="2147483647" />
<property column="Pendelen" type="Boolean" name="Pendelen" not-null="true" />
<property column="PendelenKm" type="String" name="PendelenKm" length="20" />
<property column="Buitenland" type="Boolean" name="Buitenland" not-null="true" />
<property column="SalaryID" name="Salaryid" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" />
<property column="Privacy" type="Byte" name="Privacy" not-null="true" />
<property column="InteresseDeeltijds" type="Boolean" name="InteresseDeeltijds" not-null="true" />
<property column="InteresseVoltijds" type="Boolean" name="InteresseVoltijds" not-null="true" />
<property column="RichtingstypeId" type="Int32" name="RichtingstypeId" not-null="true" />
<property column="OpleidingsNiveauId" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" name="OpleidingsNiveauId" />
<property column="AanvullendeOpleidingen" type="String" name="AanvullendeOpleidingen" length="2147483647" />
<property column="Vaardigheden" type="String" name="Vaardigheden" length="2147483647" />
<property column="VrijeTijd" type="String" name="VrijeTijd" length="2147483647" />
<property column="EersteMailVerzonden" type="Nullables.NHibernate.NullableInt32Type, Nullables.NHibernate" name="EersteMailVerzonden" />
<property column="MailFormat" type="Byte" name="MailFormat" />
<property column="Informatica_Kennis" type="String" name="InformaticaKennis" length="2147483647" />
<!--<property column="Last_Modification" name="LastModification" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" />-->
<property column="WorkSituationID" type="Int32" name="WorkSituationid" />
<property column="Vertrouwelijk" type="Byte" name="Vertrouwelijk" not-null="true" />
<property column="Deleted" type="Int32" name="Deleted" />
<property column="Views" type="Int32" name="Views" />

</class>
</hibernate-mapping>


-- Class

/*
insert license info here
*/
using System;
using Nullables;

namespace VUM.Jobat.Business.Domain
{
/// <summary>
/// Generated by MyGeneration using the NHibernate Object Mapping template
/// </summary>
[Serializable]
public sealed class User
{
#region Private Members
private bool _isChanged;
private bool _isDeleted;
private int _userid;
private NullableDateTime _dateregistered;
private NullableDateTime _dateunregistered;
private NullableDateTime _datelastsession;
private byte _mail;
private byte _cvservice;
private NullableInt32 _sessions;
private byte _prefix;
private string _lastname;
private string _firstname;
private NullableDateTime _birthdate;
private string _email;
private string _password;
private string _street;
private string _number;
private string _box;
private string _zipcode;
private string _city;
private string _country;
private string _phone;
private string _fax;
private byte _parttime;
private byte _manager;
private string _nationality;
private int _maritalstateid;
private int _languageid;
private string _letter_memo;
private string _hobbys_memo;
private string _personal_memo;
private string _other_memo;
private bool _pendelen;
private string _pendelenkm;
private bool _buitenland;
private NullableInt32 _salaryid;
private byte _privacy;
private bool _interessedeeltijds;
private bool _interessevoltijds;
private int _richtingstypeid;
private NullableInt32 _opleidingsniveauid;
private string _aanvullendeopleidingen;
private string _vaardigheden;
private string _vrijetijd;
private NullableInt32 _eerstemailverzonden;
private byte _mailformat;
private string _informatica_kennis;
private NullableDateTime _last_modification;
private int _worksituationid;
private byte _vertrouwelijk;
private int _deleted;
private int _views;
#endregion

#region Default ( Empty ) Class Constuctor
/// <summary>
/// default constructor
/// </summary>
public User()
{
_userid = 0;
_dateregistered = NullableDateTime.Default;
_dateunregistered = NullableDateTime.Default;
_datelastsession = NullableDateTime.Default;
_mail = new byte();
_cvservice = new byte();
_sessions = NullableInt32.Default;
_prefix = new byte();
_lastname = String.Empty;
_firstname = String.Empty;
_birthdate = NullableDateTime.Default;
_email = String.Empty;
_password = String.Empty;
_street = String.Empty;
_number = String.Empty;
_box = String.Empty;
_zipcode = String.Empty;
_city = String.Empty;
_country = String.Empty;
_phone = String.Empty;
_fax = String.Empty;
_parttime = new byte();
_manager = new byte();
_nationality = String.Empty;
_maritalstateid = 0;
_languageid = 0;
_letter_memo = String.Empty;
_hobbys_memo = String.Empty;
_personal_memo = String.Empty;
_other_memo = String.Empty;
_pendelen = false;
_pendelenkm = String.Empty;
_buitenland = false;
_salaryid = NullableInt32.Default;
_privacy = new byte();
_interessedeeltijds = false;
_interessevoltijds = false;
_richtingstypeid = 0;
_opleidingsniveauid = NullableInt32.Default;
_aanvullendeopleidingen = String.Empty;
_vaardigheden = String.Empty;
_vrijetijd = String.Empty;
_eerstemailverzonden = NullableInt32.Default ;
_mailformat = new byte();
_informatica_kennis = String.Empty;
_last_modification = NullableDateTime.Default;
_worksituationid = 0;
_vertrouwelijk = new byte();
_deleted = 0;
_views = 0;

}
#endregion // End of Default ( Empty ) Class Constuctor

#region Public Properties

/// <summary>
///
/// </summary>
public int Userid
{
get { return _userid; }
set { _isChanged |= (_userid != value); _userid = value; }
}

/// <summary>
///
/// </summary>
public NullableDateTime DateRegistered
{
get { return _dateregistered; }
set { _isChanged |= (_dateregistered != value); _dateregistered = value; }
}

/// <summary>
///
/// </summary>
public NullableDateTime DateUnregistered
{
get { return _dateunregistered; }
set { _isChanged |= (_dateunregistered != value); _dateunregistered = value; }
}

/// <summary>
///
/// </summary>
public NullableDateTime DateLastSession
{
get { return _datelastsession; }
set { _isChanged |= (_datelastsession != value); _datelastsession = value; }
}

/// <summary>
///
/// </summary>
public byte Mail
{
get { return _mail; }
set { _isChanged |= (_mail != value); _mail = value; }
}

/// <summary>
///
/// </summary>
public byte Cvservice
{
get { return _cvservice; }
set { _isChanged |= (_cvservice != value); _cvservice = value; }
}

/// <summary>
///
/// </summary>
public NullableInt32 Sessions
{
get { return _sessions; }
set { _isChanged |= (_sessions != value); _sessions = value; }
}

/// <summary>
///
/// </summary>
public byte Prefix
{
get { return _prefix; }
set { _isChanged |= (_prefix != value); _prefix = value; }
}

/// <summary>
///
/// </summary>
public string LastName
{
get { return _lastname; }
set { _isChanged |= (_lastname != value); _lastname = value; }
}

/// <summary>
///
/// </summary>
public string FirstName
{
get { return _firstname; }
set { _isChanged |= (_firstname != value); _firstname = value; }
}

/// <summary>
///
/// </summary>
public Nullables.NullableDateTime BirthDate
{
get { return _birthdate; }
set { _isChanged |= (_birthdate != value); _birthdate = value; }
}

/// <summary>
///
/// </summary>
public string Email
{
get { return _email; }
set { _isChanged |= (_email != value); _email = value; }
}

/// <summary>
///
/// </summary>
public string Password
{
get { return _password; }
set { _isChanged |= (_password != value); _password = value; }
}

/// <summary>
///
/// </summary>
public string Street
{
get { return _street; }
set { _isChanged |= (_street != value); _street = value; }
}

/// <summary>
///
/// </summary>
public string Number
{
get { return _number; }
set { _isChanged |= (_number != value); _number = value; }
}

/// <summary>
///
/// </summary>
public string Box
{
get { return _box; }
set { _isChanged |= (_box != value); _box = value; }
}

/// <summary>
///
/// </summary>
public string ZipCode
{
get { return _zipcode; }
set { _isChanged |= (_zipcode != value); _zipcode = value; }
}

/// <summary>
///
/// </summary>
public string City
{
get { return _city; }
set { _isChanged |= (_city != value); _city = value; }
}

/// <summary>
///
/// </summary>
public string Country
{
get { return _country; }
set { _isChanged |= (_country != value); _country = value; }
}

/// <summary>
///
/// </summary>
public string Phone
{
get { return _phone; }
set { _isChanged |= (_phone != value); _phone = value; }
}

/// <summary>
///
/// </summary>
public string Fax
{
get { return _fax; }
set { _isChanged |= (_fax != value); _fax = value; }
}

/// <summary>
///
/// </summary>
public byte PartTime
{
get { return _parttime; }
set { _isChanged |= (_parttime != value); _parttime = value; }
}

/// <summary>
///
/// </summary>
public byte Manager
{
get { return _manager; }
set { _isChanged |= (_manager != value); _manager = value; }
}

/// <summary>
///
/// </summary>
public string Nationality
{
get { return _nationality; }
set { _isChanged |= (_nationality != value); _nationality = value; }
}

/// <summary>
///
/// </summary>
public int MaritalStateid
{
get { return _maritalstateid; }
set { _isChanged |= (_maritalstateid != value); _maritalstateid = value; }
}

/// <summary>
///
/// </summary>
public int Languageid
{
get { return _languageid; }
set { _isChanged |= (_languageid != value); _languageid = value; }
}

/// <summary>
///
/// </summary>
public string LetterMemo
{
get { return _letter_memo; }
set { _isChanged |= (_letter_memo != value); _letter_memo = value; }
}

/// <summary>
///
/// </summary>
public string HobbysMemo
{
get { return _hobbys_memo; }
set { _isChanged |= (_hobbys_memo != value); _hobbys_memo = value; }
}

/// <summary>
///
/// </summary>
public string PersonalMemo
{
get { return _personal_memo; }
set { _isChanged |= (_personal_memo != value); _personal_memo = value; }
}

/// <summary>
///
/// </summary>
public string OtherMemo
{
get { return _other_memo; }
set { _isChanged |= (_other_memo != value); _other_memo = value; }
}

/// <summary>
///
/// </summary>
public bool Pendelen
{
get { return _pendelen; }
set { _isChanged |= (_pendelen != value); _pendelen = value; }
}

/// <summary>
///
/// </summary>
public string PendelenKm
{
get { return _pendelenkm; }
set { _isChanged |= (_pendelenkm != value); _pendelenkm = value; }
}

/// <summary>
///
/// </summary>
public bool Buitenland
{
get { return _buitenland; }
set { _isChanged |= (_buitenland != value); _buitenland = value; }
}

/// <summary>
///
/// </summary>
public NullableInt32 Salaryid
{
get { return _salaryid; }
set { _isChanged |= (_salaryid != value); _salaryid = value; }
}

/// <summary>
///
/// </summary>
public byte Privacy
{
get { return _privacy; }
set { _isChanged |= (_privacy != value); _privacy = value; }
}

/// <summary>
///
/// </summary>
public bool InteresseDeeltijds
{
get { return _interessedeeltijds; }
set { _isChanged |= (_interessedeeltijds != value); _interessedeeltijds = value; }
}

/// <summary>
///
/// </summary>
public bool InteresseVoltijds
{
get { return _interessevoltijds; }
set { _isChanged |= (_interessevoltijds != value); _interessevoltijds = value; }
}

/// <summary>
///
/// </summary>
public int RichtingstypeId
{
get { return _richtingstypeid; }
set { _isChanged |= (_richtingstypeid != value); _richtingstypeid = value; }
}

/// <summary>
///
/// </summary>
public NullableInt32 OpleidingsNiveauId
{
get { return _opleidingsniveauid; }
set { _isChanged |= (_opleidingsniveauid != value); _opleidingsniveauid = value; }
}

/// <summary>
///
/// </summary>
public string AanvullendeOpleidingen
{
get { return _aanvullendeopleidingen; }
set { _isChanged |= (_aanvullendeopleidingen != value); _aanvullendeopleidingen = value; }
}

/// <summary>
///
/// </summary>
public string Vaardigheden
{
get { return _vaardigheden; }
set { _isChanged |= (_vaardigheden != value); _vaardigheden = value; }
}

/// <summary>
///
/// </summary>
public string VrijeTijd
{
get { return _vrijetijd; }
set { _isChanged |= (_vrijetijd != value); _vrijetijd = value; }
}

/// <summary>
///
/// </summary>
public NullableInt32 EersteMailVerzonden
{
get { return _eerstemailverzonden; }
set { _isChanged |= (_eerstemailverzonden != value); _eerstemailverzonden = value; }
}

/// <summary>
///
/// </summary>
public byte MailFormat
{
get { return _mailformat; }
set { _isChanged |= (_mailformat != value); _mailformat = value; }
}

/// <summary>
///
/// </summary>
public string InformaticaKennis
{
get { return _informatica_kennis; }
set { _isChanged |= (_informatica_kennis != value); _informatica_kennis = value; }
}

/// <summary>
///
/// </summary>
public NullableDateTime LastModification
{
get { return _last_modification; }
set { _isChanged |= (_last_modification != value); _last_modification = value; }
}

/// <summary>
///
/// </summary>
public int WorkSituationid
{
get { return _worksituationid; }
set { _isChanged |= (_worksituationid != value); _worksituationid = value; }
}

/// <summary>
///
/// </summary>
public byte Vertrouwelijk
{
get { return _vertrouwelijk; }
set { _isChanged |= (_vertrouwelijk != value); _vertrouwelijk = value; }
}

/// <summary>
/// 1- De users has been deleted 0- User is active
/// </summary>
public int Deleted
{
get { return _deleted; }
set { _isChanged |= (_deleted != value); _deleted = value; }
}

/// <summary>
/// How many times companies have seen the CV.
/// </summary>
public int Views
{
get { return _views; }
set { _isChanged |= (_views != value); _views = value; }
}

/// <summary>
/// Returns whether or not the object has changed it's values.
/// </summary>
public bool IsChanged
{
get { return _isChanged; }
}

/// <summary>
/// Returns whether or not the object has changed it's values.
/// </summary>
public bool IsDeleted
{
get { return _isDeleted; }
}

#endregion


#region Public Functions

/// <summary>
/// mark the item as deleted
/// </summary>
public void MarkAsDeleted()
{
_isDeleted = true;
_isChanged = true;
}

#endregion


}
}


--- method from my CoreRepository

public void AddUser(string LastName, string FirstName, DateTime BirthDate, string street, string zipcode, string city,
string country, string nationality, int languageid, int MaritalStateid, string phone, string fax,
string password, int WorkSituationid, string email )
{


User newUser = new User();
newUser.DateRegistered = DateTime.Now;
newUser.DateLastSession = DateTime.Now;
//newUser.LastModification = DateTime.Now;
newUser.LastName = LastName;
newUser.FirstName = FirstName;
newUser.BirthDate = BirthDate;
newUser.Street = street;
newUser.ZipCode = zipcode;
newUser.City = city;
newUser.Country = country;
newUser.Nationality = nationality;
newUser.Languageid = languageid;
newUser.MaritalStateid = MaritalStateid; // 1 for testing
//newUser.Mail = // 1 or 0
newUser.Phone = phone;
newUser.Fax = fax;
newUser.Password = password;
newUser.WorkSituationid = WorkSituationid; // 4 for testing
newUser.Email = email;
SaveObject( (User)newUser);

}






/// <summary>
/// Generic method to insert an object.
/// </summary>
/// <param name="obj"></param>
public void SaveObject(object obj)
{
ITransaction trn = this._activeSession.BeginTransaction();
try
{
// Try to find a UpdateTimestamp property and when found, set it to the current date/time.
PropertyInfo pi = obj.GetType().GetProperty("UpdateTimestamp");
if (pi != null)
{
pi.SetValue(obj, DateTime.Now, null);
}
this._activeSession.Save(obj);
this._activeSession.Refresh(obj) ;
trn.Commit();
}
catch (Exception ex)
{
trn.Rollback();
throw ex;
}
}


Top
  
 
 Post subject:
PostPosted: Fri May 20, 2005 1:33 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Ok, the problem is that when determining whether to insert a property or not, property values are compared to null, and none of your properties are actually null. It doesn't work for Nullable types either, since those are never equal to null (Nullable<something>.Default is a non-null object). If you need this functionality to work for Nullables, submit an improvement request to JIRA, we'll try to do something about it.


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.