From: Michael D. <mik...@us...> - 2004-06-18 13:48:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22528/NHibernate.DomainModel Modified Files: Fum.cs Fum.hbm.xml Fumm.cs Log Message: Modified some properties to follow .net naming standards and wrote more test for composite ids. Index: Fumm.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fumm.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fumm.cs 29 Apr 2004 15:16:00 -0000 1.1 --- Fumm.cs 18 Jun 2004 13:48:11 -0000 1.2 *************** *** 18,22 **** public FumCompositeID Id { ! get { return fum.id; } set { } } --- 18,22 ---- public FumCompositeID Id { ! get { return fum.Id; } set { } } Index: Fum.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fum.cs 3 Jun 2004 18:55:57 -0000 1.4 --- Fum.cs 18 Jun 2004 13:48:11 -0000 1.5 *************** *** 13,21 **** private DateTime _lastUpdated; ! public Fum() {} public Fum(FumCompositeID id) { ! this.id = id; ! friends = new Hashtable(); //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so --- 13,24 ---- private DateTime _lastUpdated; ! public Fum() ! { ! } ! public Fum(FumCompositeID id) { ! _id = id; ! _friends = new Hashtable(); //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so *************** *** 29,42 **** Fum f = new Fum(); ! f.id = fid; ! f.fum="FRIEND"; //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! f.lastUpdated = DateTime.Now; ! friends.Add(f, new object()); } ! public string fum { get --- 32,46 ---- Fum f = new Fum(); ! f.Id = fid; ! f.FumString="FRIEND"; //TODO: H2.0.3 - this is diff from H2.0.3 because I am getting a null exception // when executing the Sql. H203 uses the CalendarType which we don't have so // I am using DateTime instead... ! f.LastUpdated = DateTime.Now; ! _friends.Add(f, new object()); } ! ! public string FumString { get *************** *** 50,54 **** } ! public FumCompositeID id { get --- 54,58 ---- } ! public FumCompositeID Id { get *************** *** 61,65 **** } } ! public Fum fo { get --- 65,69 ---- } } ! public Fum Fo { get *************** *** 73,77 **** } ! public Qux[] quxArray { get --- 77,81 ---- } ! public Qux[] QuxArray { get *************** *** 85,89 **** } ! public IDictionary friends { get --- 89,93 ---- } ! public IDictionary Friends { get *************** *** 100,107 **** public LifecycleVeto OnDelete(ISession s) { ! if (friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in friends) { s.Delete(de.Key); --- 104,111 ---- public LifecycleVeto OnDelete(ISession s) { ! if (_friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in _friends) { s.Delete(de.Key); *************** *** 123,130 **** public LifecycleVeto OnSave(ISession s) { ! if (friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in friends) { s.Save(de.Key); --- 127,134 ---- public LifecycleVeto OnSave(ISession s) { ! if (_friends==null) return LifecycleVeto.NoVeto; try { ! foreach(DictionaryEntry de in _friends) { s.Save(de.Key); *************** *** 144,148 **** } ! public DateTime lastUpdated { get --- 148,152 ---- } ! public DateTime LastUpdated { get Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Fum.hbm.xml 3 Jun 2004 18:55:57 -0000 1.4 --- Fum.hbm.xml 18 Jun 2004 13:48:11 -0000 1.5 *************** *** 1,20 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Fum, NHibernate.DomainModel"> ! <composite-id name="id" unsaved-value="any"> <key-property name="String"> ! <column name="string_" length="10" /> </key-property> ! <key-property name="Short" column="short_" /> ! <key-property name="Date" column="date_" type="DateTime" /> </composite-id> ! <version name="lastUpdated" type="DateTime" /> ! <property name="fum" not-null="true" /> ! <many-to-one name="fo"> <column name="fo_string" length="10" /> <column name="fo_short" /> <column name="fo_date" /> </many-to-one> ! <set name="friends"> <key> <column name="fr_string" length="10" /> --- 1,45 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Fum, NHibernate.DomainModel" ! > ! <composite-id ! name="Id" ! unsaved-value="any" ! > <key-property name="String"> ! <column ! name="string_" ! length="10" ! /> </key-property> ! <key-property ! name="Short" ! column="short_" ! /> ! <key-property ! name="Date" ! column="date_" ! type="DateTime" ! /> </composite-id> ! ! <version ! name="LastUpdated" ! type="DateTime" ! /> ! ! <property ! name="FumString" ! not-null="true" ! /> ! ! <many-to-one name="Fo"> <column name="fo_string" length="10" /> <column name="fo_short" /> <column name="fo_date" /> </many-to-one> ! ! <set name="Friends"> <key> <column name="fr_string" length="10" /> *************** *** 24,28 **** <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> ! <array name="quxArray"> <key> <column name="fum_str_" length="10" /> --- 49,54 ---- <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> ! ! <array name="QuxArray"> <key> <column name="fum_str_" length="10" /> |