You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2004-04-10 05:19:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28379/NHibernate/Dialect Modified Files: Dialect.cs MsSql2000Dialect.cs MySQLDialect.cs Log Message: Fixed to support Quoted Tables and Columns - ie in MsSql the use of [ and ] to surround table names/columns. Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MsSql2000Dialect.cs 9 Apr 2004 13:14:52 -0000 1.6 --- MsSql2000Dialect.cs 10 Apr 2004 05:06:02 -0000 1.7 *************** *** 68,71 **** --- 68,90 ---- } + /// <summary> + /// The character used to close a Quoted identifier + /// </summary> + /// <value>MsSql2000 overrides Dialects default value with ']'</value> + public override char CloseQuote + { + get { return ']'; } + } + + /// <summary> + /// The character used to open a Quoted identifier + /// </summary> + /// <value>MsSql2000 overrides Dialects default value with '['</value> + public override char OpenQuote + { + get { return '['; } + } + + private string SqlTypeToString(string name, int length) { Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Dialect.cs 9 Apr 2004 14:19:09 -0000 1.21 --- Dialect.cs 10 Apr 2004 05:06:02 -0000 1.22 *************** *** 38,41 **** --- 38,42 ---- aggregateFunctions["min"] = new QueryFunctionStandard(); aggregateFunctions["sum"] = new QueryFunctionStandard(); + } *************** *** 416,420 **** /// The opening quote for a quoted identifier. /// </summary> ! public char OpenQuote { get { return '"'; } --- 417,421 ---- /// The opening quote for a quoted identifier. /// </summary> ! public virtual char OpenQuote { get { return '"'; } *************** *** 424,428 **** /// The closing quote for a quoted identifier. /// </summary> ! public char CloseQuote { get { return '"'; } --- 425,429 ---- /// The closing quote for a quoted identifier. /// </summary> ! public virtual char CloseQuote { get { return '"'; } Index: MySQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MySQLDialect.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MySQLDialect.cs 21 Mar 2004 00:47:07 -0000 1.12 --- MySQLDialect.cs 10 Apr 2004 05:06:02 -0000 1.13 *************** *** 69,72 **** --- 69,90 ---- } + /// <summary> + /// The character used to close a Quoted identifier + /// </summary> + /// <value>MySql overrides Dialects default value with '`'</value> + public override char CloseQuote + { + get { return '`'; } + } + + /// <summary> + /// The character used to open a Quoted identifier + /// </summary> + /// <value>MySql overrides Dialects default value with '`'</value> + public override char OpenQuote + { + get { return '`'; } + } + private string SqlTypeToString(string name, int length) { |
From: Michael D. <mik...@us...> - 2004-04-10 05:19:27
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28379/NHibernate/Collection Modified Files: CollectionPersister.cs Log Message: Fixed to support Quoted Tables and Columns - ie in MsSql the use of [ and ] to surround table names/columns. Index: CollectionPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CollectionPersister.cs 9 Apr 2004 16:18:00 -0000 1.15 --- CollectionPersister.cs 10 Apr 2004 05:06:01 -0000 1.16 *************** *** 33,38 **** private SqlString sqlDeleteRowString; ! private string sqlOrderByString; private string sqlWhereString; private bool hasOrder; --- 33,40 ---- private SqlString sqlDeleteRowString; ! private string sqlOrderByString; ! private string sqlOrderByStringTemplate; private string sqlWhereString; + private string sqlWhereStringTemplate; private bool hasOrder; *************** *** 78,81 **** --- 80,84 ---- sqlOrderByString = collection.OrderBy; + hasOrder = sqlOrderByString!=null; sqlWhereString = collection.Where; *************** *** 89,93 **** int k=0; foreach(Column col in collection.Key.ColumnCollection) { ! keyColumnNames[k] = col.Name; k++; } --- 92,96 ---- int k=0; foreach(Column col in collection.Key.ColumnCollection) { ! keyColumnNames[k] = col.GetQuotedName(dialect); k++; } *************** *** 106,118 **** int j=0; foreach(Column col in associatedClass.Key.ColumnCollection) { ! elementColumnNames[j] = col.Name; j++; } Table table = associatedClass.Table; ! qualifiedTableName = table.GetQualifiedName( factory.DefaultSchema ); enableJoinedFetch = OuterJoinLoaderType.Eager; } else { Table table = collection.Table; ! qualifiedTableName = table.GetQualifiedName( factory.DefaultSchema ); elementType = collection.Element.Type; span = collection.Element.ColumnSpan; --- 109,121 ---- int j=0; foreach(Column col in associatedClass.Key.ColumnCollection) { ! elementColumnNames[j] = col.GetQuotedName(dialect); j++; } Table table = associatedClass.Table; ! qualifiedTableName = table.GetQualifiedName( dialect, factory.DefaultSchema ); enableJoinedFetch = OuterJoinLoaderType.Eager; } else { Table table = collection.Table; ! qualifiedTableName = table.GetQualifiedName( dialect, factory.DefaultSchema ); elementType = collection.Element.Type; span = collection.Element.ColumnSpan; *************** *** 122,126 **** int i=0; foreach(Column col in collection.Element.ColumnCollection) { ! elementColumnNames[i] = col.Name; i++; } --- 125,129 ---- int i=0; foreach(Column col in collection.Element.ColumnCollection) { ! elementColumnNames[i] = col.GetQuotedName(dialect); i++; } *************** *** 136,140 **** int i=0; foreach(Column indexCol in indexedMap.Index.ColumnCollection) { ! indexColumnNames[i++] = indexCol.Name; } rowSelectColumnNames = indexColumnNames; --- 139,143 ---- int i=0; foreach(Column indexCol in indexedMap.Index.ColumnCollection) { ! indexColumnNames[i++] = indexCol.GetQuotedName(dialect); } rowSelectColumnNames = indexColumnNames; *************** *** 210,250 **** } ! public string GetSQLWhereString(string alias) { ! string[] tokens = sqlWhereString.Split( ' ', '=', '>', '<', '!' ); ! StringBuilder result = new StringBuilder(); ! foreach(string token in tokens) { ! if (token.Length == 0) ! continue; ! if (char.IsLetter(token[0]) && !keywords.Contains(token) ) { ! //todo: handle and, or, not ! result.Append(alias).Append(StringHelper.Dot).Append(token); ! } else { ! result.Append(token); ! } ! } ! return result.ToString(); ! } - private static readonly IList keywords = new ArrayList(); ! static CollectionPersister() { ! keywords.Add("and"); ! keywords.Add("or"); ! keywords.Add("not"); ! keywords.Add("like"); ! keywords.Add("is"); ! keywords.Add("null"); } ! public string GetSQLOrderByString(string alias) { ! string[] tokens = sqlOrderByString.Split(','); ! StringBuilder result = new StringBuilder(); ! int i=0; ! foreach(string token in tokens) { ! i++; ! result.Append(alias).Append(StringHelper.Dot).Append( token.Trim() ); ! if (i<tokens.Length) result.Append(StringHelper.CommaSpace); ! } ! return result.ToString(); } --- 213,266 ---- } ! public string GetSQLWhereString(string alias) ! { ! if(sqlWhereStringTemplate!=null) ! return StringHelper.Replace(sqlWhereStringTemplate, Template.PlaceHolder, alias); ! else ! return null; ! // string[] tokens = sqlWhereString.Split( ' ', '=', '>', '<', '!' ); ! // StringBuilder result = new StringBuilder(); ! // foreach(string token in tokens) { ! // if (token.Length == 0) ! // continue; ! // if (char.IsLetter(token[0]) && !keywords.Contains(token) ) { ! // //todo: handle and, or, not ! // result.Append(alias).Append(StringHelper.Dot).Append(token); ! // } else { ! // result.Append(token); ! // } ! // } ! // return result.ToString(); } ! // private static readonly IList keywords = new ArrayList(); ! // ! // static CollectionPersister() { ! // keywords.Add("and"); ! // keywords.Add("or"); ! // keywords.Add("not"); ! // keywords.Add("like"); ! // keywords.Add("is"); ! // keywords.Add("null"); ! // } ! ! public string GetSQLOrderByString(string alias) ! { ! if(sqlOrderByStringTemplate!=null) ! return StringHelper.Replace(sqlOrderByStringTemplate, Template.PlaceHolder, alias); ! else ! return null; ! ! // string[] tokens = sqlOrderByString.Split(','); ! // StringBuilder result = new StringBuilder(); ! // int i=0; ! // foreach(string token in tokens) { ! // i++; ! // result.Append(alias).Append(StringHelper.Dot).Append( token.Trim() ); ! // if (i<tokens.Length) result.Append(StringHelper.CommaSpace); ! // } ! // return result.ToString(); } |
From: Michael D. <mik...@us...> - 2004-04-10 03:29:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13519/NHibernate.DomainModel Modified Files: BasicClass.hbm.xml Child.hbm.xml ClassWithCompositeId.hbm.xml JoinedSubclass.hbm.xml Parent.hbm.xml SexType.hbm.xml SimpleComponent.hbm.xml Subclass.hbm.xml Team.hbm.xml UnsavedType.hbm.xml Log Message: Shorted length of table names and column names so Oralce would not have problems with DB Identifiers being too long. JIRA issue NH-48. Index: UnsavedType.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/UnsavedType.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UnsavedType.hbm.xml 9 Mar 2004 16:37:01 -0000 1.2 --- UnsavedType.hbm.xml 10 Apr 2004 03:15:44 -0000 1.3 *************** *** 2,6 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.UnsavedType, NHibernate.DomainModel"> <id name="Id" column="id" unsaved-value="0"> <generator class="identity" /> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.UnsavedType, NHibernate.DomainModel" ! table="uns_type" ! > <id name="Id" column="id" unsaved-value="0"> <generator class="identity" /> Index: Parent.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Parent.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Parent.hbm.xml 24 Mar 2004 12:11:07 -0000 1.4 --- Parent.hbm.xml 10 Apr 2004 03:15:44 -0000 1.5 *************** *** 2,6 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Parent, NHibernate.DomainModel"> <id name="Id" column="id"> <generator class="assigned" /> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Parent, NHibernate.DomainModel" ! table="par" ! > <id name="Id" column="id"> <generator class="assigned" /> *************** *** 8,12 **** <property name="AdultName" type="String" column="adult_name" /> ! <set name="AdultFriends" table="parent_friends" sort="NHibernate.DomainModel.ParentComparer, NHibernate.DomainModel"> <key column="parent_id" /> <many-to-many column="parent_friend_id" class="NHibernate.DomainModel.Parent, NHibernate.DomainModel" /> --- 11,15 ---- <property name="AdultName" type="String" column="adult_name" /> ! <set name="AdultFriends" table="par_frnd" sort="NHibernate.DomainModel.ParentComparer, NHibernate.DomainModel"> <key column="parent_id" /> <many-to-many column="parent_friend_id" class="NHibernate.DomainModel.Parent, NHibernate.DomainModel" /> Index: JoinedSubclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/JoinedSubclass.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JoinedSubclass.hbm.xml 9 Mar 2004 16:43:45 -0000 1.3 --- JoinedSubclass.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 *************** *** 1,5 **** <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.JoinedSubclassBase, NHibernate.DomainModel" table="joined_subclass_base"> <id name="Id" type="Int32" unsaved-value="null" column="joined_subclass_id" > <generator class="assigned" /> --- 1,8 ---- <?xml version="1.0"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.JoinedSubclassBase, NHibernate.DomainModel" ! table="j_sc" ! > <id name="Id" type="Int32" unsaved-value="null" column="joined_subclass_id" > <generator class="assigned" /> *************** *** 10,14 **** <property name="TestDateTime" column="test_date_time" type="DateTime" /> ! <joined-subclass name="NHibernate.DomainModel.JoinedSubclassOne, NHibernate.DomainModel" table="joined_subclass_one"> <key column="joined_subclass_id" /> <property name="OneTestLong" column="one_test_long" type="Int64" /> --- 13,20 ---- <property name="TestDateTime" column="test_date_time" type="DateTime" /> ! <joined-subclass ! name="NHibernate.DomainModel.JoinedSubclassOne, NHibernate.DomainModel" ! table="j_sc_one" ! > <key column="joined_subclass_id" /> <property name="OneTestLong" column="one_test_long" type="Int64" /> Index: Child.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Child.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Child.hbm.xml 9 Mar 2004 16:43:45 -0000 1.4 --- Child.hbm.xml 10 Apr 2004 03:15:44 -0000 1.5 *************** *** 2,6 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Child, NHibernate.DomainModel"> <id name="Id" column="id"> <generator class="assigned" /> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.Child, NHibernate.DomainModel" ! table="child" ! > <id name="Id" column="id"> <generator class="assigned" /> *************** *** 12,16 **** <many-to-one name="Sex" class="NHibernate.DomainModel.SexType, NHibernate.DomainModel" column="sex_type_id"/> ! <map name="Parents" table="child_parent" lazy="true"> <key column="child_id" /> <index column="which_parent" type="String" /> --- 15,19 ---- <many-to-one name="Sex" class="NHibernate.DomainModel.SexType, NHibernate.DomainModel" column="sex_type_id"/> ! <map name="Parents" table="c_prnt" lazy="true"> <key column="child_id" /> <index column="which_parent" type="String" /> *************** *** 18,22 **** </map> ! <list name="Siblings" table="child_siblings" lazy="true"> <key column="child_id" /> <index column="which_sibling" /> --- 21,25 ---- </map> ! <list name="Siblings" table="c_sibs" lazy="true"> <key column="child_id" /> <index column="which_sibling" /> *************** *** 30,34 **** --> ! <array name="Friends" table="child_friends"> <key column="child_id" /> <index column="friend_index" /> --- 33,37 ---- --> ! <array name="Friends" table="c_frnds"> <key column="child_id" /> <index column="friend_index" /> Index: Subclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Subclass.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Subclass.hbm.xml 9 Mar 2004 16:37:01 -0000 1.2 --- Subclass.hbm.xml 10 Apr 2004 03:15:44 -0000 1.3 *************** *** 3,8 **** <class name="NHibernate.DomainModel.JoinedSubclassBase, NHibernate.DomainModel" ! table="one_table_with_subclasses" ! discriminator-value="SUPER"> <id name="Id" type="Int32" column="class_id" > --- 3,9 ---- <class name="NHibernate.DomainModel.JoinedSubclassBase, NHibernate.DomainModel" ! table="one_tab" ! discriminator-value="SUPER" ! > <id name="Id" type="Int32" column="class_id" > Index: SexType.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/SexType.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SexType.hbm.xml 9 Mar 2004 16:43:45 -0000 1.3 --- SexType.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 *************** *** 2,6 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.SexType, NHibernate.DomainModel"> <id name="Id" column="id"> <generator class="identity" /> --- 2,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.SexType, NHibernate.DomainModel" ! table="s_type" ! > <id name="Id" column="id"> <generator class="identity" /> Index: BasicClass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/BasicClass.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicClass.hbm.xml 8 Apr 2004 15:55:46 -0000 1.4 --- BasicClass.hbm.xml 10 Apr 2004 03:15:44 -0000 1.5 *************** *** 3,7 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.BasicClass, NHibernate.DomainModel" > <id name="Id" column="id"> --- 3,9 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.BasicClass, NHibernate.DomainModel" ! table="bc"> <id name="Id" column="id"> *************** *** 9,59 **** </id> ! <property name="BinaryProperty" type="Byte[]" /> ! <property name="BooleanProperty" type="Boolean" /> ! <property name="ByteProperty" type="Byte" /> ! <property name="CharacterProperty" type="Char" /> ! <property name="ClassProperty" type="Type" /> ! <property name="CultureInfoProperty" type="CultureInfo" /> ! <property name="DateTimeProperty" type="DateTime" /> ! <property name="DecimalProperty" type="Decimal(19,5)" /> ! <property name="DoubleProperty" type="Double" /> ! <property name="Int16Property" type="Int16" /> ! <property name="Int32Property" type="Int32" /> ! <property name="Int64Property" type="Int64" /> ! <property name="SerializableProperty" type="NHibernate.DomainModel.SerializableClass, NHibernate.DomainModel(1000)" /> ! <property name="SingleProperty" type="Single" /> ! <property name="StringProperty" type="String" /> ! <property name="TicksProperty" type="Ticks" /> ! <property name="TrueFalseProperty" type="TrueFalse" /> ! <property name="YesNoProperty" type="YesNo" /> ! <array name="StringArray" table="BasicClass_StringArray" > ! <key column="BasicClass_id" /> ! <index column="StringArray_index" /> ! <element column="string_value" type="String(100)" /> </array> ! <primitive-array name="Int32Array" table="BasicClass_Int32Array"> ! <key column="BasicClass_id" /> ! <index column="Int32Array_index" /> ! <element column="int32_value" type="Int32" /> </primitive-array> ! <list name="StringList" table="BasicClass_StringList"> ! <key column="BasicClass_id" /> ! <index column="StringList_index" /> ! <element column="string_value" type="String(300)" /> </list> ! <map name="StringMap" table="BasicClass_StringMap"> ! <key column="BasicClass_id"/> ! <index column="StringMap_index" type="String(10)" /> ! <element column="string_value" type="String(50)" /> </map> ! <set name="StringSet" table="BasicClass_StringSet"> ! <key column="BasicClass_id" /> ! <element column="string_value" type="String(25)"/> </set> --- 11,61 ---- </id> ! <property name="BinaryProperty" type="Byte[]" column="bin_p"/> ! <property name="BooleanProperty" type="Boolean" column="bool_p"/> ! <property name="ByteProperty" type="Byte" column="byte_p"/> ! <property name="CharacterProperty" type="Char" column="char_p"/> ! <property name="ClassProperty" type="Type" column="class_p"/> ! <property name="CultureInfoProperty" type="CultureInfo" column="cinfo_p"/> ! <property name="DateTimeProperty" type="DateTime" column="dtm_p"/> ! <property name="DecimalProperty" type="Decimal(19,5)" column="decm_p"/> ! <property name="DoubleProperty" type="Double" column="dbl_p"/> ! <property name="Int16Property" type="Int16" column="shrt_p" /> ! <property name="Int32Property" type="Int32" column="int_p"/> ! <property name="Int64Property" type="Int64" column="lng_p"/> ! <property name="SerializableProperty" type="NHibernate.DomainModel.SerializableClass, NHibernate.DomainModel(1000)" column="ser_p"/> ! <property name="SingleProperty" type="Single" column="flt_p"/> ! <property name="StringProperty" type="String" column="str_p"/> ! <property name="TicksProperty" type="Ticks" column="ticks_p"/> ! <property name="TrueFalseProperty" type="TrueFalse" column="tf_p"/> ! <property name="YesNoProperty" type="YesNo" column="yn_p"/> ! <array name="StringArray" table="bc_starr" > ! <key column="bc_id" /> ! <index column="sa_idx" /> ! <element column="str_val" type="String(100)" /> </array> ! <primitive-array name="Int32Array" table="bc_inarr"> ! <key column="bc_id" /> ! <index column="inta_idx" /> ! <element column="int32_val" type="Int32" /> </primitive-array> ! <list name="StringList" table="bc_stlst"> ! <key column="bc_id" /> ! <index column="lst_idx" /> ! <element column="str_val" type="String(300)" /> </list> ! <map name="StringMap" table="bc_stmap"> ! <key column="bc_id"/> ! <index column="strm_idx" type="String(10)" /> ! <element column="str_val" type="String(50)" /> </map> ! <set name="StringSet" table="bc_stset"> ! <key column="bc_id" /> ! <element column="str_val" type="String(25)"/> </set> Index: Team.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Team.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Team.hbm.xml 9 Mar 2004 16:43:45 -0000 1.3 --- Team.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 *************** *** 10,14 **** <key column="team_id" /> <index column="player_index" type="Int32" /> ! <one-to-many class="NHibernate.DomainModel.Child, NHibernate.DomainModel"/> </list> --- 10,14 ---- <key column="team_id" /> <index column="player_index" type="Int32" /> ! <one-to-many class="NHibernate.DomainModel.Child, NHibernate.DomainModel" /> </list> Index: SimpleComponent.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/SimpleComponent.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleComponent.hbm.xml 9 Mar 2004 16:43:45 -0000 1.3 --- SimpleComponent.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 *************** *** 2,6 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.SimpleComponent, NHibernate.DomainModel" table="simple_component" > <id name="Key" type="Int64" column="id_" > <generator class="assigned" /> --- 2,8 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.SimpleComponent, NHibernate.DomainModel" ! table="simp_com" ! > <id name="Key" type="Int64" column="id_" > <generator class="assigned" /> Index: ClassWithCompositeId.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/ClassWithCompositeId.hbm.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ClassWithCompositeId.hbm.xml 9 Mar 2004 16:43:45 -0000 1.3 --- ClassWithCompositeId.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 *************** *** 3,7 **** <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.ClassWithCompositeId, NHibernate.DomainModel" table="class_with_composite_id"> <composite-id name="Id" class="NHibernate.DomainModel.CompositeId, NHibernate.DomainModel"> <key-property name="KeyString" column="string_" type="String(20)" /> --- 3,10 ---- <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class ! name="NHibernate.DomainModel.ClassWithCompositeId, NHibernate.DomainModel" ! table="class_w_com_id" ! > <composite-id name="Id" class="NHibernate.DomainModel.CompositeId, NHibernate.DomainModel"> <key-property name="KeyString" column="string_" type="String(20)" /> |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:25
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate/Type Modified Files: DateTimeType.cs DateType.cs TimeType.cs Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TimeType.cs 18 Mar 2004 19:05:58 -0000 1.1 --- TimeType.cs 9 Apr 2004 16:18:00 -0000 1.2 *************** *** 14,18 **** /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : MutableType, IIdentifierType, ILiteralType { --- 14,18 ---- /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : MutableType, IIdentifierType, ILiteralType, IVersionType { *************** *** 87,90 **** --- 87,100 ---- return "'" + value.ToString() + "'"; } + + public object Next(object current) + { + return Seed; + } + + public object Seed + { + get { return DateTime.Now; } + } } } Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DateTimeType.cs 17 Feb 2004 03:30:07 -0000 1.3 --- DateTimeType.cs 9 Apr 2004 16:18:00 -0000 1.4 *************** *** 16,20 **** /// or the <see cref="TicksType"/> /// </remarks> ! public class DateTimeType : MutableType, IIdentifierType, ILiteralType { --- 16,20 ---- /// or the <see cref="TicksType"/> /// </remarks> ! public class DateTimeType : MutableType, IIdentifierType, ILiteralType, IVersionType { *************** *** 104,107 **** --- 104,117 ---- return "'" + value.ToString() + "'"; } + + public object Next(object current) + { + return Seed; + } + + public object Seed + { + get { return DateTime.Now; } + } } } Index: DateType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DateType.cs 16 Mar 2004 03:49:45 -0000 1.5 --- DateType.cs 9 Apr 2004 16:18:00 -0000 1.6 *************** *** 5,9 **** namespace NHibernate.Type { ! public class DateType : MutableType, IIdentifierType, ILiteralType { --- 5,9 ---- namespace NHibernate.Type { ! public class DateType : MutableType, IIdentifierType, ILiteralType, IVersionType { *************** *** 69,72 **** --- 69,82 ---- return "'" + value.ToString() + "'"; } + + public object Next(object current) + { + return Seed; + } + + public object Seed + { + get { return DateTime.Now; } + } } } |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FooBarTest.cs 9 Apr 2004 13:14:54 -0000 1.4 --- FooBarTest.cs 9 Apr 2004 16:18:01 -0000 1.5 *************** *** 31,39 **** // "Container.hbm.xml", // "XY.hbm.xml"}); ! }); } [Test] ! //[Ignore("Maps haven't been converted yet")] public void FetchInitializedCollection() { --- 31,39 ---- // "Container.hbm.xml", // "XY.hbm.xml"}); ! }, false); } [Test] ! //[Ignore("Bugs in quoteing kills other tests too")] public void FetchInitializedCollection() { |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate.DomainModel Modified Files: Baz.hbm.xml Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Baz.hbm.xml 9 Apr 2004 13:14:53 -0000 1.5 --- Baz.hbm.xml 9 Apr 2004 16:18:01 -0000 1.6 *************** *** 108,112 **** </array> ! <bag name="fooBag" lazy="true" table="baz_foo" cascade="all-delete-orphan" inverse="false"> <key column="baz"/> <many-to-many class="NHibernate.DomainModel.Foo, NHibernate.DomainModel" column="foo" outer-join="true"/> --- 108,112 ---- </array> ! <bag name="fooBag" lazy="true" table="baz_foo" cascade="all" inverse="false"> <key column="baz"/> <many-to-many class="NHibernate.DomainModel.Foo, NHibernate.DomainModel" column="foo" outer-join="true"/> *************** *** 165,169 **** </set> ! <set name="cascadingBars" cascade="all-delete-orphan"> <key column="idtopbar" /> <one-to-many class = "NHibernate.DomainModel.Bar, NHibernate.DomainModel"/> --- 165,169 ---- </set> ! <set name="cascadingBars" cascade="all"> <key column="idtopbar" /> <one-to-many class = "NHibernate.DomainModel.Bar, NHibernate.DomainModel"/> |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate/Util Modified Files: ReflectHelper.cs Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: ReflectHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ReflectHelper.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ReflectHelper.cs 6 Apr 2004 10:53:01 -0000 1.8 --- ReflectHelper.cs 9 Apr 2004 16:18:01 -0000 1.9 *************** *** 89,93 **** //PropertyInfo property = type.GetProperty(propertyName); ! PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); if (property != null) { --- 89,93 ---- //PropertyInfo property = type.GetProperty(propertyName); ! PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.DeclaredOnly); if (property != null) { *************** *** 115,119 **** //PropertyInfo property = type.GetProperty(propertyName); ! PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); if (property != null) { --- 115,119 ---- //PropertyInfo property = type.GetProperty(propertyName); ! PropertyInfo property = type.GetProperty(propertyName, BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.DeclaredOnly); if (property != null) { |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:20
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate/Persister Modified Files: AbstractEntityPersister.cs Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractEntityPersister.cs 24 Mar 2004 19:54:01 -0000 1.14 --- AbstractEntityPersister.cs 9 Apr 2004 16:18:00 -0000 1.15 *************** *** 436,439 **** --- 436,448 ---- versioned = true; versionGetter = ReflectHelper.GetGetter(mappedClass, versionPropertyName); + if (!(model.Version.Type is IVersionType)) + { + log.Warn(model.Name + " has version column " + model.Version.Name + ", but the column type " + model.Version.Type.Name + " is not versionable"); + versionPropertyName = null; + versioned = false; + versionType = null; + versionGetter = null; + } + else versionType = (IVersionType) model.Version.Type; } else { |
From: Peter S. <sz...@us...> - 2004-04-09 16:31:20
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23360/NHibernate/Collection Modified Files: CollectionPersister.cs Log Message: Fixed small bug in collectionpersister in sqlwherestring. Fixed IVersionType in abstractentitypersister consstructor for nonversionable types (ugly fix). Added datetimes as versiontypes. Index: CollectionPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CollectionPersister.cs 4 Mar 2004 04:10:38 -0000 1.14 --- CollectionPersister.cs 9 Apr 2004 16:18:00 -0000 1.15 *************** *** 214,217 **** --- 214,219 ---- StringBuilder result = new StringBuilder(); foreach(string token in tokens) { + if (token.Length == 0) + continue; if (char.IsLetter(token[0]) && !keywords.Contains(token) ) { //todo: handle and, or, not |
From: Peter S. <sz...@us...> - 2004-04-09 14:32:36
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32617/NHibernate/Dialect Modified Files: Dialect.cs Log Message: Added avg function. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Dialect.cs 9 Apr 2004 13:39:46 -0000 1.20 --- Dialect.cs 9 Apr 2004 14:19:09 -0000 1.21 *************** *** 34,38 **** { aggregateFunctions["count"] = new Dialect.CountQueryFunctionInfo(); ! aggregateFunctions["avg"] = new Dialect.CountQueryFunctionInfo(); aggregateFunctions["max"] = new QueryFunctionStandard(); aggregateFunctions["min"] = new QueryFunctionStandard(); --- 34,38 ---- { aggregateFunctions["count"] = new Dialect.CountQueryFunctionInfo(); ! aggregateFunctions["avg"] = new Dialect.AvgQueryFunctionInfo(); aggregateFunctions["max"] = new QueryFunctionStandard(); aggregateFunctions["min"] = new QueryFunctionStandard(); *************** *** 51,56 **** /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "'\"["; ! public const string ClosedQuote = "'\"]"; /// <summary> --- 51,56 ---- /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "`'\"["; ! public const string ClosedQuote = "`'\"]"; /// <summary> |
From: Peter S. <sz...@us...> - 2004-04-09 13:53:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23621/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj TestCase.cs Added Files: TestTestCase.cs Log Message: Added test for testcase. Removed ` from dialect again. Index: TestCase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TestCase.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestCase.cs 9 Apr 2004 13:14:54 -0000 1.7 --- TestCase.cs 9 Apr 2004 13:39:48 -0000 1.8 *************** *** 54,59 **** try { ! conn = new SqlConnection("Server=localhost;initial catalog=nhibernate;User ID=someuser;Password=somepwd"); ! conn.Open(); tran = conn.BeginTransaction(); IDbCommand comm = conn.CreateCommand(); --- 54,61 ---- try { ! if (cfg == null) ! cfg = new Configuration(); ! Connection.IConnectionProvider prov = Connection.ConnectionProviderFactory.NewConnectionProvider(cfg.Properties); ! conn = prov.GetConnection(); tran = conn.BeginTransaction(); IDbCommand comm = conn.CreateCommand(); *************** *** 64,76 **** tran.Commit(); } ! catch { ! tran.Rollback(); if (error) ! throw; } finally { ! conn.Close(); } } --- 66,80 ---- tran.Commit(); } ! catch(Exception exc) { ! if (tran != null) ! tran.Rollback(); if (error) ! throw exc; } finally { ! if (conn != null) ! conn.Close(); } } --- NEW FILE: TestTestCase.cs --- using System; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for TestTestCase. /// </summary> [TestFixture] public class TestTestCase : TestCase { [Test] public void TestExecuteStatement() { base.ExecuteStatement("create table yyyy (x int)"); base.ExecuteStatement("drop table yyyy"); } } } Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NHibernate.Test-1.1.csproj 6 Apr 2004 12:56:39 -0000 1.11 --- NHibernate.Test-1.1.csproj 9 Apr 2004 13:39:46 -0000 1.12 *************** *** 203,206 **** --- 203,211 ---- /> <File + RelPath = "TestTestCase.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "UnsavedValueTest.cs" SubType = "Code" |
From: Peter S. <sz...@us...> - 2004-04-09 13:53:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23621/NHibernate/Dialect Modified Files: Dialect.cs Log Message: Added test for testcase. Removed ` from dialect again. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Dialect.cs 9 Apr 2004 13:14:52 -0000 1.19 --- Dialect.cs 9 Apr 2004 13:39:46 -0000 1.20 *************** *** 51,55 **** /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "`'\"["; public const string ClosedQuote = "'\"]"; --- 51,55 ---- /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "'\"["; public const string ClosedQuote = "'\"]"; |
From: Peter S. <sz...@us...> - 2004-04-09 13:28:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17770/NHibernate.DomainModel Modified Files: Baz.cs Baz.hbm.xml Fee.cs Fee.hbm.xml Fo.hbm.xml Foo.cs Fum.hbm.xml Fumm.hbm.xml Glarch.hbm.xml NHibernate.DomainModel-1.1.csproj Qux.hbm.xml Added Files: Fum.cs FumCompositeID.cs MultiplicityType.cs Log Message: FooBar is on the way. --- NEW FILE: FumCompositeID.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { [Serializable] public class FumCompositeID { String string_; DateTime date_; short short_; public override bool Equals(object obj) { FumCompositeID that = (FumCompositeID) obj; return this.string_.Equals(that.string_) && this.short_==that.short_; } public override int GetHashCode() { return string_.GetHashCode(); } public string @string { get { return string_; } set { this.string_ = value; } } public DateTime date { get { return date_; } set { this.date_ = value; } } public short @short { get { return short_; } set { this.short_ = value; } } } } Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NHibernate.DomainModel-1.1.csproj 8 Apr 2004 17:22:08 -0000 1.8 --- NHibernate.DomainModel-1.1.csproj 9 Apr 2004 13:14:53 -0000 1.9 *************** *** 250,257 **** --- 250,267 ---- /> <File + RelPath = "Fum.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Fum.hbm.xml" BuildAction = "EmbeddedResource" /> <File + RelPath = "FumCompositeID.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "Fumm.hbm.xml" BuildAction = "EmbeddedResource" *************** *** 307,310 **** --- 317,325 ---- /> <File + RelPath = "MultiplicityType.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NestingComponent.cs" SubType = "Code" Index: Fumm.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fumm.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fumm.hbm.xml 6 Apr 2004 13:36:18 -0000 1.2 --- Fumm.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 7,11 **** </key-property> <key-property name="short" column="short_" /> ! <key-property name="date" column="date_" type="date" /> </composite-id> <property name="locale" /> --- 7,11 ---- </key-property> <key-property name="short" column="short_" /> ! <key-property name="date" column="date_" type="DateTime" /> </composite-id> <property name="locale" /> --- NEW FILE: Fum.cs --- using System; using System.Collections; namespace NHibernate.DomainModel { public class Fum : ILifecycle { private String _fum; private FumCompositeID _id; private Fum _fo; private Qux[] _quxArray; private IList _friends; private DateTime _lastUpdated; public Fum() {} public Fum(FumCompositeID id) { this.id = id; friends = new ArrayList(); FumCompositeID fid = new FumCompositeID(); fid.date= new DateTime(); fid.@short= (short) ( id.@short + 33 ); fid.@string= id.@string + "dd"; Fum f = new Fum(); f.id = fid; f.fum="FRIEND"; friends.Add(f); } public string fum { get { return _fum; } set { this._fum = value; } } public FumCompositeID id { get { return _id; } set { this._id = value; } } public Fum fo { get { return _fo; } set { this._fo = value; } } public Qux[] quxArray { get { return _quxArray; } set { this._quxArray = value; } } public IList friends { get { return _friends; } set { this._friends = value; } } public LifecycleVeto OnDelete(ISession s) { if (friends==null) return LifecycleVeto.NoVeto; try { IEnumerator iter = friends.GetEnumerator(); while ( iter.MoveNext() ) { s.Delete( iter.Current ); } } catch (Exception e) { throw new CallbackException(e); } return LifecycleVeto.NoVeto; } public void OnLoad(ISession s, object id) { } public LifecycleVeto OnSave(ISession s) { if (friends==null) return LifecycleVeto.NoVeto; try { IEnumerator iter = friends.GetEnumerator(); while ( iter.MoveNext() ) { s.Save( iter.Current ); } } catch (Exception e) { throw new CallbackException(e); } return LifecycleVeto.NoVeto; } public LifecycleVeto OnUpdate(ISession s) { return LifecycleVeto.NoVeto; } public DateTime lastUpdated { get { return _lastUpdated; } set { _lastUpdated = value; } } } } Index: Qux.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Qux.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Qux.hbm.xml 6 Apr 2004 13:36:18 -0000 1.2 --- Qux.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 1,9 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="net.sf.hibernate.test.Qux" table="quux" proxy="net.sf.hibernate.test.Qux"> <!----> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> </id> ! <many-to-one name="foo" class="net.sf.hibernate.test.Foo"> <column name="foo" length="36" /> </many-to-one> --- 1,9 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Qux, NHibernate.DomainModel" table="quux" proxy="NHibernate.DomainModel.Qux, NHibernate.DomainModel"> <id name="key" column="qux_key" unsaved-value="0"> <generator class="hilo" /> </id> ! <many-to-one name="foo" class="NHibernate.DomainModel.Foo, NHibernate.DomainModel"> <column name="foo" length="36" /> </many-to-one> *************** *** 12,20 **** <property name="stored" /> <property name="created" /> ! <property name="childKey" type="long" /> <property name="stuff" /> <set name="fums" lazy="true"> <key column="qux_id" /> ! <many-to-many class="net.sf.hibernate.test.Fum"> <column name="fum_string" length="10" not-null="true" /> <column name="fum_short" not-null="true" /> --- 12,20 ---- <property name="stored" /> <property name="created" /> ! <property name="childKey" type="Int64" /> <property name="stuff" /> <set name="fums" lazy="true"> <key column="qux_id" /> ! <many-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel"> <column name="fum_string" length="10" not-null="true" /> <column name="fum_short" not-null="true" /> *************** *** 25,29 **** <key column="qux_id" /> <index column="posn" /> ! <one-to-many class="net.sf.hibernate.test.Fum" /> </list> </class> --- 25,29 ---- <key column="qux_id" /> <index column="posn" /> ! <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </list> </class> Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Baz.cs 8 Apr 2004 14:59:32 -0000 1.1 --- Baz.cs 9 Apr 2004 13:14:53 -0000 1.2 *************** *** 25,28 **** --- 25,47 ---- { + /// <summary> + /// Holds the _collectionComponent + /// </summary> + private NestingComponent _collectionComponent; + + /// <summary> + /// Gets or sets the _collectionComponent + /// </summary> + public NestingComponent collectionComponent + { + get + { + return _collectionComponent; + } + set + { + _collectionComponent = value; + } + } #region Fields /// <summary> Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Foo.cs 8 Apr 2004 16:37:39 -0000 1.3 --- Foo.cs 9 Apr 2004 13:14:53 -0000 1.4 *************** *** 688,692 **** component.glarch = new Glarch(); dependent = new Fee(); ! dependent.Fi = "belongs to foo # " + key; locale = System.Threading.Thread.CurrentThread.CurrentCulture.Name; return LifecycleVeto.NoVeto; --- 688,692 ---- component.glarch = new Glarch(); dependent = new Fee(); ! dependent.fi = "belongs to foo # " + key; locale = System.Threading.Thread.CurrentThread.CurrentCulture.Name; return LifecycleVeto.NoVeto; Index: Fee.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fee.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Fee.cs 8 Apr 2004 14:59:32 -0000 1.1 --- Fee.cs 9 Apr 2004 13:14:53 -0000 1.2 *************** *** 8,18 **** { public Fee _fee; ! public Fee anotherFee; ! public String fi; ! public String key; ! public System.Collections.IDictionary fees; ! private Qux qux; ! private FooComponent compon; ! private int count; public Fee() --- 8,18 ---- { public Fee _fee; ! public Fee _anotherFee; ! public String _fi; ! public String _key; ! public System.Collections.IDictionary _fees; ! private Qux _qux; ! private FooComponent _compon; ! private int _count; public Fee() *************** *** 24,115 **** get { ! return fee; } set { ! this.fee = value; } } ! public string Fi { get { ! return fi; } set { ! this.fi = value; } } ! public string Key { get { ! return key; } set { ! this.key = value; } } ! public System.Collections.IDictionary Fees { get { ! return fees; } set { ! this.fees = value; } } ! public Fee AnotherFee { get { ! return anotherFee; } set { ! this.anotherFee = value; } } ! public Qux Qux { get { ! return qux; } set { ! this.qux = value; } } ! public FooComponent Compon { get { ! return compon; } set { ! this.compon = value; } } ! public int Count { get { ! return count; } set { ! count = value; } } --- 24,115 ---- get { ! return _fee; } set { ! this._fee = value; } } ! public string fi { get { ! return _fi; } set { ! this._fi = value; } } ! public string key { get { ! return _key; } set { ! this._key = value; } } ! public System.Collections.IDictionary fees { get { ! return _fees; } set { ! this._fees = value; } } ! public Fee anotherFee { get { ! return _anotherFee; } set { ! this._anotherFee = value; } } ! public Qux qux { get { ! return _qux; } set { ! this._qux = value; } } ! public FooComponent compon { get { ! return _compon; } set { ! this._compon = value; } } ! public int count { get { ! return _count; } set { ! _count = value; } } Index: Fum.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fum.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fum.hbm.xml 6 Apr 2004 13:36:17 -0000 1.2 --- Fum.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 1,5 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="net.sf.hibernate.test.Fum"> <composite-id name="id" unsaved-value="any"> <key-property name="string"> --- 1,5 ---- <?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"> *************** *** 7,13 **** </key-property> <key-property name="short" column="short_" /> ! <key-property name="date" column="date_" type="date" /> </composite-id> ! <version name="lastUpdated" type="calendar" /> <property name="fum" not-null="true" /> <many-to-one name="fo"> --- 7,13 ---- </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"> *************** *** 22,26 **** <column name="fr_date" /> </key> ! <one-to-many class="net.sf.hibernate.test.Fum" /> </set> <array name="quxArray"> --- 22,26 ---- <column name="fr_date" /> </key> ! <one-to-many class="NHibernate.DomainModel.Fum, NHibernate.DomainModel" /> </set> <array name="quxArray"> *************** *** 31,35 **** </key> <index column="i" /> ! <one-to-many class="net.sf.hibernate.test.Qux" /> </array> </class> --- 31,35 ---- </key> <index column="i" /> ! <one-to-many class="NHibernate.DomainModel.Qux, NHibernate.DomainModel" /> </array> </class> Index: Baz.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Baz.hbm.xml 8 Apr 2004 17:22:08 -0000 1.4 --- Baz.hbm.xml 9 Apr 2004 13:14:53 -0000 1.5 *************** *** 96,100 **** <key column="id_"/> <index column="map_key" type="String" length="32"/> ! <element column="map_value" type="date"/> </map> --- 96,100 ---- <key column="id_"/> <index column="map_key" type="String" length="32"/> ! <element column="map_value" type="DateTime"/> </map> *************** *** 114,118 **** <idbag name="idFooBag" lazy="true" table="baz_id_foo" cascade="all"> ! <collection-id column="pkid" type="long"> <generator class="hilo"/> </collection-id> --- 114,118 ---- <idbag name="idFooBag" lazy="true" table="baz_id_foo" cascade="all"> ! <collection-id column="pkid" type="Int64"> <generator class="hilo"/> </collection-id> *************** *** 122,126 **** <idbag name="byteBag" lazy="true" table="baz_byte_bag" cascade="all"> ! <collection-id column="pkid" type="long"> <generator class="hilo"/> </collection-id> --- 122,126 ---- <idbag name="byteBag" lazy="true" table="baz_byte_bag" cascade="all"> ! <collection-id column="pkid" type="Int64"> <generator class="hilo"/> </collection-id> *************** *** 203,211 **** <map name="anyToAny" lazy="true"> <key column="baz"/> ! <index-many-to-any id-type="long"> <column name="ind_clazz_"/> <column name="ind_id_"/> </index-many-to-any> ! <many-to-any id-type="long"> <column name="el_clazz_"/> <column name="el_id_"/> --- 203,211 ---- <map name="anyToAny" lazy="true"> <key column="baz"/> ! <index-many-to-any id-type="Int64"> <column name="ind_clazz_"/> <column name="ind_id_"/> </index-many-to-any> ! <many-to-any id-type="Int64"> <column name="el_clazz_"/> <column name="el_id_"/> *************** *** 232,236 **** <bag name="floats" table="baz_floats_bag"> <key column="baz_compon_id"/> ! <element type="float" column="float_value"/> </bag> </component> --- 232,236 ---- <bag name="floats" table="baz_floats_bag"> <key column="baz_compon_id"/> ! <element type="Int64" column="float_value"/> </bag> </component> Index: Fee.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fee.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fee.hbm.xml 6 Apr 2004 13:36:17 -0000 1.2 --- Fee.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 1,6 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="net.sf.hibernate.test.Fee" table="`the fees`"> ! <id type="string" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex" /> </id> --- 1,6 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Fee, NHibernate.DomainModel" table="`the fees`"> ! <id type="String" name="key" column="id_" length="64" unsaved-value="null"> <generator class="uuid.hex" /> </id> *************** *** 12,16 **** <set name="fees"> <key column="fee_id" /> ! <element column="str_" type="string" /> </set> <component name="compon" update="false"> --- 12,16 ---- <set name="fees"> <key column="fee_id" /> ! <element column="str_" type="String" /> </set> <component name="compon" update="false"> --- NEW FILE: MultiplicityType.cs --- using System; using System.Data; namespace NHibernate.DomainModel { public class MultiplicityType : ICompositeUserType { private static string[] PROP_NAMES = new String[] { "count", "glarch" }; private static Type.IType[] TYPES = new Type.IType[] { NHibernate.Int32, NHibernate.GetSerializable(typeof(Glarch)) }; public String[] PropertyNames { get { return PROP_NAMES; } } public Type.IType[] PropertyTypes { get { return TYPES; } } public object GetPropertyValue(object component, int property) { Multiplicity o = (Multiplicity) component; return property==0 ? (object)o.count : (object)o.glarch; } public void SetPropertyValue(object component, int property, object value) { Multiplicity o = (Multiplicity) component; if (property==0) { o.count = (int)value; } else { o.glarch = (Glarch) value; } } public System.Type ReturnedClass { get { return typeof(Multiplicity); } } public new bool Equals(object x, object y) { Multiplicity mx = (Multiplicity) x; Multiplicity my = (Multiplicity) y; if (mx==my) return true; if (mx==null || my==null) return false; return mx.count==my.count && mx.glarch==my.glarch; } public object NullSafeGet(IDataReader rs, String[] names, Engine.ISessionImplementor session, Object owner) { int c = (int) NHibernate.Int32.NullSafeGet( rs, names[0], session, owner); GlarchProxy g = (GlarchProxy) NHibernate.GetSerializable(typeof(Glarch)).NullSafeGet(rs, names[1], session, owner); Multiplicity m = new Multiplicity(); m.count = c==0 ? 0 : c; m.glarch = g; return m; } public void NullSafeSet(IDbCommand st, Object value, int index, Engine.ISessionImplementor session) { Multiplicity o = (Multiplicity) value; GlarchProxy g; int c; if (o==null) { g=null; c=0; } else { g = o.glarch; c =o.count; } NHibernate.Int32.NullSafeSet(st, c, index, session); NHibernate.GetSerializable(typeof(Glarch)).NullSafeSet(st, g, index+1, session); } public object DeepCopy(object value) { if (value==null) return null; Multiplicity v = (Multiplicity) value; Multiplicity m = new Multiplicity(); m.count = v.count; m.glarch = m.glarch; return m; } public bool IsMutable { get { return true; } } public object Assemble(object cached, Engine.ISessionImplementor session, Object owner) { throw new InvalidOperationException(); } public object Disassemble(Object value, Engine.ISessionImplementor session) { throw new InvalidOperationException(); } } } Index: Fo.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Fo.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Fo.hbm.xml 6 Apr 2004 13:36:17 -0000 1.2 --- Fo.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 7,11 **** </key-property> <key-property name="short" column="short_" /> ! <key-property name="date" column="date_" type="date" /> </composite-id> <version name="version" type="long" /> --- 7,11 ---- </key-property> <key-property name="short" column="short_" /> ! <key-property name="date" column="date_" type="DateTime" /> </composite-id> <version name="version" type="long" /> Index: Glarch.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Glarch.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Glarch.hbm.xml 6 Apr 2004 13:36:18 -0000 1.2 --- Glarch.hbm.xml 9 Apr 2004 13:14:53 -0000 1.3 *************** *** 1,8 **** <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="net.sf.hibernate.test.Glarch" table="`glarchez`" proxy="net.sf.hibernate.test.GlarchProxy" ! dynamic-update="true"> <!--<jcs-cache usage="read-write"/>--> ! <id type="string" column="tha_key" length="32"> <generator class="uuid.hex" /> </id> --- 1,8 ---- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> ! <class name="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" table="`glarchez`" ! proxy="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel" dynamic-update="true"> <!--<jcs-cache usage="read-write"/>--> ! <id type="String" column="tha_key" length="32"> <generator class="uuid.hex" /> </id> *************** *** 10,18 **** <property name="name" column="namecvbnmasdf" /> <!-- <property name="currency"/> --> ! <many-to-one name="next" column="next_" class="net.sf.hibernate.test.Glarch" /> <property name="order" column="order_" /> <dynabean name="dynaBean" dynaclass="foo"> ! <property name="foo" type="string" /> ! <property name="bar" type="integer" /> </dynabean> <property name="x" /> --- 10,18 ---- <property name="name" column="namecvbnmasdf" /> <!-- <property name="currency"/> --> ! <many-to-one name="next" column="next_" class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> <property name="order" column="order_" /> <dynabean name="dynaBean" dynaclass="foo"> ! <property name="foo" type="String" /> ! <property name="bar" type="Int32" /> </dynabean> <property name="x" /> *************** *** 20,32 **** <key column="glarch_key" /> <index column="`!@# i`" /> ! <element type="string" column="`tha_stryng`" /> </list> <list name="fooComponents" lazy="true" cascade="all"> <key column="glarch_key" /> <index column="tha_indecks" /> ! <composite-element class="net.sf.hibernate.test.FooComponent"> <property name="name" column="name_" /> <property name="count" column="count_" /> ! <nested-composite-element name="subcomponent" class="net.sf.hibernate.test.FooComponent"> <property name="name" column="x_" /> <property name="count" column="y_" /> --- 20,32 ---- <key column="glarch_key" /> <index column="`!@# i`" /> ! <element type="String" column="`tha_stryng`" /> </list> <list name="fooComponents" lazy="true" cascade="all"> <key column="glarch_key" /> <index column="tha_indecks" /> ! <composite-element class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> <property name="name" column="name_" /> <property name="count" column="count_" /> ! <nested-composite-element name="subcomponent" class="NHibernate.DomainModel.FooComponent, NHibernate.DomainModel"> <property name="name" column="x_" /> <property name="count" column="y_" /> *************** *** 35,54 **** </composite-element> </list> ! <array name="proxyArray" element-class="net.sf.hibernate.test.GlarchProxy"> <key column="array_key" /> <index column="array_indecks" /> ! <one-to-many class="net.sf.hibernate.test.Glarch" /> </array> <set name="proxySet"> <key column="set_key" /> ! <one-to-many class="net.sf.hibernate.test.Glarch" /> </set> <property name="immutable" update="false" /> <property name="derivedVersion" insert="false" update="false" column="version" /> ! <property name="any" type="object"> <column name="`any_id of object`" /> <column name="`any_class of object`" /> ! </property> ! <property name="multiple" type="net.sf.hibernate.test.MultiplicityType"> <column name="count_" /> <column name="glarch_" /> --- 35,54 ---- </composite-element> </list> ! <array name="proxyArray" element-class="NHibernate.DomainModel.GlarchProxy, NHibernate.DomainModel"> <key column="array_key" /> <index column="array_indecks" /> ! <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </array> <set name="proxySet"> <key column="set_key" /> ! <one-to-many class="NHibernate.DomainModel.Glarch, NHibernate.DomainModel" /> </set> <property name="immutable" update="false" /> <property name="derivedVersion" insert="false" update="false" column="version" /> ! <any name="any" id-type="System.Object"> <column name="`any_id of object`" /> <column name="`any_class of object`" /> ! </any> ! <property name="multiple" type="NHibernate.DomainModel.MultiplicityType, NHibernate.DomainModel"> <column name="count_" /> <column name="glarch_" /> |
From: Peter S. <sz...@us...> - 2004-04-09 13:28:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Eg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17770/NHibernate/Eg Modified Files: Edge.hbm.xml Vertex.hbm.xml Log Message: FooBar is on the way. Index: Edge.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Eg/Edge.hbm.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Edge.hbm.xml 6 Apr 2004 13:36:17 -0000 1.2 --- Edge.hbm.xml 9 Apr 2004 13:14:52 -0000 1.3 *************** *** 11,15 **** <property name="Length" column="edge_length" /> <property name="Capacity" column="edge_cpcty" /> ! <property name="CreationDate" type="date" /> </class> </hibernate-mapping> --- 11,15 ---- <property name="Length" column="edge_length" /> <property name="Capacity" column="edge_cpcty" /> ! <property name="CreationDate" type="DateTime" /> </class> </hibernate-mapping> Index: Vertex.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Eg/Vertex.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Vertex.hbm.xml 6 Apr 2004 13:36:17 -0000 1.4 --- Vertex.hbm.xml 9 Apr 2004 13:14:52 -0000 1.5 *************** *** 1,3 **** ! <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Eg.Vertex" table="vertex"> --- 1,3 ---- ! <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Eg.Vertex" table="vertex"> *************** *** 17,21 **** <one-to-many class="NHibernate.Eg.Edge" /> </list> ! <property name="CreationDate" type="date" /> <subclass name="NHibernate.Eg.Source"> <property column="Strength" name="SourceStrength" /> --- 17,21 ---- <one-to-many class="NHibernate.Eg.Edge" /> </list> ! <property name="CreationDate" type="DateTime" /> <subclass name="NHibernate.Eg.Source"> <property column="Strength" name="SourceStrength" /> |
From: Peter S. <sz...@us...> - 2004-04-09 13:28:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17770/NHibernate.Test Modified Files: FooBarTest.cs TestCase.cs Log Message: FooBar is on the way. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FooBarTest.cs 8 Apr 2004 16:37:39 -0000 1.3 --- FooBarTest.cs 9 Apr 2004 13:14:54 -0000 1.4 *************** *** 14,22 **** { ExportSchema(new string[] { "FooBar.hbm.xml", "Baz.hbm.xml" - // "Qux.hbm.xml", - // "Glarch.hbm.xml", // "Simple.hbm.xml", - // "Fum.hbm.xml", // "Fumm.hbm.xml", // "Fo.hbm.xml", --- 14,23 ---- { ExportSchema(new string[] { "FooBar.hbm.xml", + "Glarch.hbm.xml", + "Fee.hbm.xml", + "Qux.hbm.xml", + "Fum.hbm.xml", "Baz.hbm.xml" // "Simple.hbm.xml", // "Fumm.hbm.xml", // "Fo.hbm.xml", *************** *** 24,28 **** // "Many.hbm.xml", // "Immutable.hbm.xml", - // "Fee.hbm.xml", // "Vetoer.hbm.xml", // "Holder.hbm.xml", --- 25,28 ---- Index: TestCase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TestCase.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestCase.cs 8 Apr 2004 07:43:29 -0000 1.6 --- TestCase.cs 9 Apr 2004 13:14:54 -0000 1.7 *************** *** 50,55 **** public void ExecuteStatement(string sql, bool error) { ! SqlConnection conn = null; ! SqlTransaction tran = null; try { --- 50,55 ---- public void ExecuteStatement(string sql, bool error) { ! IDbConnection conn = null; ! IDbTransaction tran = null; try { *************** *** 57,61 **** conn.Open(); tran = conn.BeginTransaction(); ! System.Data.SqlClient.SqlCommand comm = conn.CreateCommand(); comm.CommandText = sql; comm.Transaction = tran; --- 57,61 ---- conn.Open(); tran = conn.BeginTransaction(); ! IDbCommand comm = conn.CreateCommand(); comm.CommandText = sql; comm.Transaction = tran; |
From: Peter S. <sz...@us...> - 2004-04-09 13:28:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17770/NHibernate/Dialect Modified Files: Dialect.cs MsSql2000Dialect.cs Log Message: FooBar is on the way. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Dialect.cs 6 Apr 2004 00:31:07 -0000 1.18 --- Dialect.cs 9 Apr 2004 13:14:52 -0000 1.19 *************** *** 51,55 **** /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "'\"["; public const string ClosedQuote = "'\"]"; --- 51,55 ---- /// Characters used for quoting sql identifiers /// </summary> ! public const string Quote = "`'\"["; public const string ClosedQuote = "'\"]"; Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MsSql2000Dialect.cs 21 Mar 2004 00:48:27 -0000 1.5 --- MsSql2000Dialect.cs 9 Apr 2004 13:14:52 -0000 1.6 *************** *** 144,147 **** --- 144,152 ---- } + protected override string SqlTypeToString(TimeSqlType sqlType) + { + return "DATETIME"; + } + protected override string SqlTypeToString(DecimalSqlType sqlType) { |
From: Michael D. <mik...@us...> - 2004-04-09 12:51:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10585/Mapping Modified Files: Bag.cs Log Message: Added support for Bag collections. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Bag.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Bag.cs 22 Apr 2003 19:46:37 -0000 1.2 --- Bag.cs 9 Apr 2004 12:37:56 -0000 1.3 *************** *** 10,26 **** public class Bag : Collection { ! public Bag(PersistentClass owner) : base(owner) { } ! public override PersistentCollectionType Type { ! get { ! return null; //TODO: return TypeFactory.Bag( Role ); ! } } ! public override System.Type WrapperClass { ! get { ! return typeof(NHibernateBag); ! } } --- 10,25 ---- public class Bag : Collection { ! public Bag(PersistentClass owner) : base(owner) ! { } ! public override PersistentCollectionType Type ! { ! get { return TypeFactory.Bag( Role );} } ! public override System.Type WrapperClass ! { ! get { return typeof(NHibernateBag); } } |
From: Michael D. <mik...@us...> - 2004-04-09 12:51:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10585/Cfg Modified Files: Binder.cs Log Message: Added support for Bag collections. Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Binder.cs 9 Apr 2004 09:09:33 -0000 1.11 --- Binder.cs 9 Apr 2004 12:37:55 -0000 1.12 *************** *** 943,946 **** --- 943,959 ---- } + private static CollectionType BAG = new CollectionTypeBag("bag"); + private class CollectionTypeBag : CollectionType + { + public CollectionTypeBag(string xmlTag) : base(xmlTag) {} + public override Mapping.Collection Create(XmlNode node, string prefix, PersistentClass owner, Mappings mappings) + { + Bag bag = new Bag(owner); + Binder.BindCollection(node, bag, prefix, mappings); + return bag; + } + + } + private static CollectionType MAP = new CollectionTypeMap("map"); private class CollectionTypeMap : CollectionType { *************** *** 996,999 **** --- 1009,1013 ---- static CollectionType() { Instances.Add(MAP.ToString(), MAP); + Instances.Add(BAG.ToString(), BAG); Instances.Add(SET.ToString(), SET); Instances.Add(LIST.ToString(), LIST); |
From: Michael D. <mik...@us...> - 2004-04-09 12:51:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10585/Type Modified Files: BagType.cs TypeFactory.cs Log Message: Added support for Bag collections. Index: BagType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/BagType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BagType.cs 20 Feb 2003 21:42:13 -0000 1.1 --- BagType.cs 9 Apr 2004 12:37:56 -0000 1.2 *************** *** 1,17 **** using System; namespace NHibernate.Type { /// <summary> ! /// Summary description for BagType. /// </summary> ! public class BagType { ! public BagType() { - // - // TODO: Add constructor logic here - // } } ! } --- 1,40 ---- using System; + using System.Collections; + + using NHibernate.Collection; + using NHibernate.Engine; namespace NHibernate.Type { /// <summary> ! /// /// </summary> ! public class BagType : PersistentCollectionType { ! public BagType(string role) : base(role) { } + + public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) + { + return new Bag(session); + } + + public override System.Type ReturnedClass + { + get { return typeof(IList); } + } + + public override PersistentCollection Wrap(ISessionImplementor session, object collection) + { + return new Bag(session, (ICollection)collection); + } + + + public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) + { + return new Bag(session, persister, disassembled, owner); + } + } ! } \ No newline at end of file Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TypeFactory.cs 8 Apr 2004 15:55:46 -0000 1.23 --- TypeFactory.cs 9 Apr 2004 12:37:56 -0000 1.24 *************** *** 1013,1020 **** } ! /*public static PersistentCollectionType Bag(string role) ! * { return new BagType(role); ! }*/ public static PersistentCollectionType Map(string role) --- 1013,1020 ---- } ! public static PersistentCollectionType Bag(string role) ! { return new BagType(role); ! } public static PersistentCollectionType Map(string role) |
From: Michael D. <mik...@us...> - 2004-04-09 12:51:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10585/Collection Modified Files: Bag.cs Log Message: Added support for Bag collections. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bag.cs 20 Feb 2003 21:42:06 -0000 1.1 --- Bag.cs 9 Apr 2004 12:37:55 -0000 1.2 *************** *** 1,3 **** --- 1,8 ---- using System; + using System.Collections; + using System.Data; + + using NHibernate.Engine; + using NHibernate.Type; namespace NHibernate.Collection *************** *** 6,17 **** /// Summary description for Bag. /// </summary> ! public class Bag { ! public Bag() { - // - // TODO: Add constructor logic here - // } } } --- 11,370 ---- /// Summary description for Bag. /// </summary> ! public class Bag : ODMGCollection, IList { ! private IList bag; ! // used to hold the Identifiers of the Elements that will later ! // be moved to the bag field. ! private IList bagIdentifiers; ! ! public Bag(ISessionImplementor session) : base(session) { } + + public Bag(ISessionImplementor session, ICollection coll) : base(session) + { + bag = coll as IList; + + if(bag == null) + { + bag = new ArrayList(); + ((ArrayList)bag).AddRange(coll); + } + + initialized = true; + directlyAccessible = true; + } + + public Bag(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) : base(session) + { + BeforeInitialize(persister); + object[] array = (object[])disassembled; + for(int i=0; i<array.Length; i++) + { + bag.Add(persister.ElementType.Assemble(array[i], session, owner)); + } + initialized = true; + } + + public override ICollection Elements() + { + return bag; + } + + public override bool Empty + { + get{ return bag.Count==0;} + } + + public override ICollection Entries() + { + return bag; + } + + public override void EndRead(CollectionPersister persister, object owner) + { + for(int i = 0 ;i < bagIdentifiers.Count; i++) + { + object element = persister.ElementType.ResolveIdentifier(bagIdentifiers[i], session, owner); + bag[i] = element; + } + } + + public override object ReadFrom(IDataReader reader, CollectionPersister persister, object owner) + { + object elementIdentifier = persister.ReadElementIdentifier(reader, owner, session); + int index = (int) persister.ReadIndex(reader, session); + for (int i=bag.Count; i<=index; i++) + { + bag.Insert(i, null); + bagIdentifiers.Insert(i , null); + } + bagIdentifiers[index] = elementIdentifier; + return elementIdentifier; + } + + [Obsolete("See PersistentCollection.ReadEntries for reason")] + public override void ReadEntries(ICollection entries) + { + foreach(object obj in entries) + { + bag.Add(obj); + } + } + + public override void WriteTo(IDbCommand st, CollectionPersister persister, object entry, int i, bool writeOrder) + { + persister.WriteElement(st, entry, writeOrder, session); + } + + public override void BeforeInitialize(CollectionPersister persister) + { + this.bag = new ArrayList(); + this.bagIdentifiers = new ArrayList(); + } + + public override bool EqualsSnapshot(IType elementType) + { + IList sn = (IList)GetSnapshot(); + if(sn.Count!=bag.Count) return false; + + foreach(object elt in bag) + { + if ( CountOccurrences(elt, bag, elementType)!=CountOccurrences(elt, sn, elementType) ) return false; + } + + return true; + } + + private int CountOccurrences(object element, IList list, IType elementType) + { + int result = 0; + foreach(object obj in list) + { + if ( elementType.Equals(element, obj) ) result++; + } + + return result; + } + + protected override object Snapshot(CollectionPersister persister) + { + ArrayList clonedList = new ArrayList( bag.Count ); + foreach(object obj in bag) + { + clonedList.Add( persister.ElementType.DeepCopy(obj) ); + } + return clonedList; + } + + public override ICollection GetOrphans(object snapshot) + { + IList sn = (IList)snapshot; + ArrayList result = new ArrayList(); + result.AddRange(sn); + PersistentCollection.IdentityRemoveAll(result, bag, session); + return result; + } + + public override object Disassemble(CollectionPersister persister) + { + int length = bag.Count; + object[] result = new object[length]; + + for(int i = 0; i<length; i++) + { + result[i] = persister.ElementType.Disassemble(bag[i], session); + } + + return result; + } + + public override bool NeedsRecreate(CollectionPersister persister) + { + return !persister.IsOneToMany; + } + + + // For a one-to-many, a <bag> is not really a bag; + // it is *really* a set, since it can't contain the + // same element twice. It could be considered a bug + // in the mapping dtd that <bag> allows <one-to-many>. + + // Anyway, here we implement <set> semantics for a + // <one-to-many> <bag>! + + public override ICollection GetDeletes(IType elemType) + { + ArrayList deletes = new ArrayList(); + IList sn = (IList)GetSnapshot(); + + int i = 0; + + foreach(object oldObject in sn) + { + bool found = false; + if(bag.Count>1 && elemType.Equals(oldObject, bag[i++])) + { + //a shortcut if its location didn't change! + found = true; + } + else + { + //search for it + foreach(object newObject in bag) + { + if( elemType.Equals(oldObject, newObject) ) + { + found = true; + break; + } + } + } + if(!found) deletes.Add(oldObject); + } + + return deletes; + } + + public override bool NeedsInserting(object entry, int i, IType elemType) + { + IList sn = (IList)GetSnapshot(); + if( sn.Count>1 && elemType.Equals(sn[i], entry) ) + { + // a shortcut if its location didn't change + return false; + } + else + { + //search for it + foreach( object oldObject in sn ) + { + if( elemType.Equals(oldObject, entry) ) return false; + } + return true; + } + } + + public override bool NeedsUpdating(object entry, int i, IType elemType) + { + return false; + } + + + #region IList Members + + public bool IsReadOnly + { + get { return false; } + } + + public object this[int index] + { + get + { + Read(); + return bag[index]; + } + set + { + Write(); + bag[index] = value; + } + } + + public void RemoveAt(int index) + { + Write(); + bag.RemoveAt(index); + } + + public void Insert(int index, object value) + { + Write(); + bag.Insert(index, value); + } + + public void Remove(object value) + { + Write(); + bag.Remove(value); + } + + public bool Contains(object value) + { + Read(); + return bag.Contains(value); + } + + public void Clear() + { + Write(); + bag.Clear(); + } + + public int IndexOf(object value) + { + Read(); + return bag.IndexOf(value); + } + + public int Add(object value) + { + if ( !QueueAdd(value) ) + { + Write(); + return bag.Add(value); + } + else + { + return -1; + } + } + + public bool IsFixedSize + { + get { return false; } + } + + #endregion + + #region ICollection Members + + public override bool IsSynchronized + { + get { return false; } + } + + public override int Count + { + get + { + Read(); + return bag.Count; + } + } + + public override void CopyTo(Array array, int index) + { + Read(); + bag.CopyTo(array, index); + } + + public override object SyncRoot + { + get { return this; } + } + + #endregion + + #region IEnumerable Members + + public override IEnumerator GetEnumerator() + { + //TODO: H2.0.3 has an IteratorProxy - do we need?? + return bag.GetEnumerator(); + } + + #endregion + + public override void DelayedAddAll(ICollection coll) + { + foreach(object obj in coll) + { + bag.Add(obj); + } + } + + public override object GetIndex(object entry, int i) + { + throw new NotSupportedException("Bags don't have indexes"); + } + + public override bool EntryExists(object entry, int i) + { + return entry!=null; + } + + } } |
From: Michael D. <mik...@us...> - 2004-04-09 12:50:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10490/Collection Modified Files: List.cs PersistentCollection.cs Log Message: Changed virtual method PersistentCollection.EndRead to abstract. Changed a parameter from arg0 to index in List. Index: PersistentCollection.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/PersistentCollection.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PersistentCollection.cs 28 Mar 2004 06:01:29 -0000 1.10 --- PersistentCollection.cs 9 Apr 2004 12:37:26 -0000 1.11 *************** *** 176,183 **** /// <param name="persister"></param> /// <param name="owner"></param> ! public virtual void EndRead(CollectionPersister persister, object owner) ! { ! // override on baseclasses - will eventually make abstract. ! } public void Initialize(bool writing) --- 176,180 ---- /// <param name="persister"></param> /// <param name="owner"></param> ! public abstract void EndRead(CollectionPersister persister, object owner) ; public void Initialize(bool writing) Index: List.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/List.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** List.cs 28 Mar 2004 06:01:29 -0000 1.9 --- List.cs 9 Apr 2004 12:37:26 -0000 1.10 *************** *** 99,105 **** } ! ! public int Add(object obj) { if ( !QueueAdd(obj) ) { Write(); --- 99,113 ---- } ! public override void DelayedAddAll(ICollection coll) ! { ! foreach(object obj in coll) ! { ! list.Add(obj); ! } ! } ! ! public int Add(object obj) ! { if ( !QueueAdd(obj) ) { Write(); *************** *** 124,141 **** } ! public object this [ int arg0 ] { get { Read(); ! return list[arg0]; } set { Write(); ! list[arg0] = value; } } ! public void RemoveAt(int arg0) { Write(); ! list.RemoveAt(arg0); } --- 132,149 ---- } ! public object this [ int index ] { get { Read(); ! return list[index]; } set { Write(); ! list[index] = value; } } ! public void RemoveAt(int index) { Write(); ! list.RemoveAt(index); } |
From: Peter S. <sz...@us...> - 2004-04-09 09:22:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4472/NHibernate/Cfg Modified Files: Binder.cs Log Message: Missing index-many-to-any in BindMapSecondPass Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Binder.cs 9 Apr 2004 08:29:57 -0000 1.10 --- Binder.cs 9 Apr 2004 09:09:33 -0000 1.11 *************** *** 779,782 **** --- 779,784 ---- model.Index = component; } + else if ( "index-many-to-any".Equals(name) ) + { Any any = new Any( model.Table ); BindAny( subnode, any, model.IsOneToMany ); model.Index = any; } } if ( !model.IsInverse ) model.Index.CreateForeignKey(); |
From: Peter S. <sz...@us...> - 2004-04-09 08:43:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30369/NHibernate/Cfg Modified Files: Binder.cs Log Message: Missing many-to-any in BindCollectionSecondPass Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Binder.cs 15 Mar 2004 14:47:07 -0000 1.9 --- Binder.cs 9 Apr 2004 08:29:57 -0000 1.10 *************** *** 832,835 **** --- 832,837 ---- BindComponent(subnode, element, null, model.Role + ".element", true, mappings); } + else if ( "many-to-any".Equals(name) ) + { Any element = new Any( model.Table ); model.Element = element; BindAny(subnode, element, true); } } |
From: Michael D. <mik...@us...> - 2004-04-08 21:24:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13890/Collection Modified Files: SortedSet.cs Log Message: minor mods with SortedSet - removed a ctor and made property Comparer read only because SortedList does not have a way to change the Comparer after being initialized. Index: SortedSet.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/SortedSet.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SortedSet.cs 10 Feb 2004 18:28:50 -0000 1.2 --- SortedSet.cs 8 Apr 2004 21:11:33 -0000 1.3 *************** *** 35,39 **** public IComparer Comparer { get { return comparer;} ! set { comparer = value;} } --- 35,39 ---- public IComparer Comparer { get { return comparer;} ! //set { comparer = value;} } *************** *** 43,61 **** } ! public SortedSet(ISessionImplementor session) : base(session) { ! } ! //TODO: think about not implementing this because in .NET the comparer is a protected ! // property - not a public get/set pair like in Java... ! // Added the IComparer property because of this. ! public SortedSet(ISessionImplementor session, IDictionary map, IComparer comparer) : base(session, new SortedList(map, comparer)) { this.comparer = comparer; } ! public SortedSet(ISessionImplementor session, CollectionPersister persister, IComparer comparer, object disassembled, object owner) : this(session) { this.comparer = comparer; BeforeInitialize(persister); object[] array = (object[])disassembled; ! for(int i = 0; i < array.Length; i++) { object newObject = persister.ElementType.Assemble(array[i], session, owner); map.Add(newObject, newObject); --- 43,79 ---- } ! // changed the Comparer to a readonly property because you can't change it on SortedList after ! // it has been created - so there is no point in being able to change it on this class. ! // public SortedSet(ISessionImplementor session) : base(session) ! // { ! // } ! /// <summary> ! /// Constuct a new empty SortedSet ! /// </summary> ! /// <param name="session"></param> ! /// <param name="comparer"></param> ! public SortedSet(ISessionImplementor session, IComparer comparer) : base(session, new SortedList(comparer)) ! { this.comparer = comparer; } ! /// <summary> ! /// Construct a new SortedSet initialized with the map values. ! /// </summary> ! /// <param name="session">The Session to be bound to.</param> ! /// <param name="map">The initial values.</param> ! /// <param name="comparer">The IComparer to use for Sorting.</param> ! public SortedSet(ISessionImplementor session, IDictionary map, IComparer comparer) : base(session, new SortedList(map, comparer)) ! { this.comparer = comparer; + } + + public SortedSet(ISessionImplementor session, CollectionPersister persister, IComparer comparer, object disassembled, object owner) : this(session, comparer) + { BeforeInitialize(persister); object[] array = (object[])disassembled; ! for(int i = 0; i < array.Length; i++) ! { object newObject = persister.ElementType.Assemble(array[i], session, owner); map.Add(newObject, newObject); |
From: Michael D. <mik...@us...> - 2004-04-08 21:24:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13890/Type Modified Files: SortedSetType.cs Log Message: minor mods with SortedSet - removed a ctor and made property Comparer read only because SortedList does not have a way to change the Comparer after being initialized. Index: SortedSetType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SortedSetType.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SortedSetType.cs 10 Feb 2004 18:41:42 -0000 1.2 --- SortedSetType.cs 8 Apr 2004 21:11:33 -0000 1.3 *************** *** 18,24 **** public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! // TODO: uncomment when SortedSet is implemented ! SortedSet sortedSet = new SortedSet(session); ! sortedSet.Comparer = comparer; return sortedSet; } --- 18,23 ---- public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { ! SortedSet sortedSet = new SortedSet(session, comparer); ! //sortedSet.Comparer = comparer; return sortedSet; } |