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-29 15:16:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15158/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Added Files: FumTest.cs Log Message: Added test FumTest to NHibernate.Test and required classes to NHibernate.DomainModel --- NEW FILE: FumTest.cs --- using System; using NHibernate.DomainModel; using NUnit.Framework; namespace NHibernate.Test { /// <summary> /// Summary description for FumTest. /// </summary> [TestFixture] public class FumTest : TestCase { protected static short fumKeyShort = 1; [SetUp] public void SetUp() { ExportSchema(new string[] { "FooBar.hbm.xml", "Baz.hbm.xml", "Qux.hbm.xml", "Glarch.hbm.xml", "Fum.hbm.xml", "Fumm.hbm.xml", //"Fo.hbm.xml", //"One.hbm.xml", //"Many.hbm.xml", //"Immutable.hbm.xml", "Fee.hbm.xml" //"Vetoer.hbm.xml", //"Holder.hbm.xml", //"Location.hbm.xml", //"Stuff.hbm.xml", //"Container.hbm.xml", //"Simple.hbm.xml", //"Middle.hbm.xml" }, true); } [TearDown] public void TearDown() { DropSchema(); } static FumCompositeID FumKey(String str) { return FumKey(str,false); } static FumCompositeID FumKey(String str, bool aCompositeQueryTest) { FumCompositeID id = new FumCompositeID(); // if( dialect is Dialect.MckoiDialect ) // { // GregorianCalendar now = new GregorianCalendar(); // GregorianCalendar cal = new GregorianCalendar( // now.get(java.util.Calendar.YEAR), // now.get(java.util.Calendar.MONTH), // now.get(java.util.Calendar.DATE) // ); // id.setDate( cal.getTime() ); // } // else // { id.date = new DateTime(2004, 4, 29, 9, 0, 0, 0); // } id.@string = str; if (aCompositeQueryTest) { id.@short = fumKeyShort++ ; } else { id.@short = (short)12 ; } return id; } [Test] [Ignore("Test not yet written")] public void CompositeID() { } [Test] [Ignore("Test not yet written")] public void CompositeIDCollections() { } [Test] public void CompositeIDOneToOne() { ISession s = sessions.OpenSession(); Fum fum = new Fum( FumKey("fum") ); fum.fum = "fee fi fo"; //s.Save(fum); Fumm fumm = new Fumm(); fumm.Fum = fum; s.Save(fumm); s.Flush(); s.Close(); s = sessions.OpenSession(); fumm = (Fumm) s.Load( typeof(Fumm), FumKey("fum") ); //s.delete(fumm.Fum); s.Delete(fumm); s.Flush(); s.Close(); } [Test] [Ignore("Test not yet written")] public void CompositeIDQuery() { } [Test] [Ignore("Test not yet written")] public void CompositeIDs() { } [Test] [Ignore("Test not yet written")] public void DeleteOwner() { } [Test] [Ignore("Test not yet written")] public void KeyManyToOne() { } [Test] [Ignore("Test not yet written")] public void ListIdentifiers() { } } } Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NHibernate.Test-1.1.csproj 28 Apr 2004 14:16:17 -0000 1.17 --- NHibernate.Test-1.1.csproj 29 Apr 2004 15:16:00 -0000 1.18 *************** *** 155,158 **** --- 155,163 ---- /> <File + RelPath = "FumTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "JoinedSubclassTest.cs" SubType = "Code" |
From: Peter S. <sz...@us...> - 2004-04-29 14:43:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7736/NHibernate/Mapping Modified Files: RootClass.cs Log Message: Sweeping around, fixing small bugs Index: RootClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/RootClass.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RootClass.cs 13 Apr 2004 17:58:11 -0000 1.7 --- RootClass.cs 29 Apr 2004 14:43:21 -0000 1.8 *************** *** 25,28 **** --- 25,30 ---- private string where; + public bool Polymorphic; + public override Property IdentifierProperty { |
From: Peter S. <sz...@us...> - 2004-04-29 14:43:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7736/NHibernate/Cfg Modified Files: Binder.cs Log Message: Sweeping around, fixing small bugs Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Binder.cs 29 Apr 2004 14:00:52 -0000 1.17 --- Binder.cs 29 Apr 2004 14:43:14 -0000 1.18 *************** *** 18,30 **** internal static Dialect.Dialect dialect; ! public static void BindClass(XmlNode node, PersistentClass model, Mappings mapping) { string className = node.Attributes["name"] == null ? null : node.Attributes["name"].Value; // class ! try { model.PersistentClazz = ReflectHelper.ClassForName(className); } ! catch ( Exception cnfe ) { throw new MappingException( "persistent class not found", cnfe); } --- 18,33 ---- internal static Dialect.Dialect dialect; ! public static void BindClass(XmlNode node, PersistentClass model, Mappings mapping) ! { string className = node.Attributes["name"] == null ? null : node.Attributes["name"].Value; // class ! try ! { model.PersistentClazz = ReflectHelper.ClassForName(className); } ! catch ( Exception cnfe ) ! { throw new MappingException( "persistent class not found", cnfe); } *************** *** 32,40 **** //proxy interface XmlAttribute proxyNode = node.Attributes["proxy"]; ! if (proxyNode!=null) { ! try { model.ProxyInterface = ReflectHelper.ClassForName( proxyNode.Value ); } ! catch (Exception cnfe) { throw new MappingException(cnfe); } --- 35,46 ---- //proxy interface XmlAttribute proxyNode = node.Attributes["proxy"]; ! if (proxyNode!=null) ! { ! try ! { model.ProxyInterface = ReflectHelper.ClassForName( proxyNode.Value ); } ! catch (Exception cnfe) ! { throw new MappingException(cnfe); } *************** *** 53,67 **** "true".Equals( dynamicNode.Value ); //import ! if (mapping.IsAutoImport) { mapping.AddImport( StringHelper.GetFullClassname(className), StringHelper.GetClassname(className) ); } } ! public static void BindSubclass(XmlNode node, Subclass model, Mappings mappings) { BindClass(node, model, mappings); ! if ( model.Persister==null ) { model.RootClazz.Persister = typeof(EntityPersister); } --- 59,82 ---- "true".Equals( dynamicNode.Value ); + //dynamic insert + XmlAttribute insertNode = node.Attributes["dynamic-insert"]; + model.DynamicInsert = (insertNode==null) ? + false : + "true".Equals( insertNode.Value ); + //import ! if (mapping.IsAutoImport) ! { mapping.AddImport( StringHelper.GetFullClassname(className), StringHelper.GetClassname(className) ); } } ! public static void BindSubclass(XmlNode node, Subclass model, Mappings mappings) ! { BindClass(node, model, mappings); ! if ( model.Persister==null ) ! { model.RootClazz.Persister = typeof(EntityPersister); } *************** *** 75,84 **** } ! public static void BindJoinedSubclass(XmlNode node, Subclass model, Mappings mappings) { BindClass(node, model, mappings); // joined subclass ! if ( model.Persister==null ) { model.RootClazz.Persister = typeof(NormalizedEntityPersister); } --- 90,101 ---- } ! public static void BindJoinedSubclass(XmlNode node, Subclass model, Mappings mappings) ! { BindClass(node, model, mappings); // joined subclass ! if ( model.Persister==null ) ! { model.RootClazz.Persister = typeof(NormalizedEntityPersister); } *************** *** 87,91 **** XmlAttribute tableNameNode = node.Attributes["table"]; string tableName = (tableNameNode==null) ! ? model.PersistentClazz.Name : tableNameNode.Value; --- 104,108 ---- XmlAttribute tableNameNode = node.Attributes["table"]; string tableName = (tableNameNode==null) ! ? StringHelper.Unqualify( model.PersistentClazz.Name ) : tableNameNode.Value; *************** *** 108,115 **** fk.ReferencedClass = model.Superclass.PersistentClazz; PropertiesFromXML(node, model, mappings); } ! public static void BindRootClass(XmlNode node, RootClass model, Mappings mappings) { BindClass(node, model, mappings); --- 125,134 ---- fk.ReferencedClass = model.Superclass.PersistentClazz; + // properties PropertiesFromXML(node, model, mappings); } ! public static void BindRootClass(XmlNode node, RootClass model, Mappings mappings) ! { BindClass(node, model, mappings); *************** *** 118,122 **** XmlAttribute tableNameNode = node.Attributes["table"]; string tableName = (tableNameNode==null) ! ? model.PersistentClazz.Name : tableNameNode.Value; --- 137,141 ---- XmlAttribute tableNameNode = node.Attributes["table"]; string tableName = (tableNameNode==null) ! ? StringHelper.Unqualify( model.PersistentClazz.Name ) : tableNameNode.Value; *************** *** 130,141 **** //persister XmlAttribute persisterNode = node.Attributes["persister"]; ! if ( persisterNode==null ) { //persister = typeof(EntityPersister); } ! else { ! try { model.Persister = ReflectHelper.ClassForName( persisterNode.Value ); } ! catch (Exception) { throw new MappingException("could not find persister class: " + persisterNode.Value ); } --- 149,164 ---- //persister XmlAttribute persisterNode = node.Attributes["persister"]; ! if ( persisterNode==null ) ! { //persister = typeof(EntityPersister); } ! else ! { ! try ! { model.Persister = ReflectHelper.ClassForName( persisterNode.Value ); } ! catch (Exception) ! { throw new MappingException("could not find persister class: " + persisterNode.Value ); } *************** *** 146,154 **** model.IsMutable = (mutableNode==null) || mutableNode.Value.Equals("true"); //POLYMORPHISM XmlAttribute polyNode = node.Attributes["polymorphism"]; model.IsExplicitPolymorphism = (polyNode!=null) && polyNode.Value.Equals("explicit"); ! foreach(XmlNode subnode in node.ChildNodes) { string name = subnode.LocalName; //Name; string propertyName = GetPropertyName(subnode); --- 169,182 ---- model.IsMutable = (mutableNode==null) || mutableNode.Value.Equals("true"); + //WHERE + XmlAttribute whereNode = node.Attributes["where"]; + if (whereNode!=null) model.Where = whereNode.Value; + //POLYMORPHISM XmlAttribute polyNode = node.Attributes["polymorphism"]; model.IsExplicitPolymorphism = (polyNode!=null) && polyNode.Value.Equals("explicit"); ! foreach(XmlNode subnode in node.ChildNodes) ! { string name = subnode.LocalName; //Name; string propertyName = GetPropertyName(subnode); *************** *** 157,171 **** if(subnode.NamespaceURI!=Configuration.MappingSchemaXMLNS) continue; ! switch( name ) { case "id": Value id = new Value(table); model.Identifier = id; ! if ( propertyName==null) { BindValue(subnode, id, false, RootClass.DefaultIdentifierColumnName); if ( id.Type==null ) throw new MappingException("must specify an identifier type: " + model.PersistentClazz.Name ); model.IdentifierProperty = null; } ! else { BindValue(subnode, id, false, propertyName); id.SetTypeByReflection( model.PersistentClazz, propertyName); --- 185,202 ---- if(subnode.NamespaceURI!=Configuration.MappingSchemaXMLNS) continue; ! switch( name ) ! { case "id": Value id = new Value(table); model.Identifier = id; ! if ( propertyName==null) ! { BindValue(subnode, id, false, RootClass.DefaultIdentifierColumnName); if ( id.Type==null ) throw new MappingException("must specify an identifier type: " + model.PersistentClazz.Name ); model.IdentifierProperty = null; } ! else ! { BindValue(subnode, id, false, propertyName); id.SetTypeByReflection( model.PersistentClazz, propertyName); *************** *** 184,192 **** Component compId = new Component(model); model.Identifier = compId; ! if (propertyName==null) { BindComponent(subnode, compId, null, model.Name + ".id", false, mappings); model.HasEmbeddedIdentifier = compId.IsEmbedded; model.IdentifierProperty = null; ! } else { System.Type reflectedClass = ReflectHelper.GetGetter( model.PersistentClazz, propertyName ).ReturnType; BindComponent(subnode, compId, reflectedClass, model.Name + StringHelper.Dot + propertyName, false, mappings); --- 215,226 ---- Component compId = new Component(model); model.Identifier = compId; ! if (propertyName==null) ! { BindComponent(subnode, compId, null, model.Name + ".id", false, mappings); model.HasEmbeddedIdentifier = compId.IsEmbedded; model.IdentifierProperty = null; ! } ! else ! { System.Type reflectedClass = ReflectHelper.GetGetter( model.PersistentClazz, propertyName ).ReturnType; BindComponent(subnode, compId, reflectedClass, model.Name + StringHelper.Dot + propertyName, false, mappings); *************** *** 197,200 **** --- 231,235 ---- MakeIdentifier(subnode, compId, mappings); break; + case "version": case "timestamp": *************** *** 208,222 **** model.AddProperty(timestampProp); break; case "discriminator": Value discrim = new Value(table); model.Discriminator = discrim; BindValue(subnode, discrim, false, RootClass.DefaultDiscriminatorColumnName); ! if ( discrim.Type==null ) { discrim.Type = NHibernate.String; ! foreach(Column col in discrim.ColumnCollection) { col.Type = NHibernate.String; } } ! if ( subnode.Attributes["force"] != null && "true".Equals( subnode.Attributes["force"].Value ) ) { model.IsForceDiscriminator = true; } --- 243,262 ---- model.AddProperty(timestampProp); break; + case "discriminator": Value discrim = new Value(table); model.Discriminator = discrim; BindValue(subnode, discrim, false, RootClass.DefaultDiscriminatorColumnName); ! if ( discrim.Type==null ) ! { discrim.Type = NHibernate.String; ! foreach(Column col in discrim.ColumnCollection) ! { col.Type = NHibernate.String; } } ! model.Polymorphic = true; ! if ( subnode.Attributes["force"] != null && "true".Equals( subnode.Attributes["force"].Value ) ) ! { model.IsForceDiscriminator = true; } *************** *** 230,240 **** } ! public static void BindColumns(XmlNode node, Value model, bool isNullable, bool autoColumn, string defaultColumnName) { //COLUMN(S) XmlAttribute columnNode = node.Attributes["column"]; ! if ( columnNode==null ) { int count=0; ! //foreach(XmlNode subnode in node.SelectNodes("column")) { ! foreach(XmlNode subnode in node.SelectNodes(nsPrefix + ":column", nsmgr)) { Table table = model.Table; Column col = new Column( model.Type, count++ ); --- 270,282 ---- } ! public static void BindColumns(XmlNode node, Value model, bool isNullable, bool autoColumn, string defaultColumnName) ! { //COLUMN(S) XmlAttribute columnNode = node.Attributes["column"]; ! if ( columnNode==null ) ! { int count=0; ! foreach(XmlNode subnode in node.SelectNodes(nsPrefix + ":column", nsmgr)) ! { Table table = model.Table; Column col = new Column( model.Type, count++ ); *************** *** 245,267 **** //column index XmlAttribute indexNode = subnode.Attributes["index"]; ! if ( indexNode!=null && table!=null ) { table.GetIndex( indexNode.Value ).AddColumn(col); } XmlAttribute uniqueNode = subnode.Attributes["unique-key"]; ! if ( uniqueNode!=null && table!=null ) { table.GetUniqueKey( uniqueNode.Value ).AddColumn(col); } } } ! else { Column col = new Column( model.Type, 0 ); BindColumn(node, col, isNullable); col.Name = columnNode.Value; Table table = model.Table; ! if (table!=null) table.AddColumn(col); model.AddColumn(col); } ! if ( autoColumn && model.ColumnSpan==0 ) { Column col = new Column( model.Type, 0 ); BindColumn(node, col, isNullable); --- 287,315 ---- //column index XmlAttribute indexNode = subnode.Attributes["index"]; ! if ( indexNode!=null && table!=null ) ! { ! //TODO: what do you do about associations?? (second pass compile) table.GetIndex( indexNode.Value ).AddColumn(col); } XmlAttribute uniqueNode = subnode.Attributes["unique-key"]; ! if ( uniqueNode!=null && table!=null ) ! { ! //TODO: what do you do about associations?? (second pass compile) table.GetUniqueKey( uniqueNode.Value ).AddColumn(col); } } } ! else ! { Column col = new Column( model.Type, 0 ); BindColumn(node, col, isNullable); col.Name = columnNode.Value; Table table = model.Table; ! if (table!=null) table.AddColumn(col); //table=null -> an association - fill it in later model.AddColumn(col); } ! if ( autoColumn && model.ColumnSpan==0 ) ! { Column col = new Column( model.Type, 0 ); BindColumn(node, col, isNullable); *************** *** 272,276 **** } ! public static void BindValue(XmlNode node, Value model, bool isNullable) { //TYPE model.Type = GetTypeFromXML(node); --- 320,328 ---- } ! /// <remarks> ! /// Does _not_ automatically make a column if none is specifed by XML ! /// </remarks> ! public static void BindValue(XmlNode node, Value model, bool isNullable) ! { //TYPE model.Type = GetTypeFromXML(node); *************** *** 278,284 **** } ! public static void BindValue(XmlNode node, Value model, bool isNullable, string defaultColumnName) { model.Type = GetTypeFromXML(node); ! BindColumns(node, model, isNullable, true, defaultColumnName); } --- 330,350 ---- } ! /// <remarks> ! /// automatically makes a column with the default name if none is specifed by XML ! /// </remarks> ! public static void BindValue(XmlNode node, Value model, bool isNullable, string defaultColumnName) ! { model.Type = GetTypeFromXML(node); ! XmlAttribute formulaNode = node.Attributes["formula"]; ! if (formulaNode != null) ! { ! Formula f = new Formula(); ! f.FormulaString = formulaNode.InnerText; ! model.Formula = f; ! } ! else ! { ! BindColumns(node, model, isNullable, true, defaultColumnName); ! } } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Hql Modified Files: PathExpressionParser.cs QueryTranslator.cs Log Message: Some small H2.0.3 compatibility fix Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** QueryTranslator.cs 19 Apr 2004 04:32:30 -0000 1.25 --- QueryTranslator.cs 29 Apr 2004 14:00:52 -0000 1.26 *************** *** 678,682 **** for (int k=0; k<size; k++) { ! scalarTypes.Add(NHibernate.Association(persisters[k].MappedClass)); string[] names = persisters[k].IdentifierColumnNames; --- 678,682 ---- for (int k=0; k<size; k++) { ! scalarTypes.Add(NHibernate.Entity(persisters[k].MappedClass)); string[] names = persisters[k].IdentifierColumnNames; Index: PathExpressionParser.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/PathExpressionParser.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PathExpressionParser.cs 14 Apr 2004 12:34:00 -0000 1.11 --- PathExpressionParser.cs 29 Apr 2004 14:00:52 -0000 1.12 *************** *** 256,260 **** { IClassPersister p = q.GetPersisterForName(currentName); ! type = NHibernate.Association(p.MappedClass); } else --- 256,260 ---- { IClassPersister p = q.GetPersisterForName(currentName); ! type = NHibernate.Entity(p.MappedClass); } else |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate Modified Files: FlushMode.cs HibernateException.cs NHibernate.cs Log Message: Some small H2.0.3 compatibility fix Index: FlushMode.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/FlushMode.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FlushMode.cs 17 Feb 2003 18:16:13 -0000 1.1 --- FlushMode.cs 29 Apr 2004 14:00:51 -0000 1.2 *************** *** 16,29 **** /// transactions /// </summary> ! Never, /// <summary> /// The <c>ISession</c> is flushed when <c>Transaction.Commit()</c> is called /// </summary> ! Commit, /// <summary> /// The <c>ISession</c> is sometimes flushed before query execution in order to /// ensure that queries never return stale state. This is the default flush mode. /// </summary> ! Auto } } --- 16,29 ---- /// transactions /// </summary> ! Never = 0, /// <summary> /// The <c>ISession</c> is flushed when <c>Transaction.Commit()</c> is called /// </summary> ! Commit = 5, /// <summary> /// The <c>ISession</c> is sometimes flushed before query execution in order to /// ensure that queries never return stale state. This is the default flush mode. /// </summary> ! Auto = 10 } } Index: NHibernate.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NHibernate.cs 21 Apr 2004 14:31:09 -0000 1.16 --- NHibernate.cs 29 Apr 2004 14:00:51 -0000 1.17 *************** *** 1,3 **** --- 1,4 ---- using System; + using System.IO; using NHibernate.SqlTypes; *************** *** 170,174 **** /// A NHibernate serializable type /// </summary> ! /// <param name="serializableClass"></param> /// <returns></returns> public static IType Any(IType metaType, IType identifierType) { --- 171,176 ---- /// A NHibernate serializable type /// </summary> ! /// <param name="metaType">a type mapping <see cref="NHibernate.Type.IType"/> to a single column</param> ! /// <param name="identifierType">the entity identifier type</param> /// <returns></returns> public static IType Any(IType metaType, IType identifierType) { *************** *** 181,184 **** --- 183,187 ---- /// <param name="persistentClass">a mapped entity class</param> /// <returns></returns> + [Obsolete("use NHibernate.Entity instead")] public static IType Association(System.Type persistentClass) { // not really a many-to-one association *necessarily* *************** *** 187,190 **** --- 190,204 ---- /// <summary> + /// A NHibernate persistent object (entity) type + /// </summary> + /// <param name="persistentClass">a mapped entity class</param> + /// <returns></returns> + public static IType Entity(System.Type persistentClass) + { + // not really a many-to-one association *necessarily* + return new ManyToOneType(persistentClass); + } + + /// <summary> /// A NHibernate custom type /// </summary> *************** *** 192,199 **** /// <returns></returns> public static IType Custom(System.Type userTypeClass) { ! if( typeof(ICompositeUserType).IsAssignableFrom( userTypeClass )) { return new CompositeCustomType( userTypeClass ); } ! else { return new CustomType(userTypeClass); } --- 206,215 ---- /// <returns></returns> public static IType Custom(System.Type userTypeClass) { ! if( typeof(ICompositeUserType).IsAssignableFrom( userTypeClass )) ! { return new CompositeCustomType( userTypeClass ); } ! else ! { return new CustomType(userTypeClass); } *************** *** 207,217 **** /// <exception cref="HibernateException">if we can't initialize the proxy at this time, eg. the Session was closed</exception> public static void Initialize(object proxy) { ! if (proxy==null) { return; } ! else if ( proxy is HibernateProxy ) { ! ((HibernateProxy) proxy).Initialize(); } ! else if ( proxy is PersistentCollection ) { ( (PersistentCollection) proxy ).ForceLoad(); } --- 223,236 ---- /// <exception cref="HibernateException">if we can't initialize the proxy at this time, eg. the Session was closed</exception> public static void Initialize(object proxy) { ! if (proxy==null) ! { return; } ! else if ( proxy is HibernateProxy ) ! { ! HibernateProxyHelper.GetLazyInitializer( (HibernateProxy) proxy ).Initialize(); } ! else if ( proxy is PersistentCollection ) ! { ( (PersistentCollection) proxy ).ForceLoad(); } *************** *** 223,241 **** /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <returns>true if the argument is already initialized, or is not a proxy or collection</returns> ! public static bool IsInitialized(object proxy) { ! if ( proxy is HibernateProxy ) { return !HibernateProxyHelper.GetLazyInitializer( (HibernateProxy) proxy ).IsUninitialized; ! } else if ( proxy is PersistentCollection ) { return ( (PersistentCollection) proxy).WasInitialized; ! } else { return true; } } ! public System.Type GetClass(object proxy) { ! if(proxy is HibernateProxy) { return HibernateProxyHelper.GetLazyInitializer( (HibernateProxy) proxy ).GetImplementation().GetType(); } ! else { return proxy.GetType(); } --- 242,275 ---- /// <param name="proxy">a persistable object, proxy, persistent collection or null</param> /// <returns>true if the argument is already initialized, or is not a proxy or collection</returns> ! public static bool IsInitialized(object proxy) ! { ! if ( proxy is HibernateProxy ) ! { return !HibernateProxyHelper.GetLazyInitializer( (HibernateProxy) proxy ).IsUninitialized; ! } ! else if ( proxy is PersistentCollection ) ! { return ( (PersistentCollection) proxy).WasInitialized; ! } ! else ! { return true; } } ! /// <summary> ! /// Get the true, underlying class of a proxied persistent class. This operation ! /// will initialize a proxy by side-effect. ! /// </summary> ! /// <param name="proxy">a persistable object or proxy</param> ! /// <returns>the true class of the instance</returns> ! public System.Type GetClass(object proxy) ! { ! if(proxy is HibernateProxy) ! { return HibernateProxyHelper.GetLazyInitializer( (HibernateProxy) proxy ).GetImplementation().GetType(); } ! else ! { return proxy.GetType(); } *************** *** 258,262 **** /// <param name="length">the number of bytes in the stream</param> /// <returns></returns> ! public static Blob CreateBlob(StreamReader stream, int length) { return new BlobImpl(stream, length); } --- 292,296 ---- /// <param name="length">the number of bytes in the stream</param> /// <returns></returns> ! public static Blob CreateBlob(TextReader stream, int length) { return new BlobImpl(stream, length); } *************** *** 266,275 **** /// </summary> /// <param name="stream">a binary stream</param> /// <returns></returns> ! public static Blob CreateBlob(StreamReader stream) { return new BlobImpl( stream, stream.available() ); } /// <summary> /// Create a new Clob. The returned object will be /// initially immutable. --- 300,331 ---- /// </summary> /// <param name="stream">a binary stream</param> + /// <param name="length">the number of bytes in the stream</param> /// <returns></returns> ! public static Blob CreateBlob(BinaryReader stream, int length) ! { ! return new BlobImpl(stream, length); ! } ! ! /// <summary> ! /// Create a new Blob. The returned object will be initially immutable. ! /// </summary> ! /// <param name="stream">a binary stream</param> ! /// <returns></returns> ! public static Blob CreateBlob(StreamReader stream) ! { return new BlobImpl( stream, stream.available() ); } /// <summary> + /// Create a new Blob. The returned object will be initially immutable. + /// </summary> + /// <param name="stream">a binary stream</param> + /// <returns></returns> + public static Blob CreateBlob(BinaryReader stream) + { + return new BlobImpl( stream, stream.available() ); + } + + /// <summary> /// Create a new Clob. The returned object will be /// initially immutable. *************** *** 277,281 **** /// <param name="str">a String</param> /// <returns></returns> ! public static Clob CreateClob(String str) { return new ClobImpl(str); } --- 333,338 ---- /// <param name="str">a String</param> /// <returns></returns> ! public static Clob CreateClob(string str) ! { return new ClobImpl(str); } *************** *** 287,291 **** /// <param name="length">the number of characters in the stream</param> /// <returns></returns> ! public static Clob CreateClob(StreamReader reader, int length) { return new ClobImpl(reader, length); } --- 344,348 ---- /// <param name="length">the number of characters in the stream</param> /// <returns></returns> ! public static Clob CreateClob(TextReader reader, int length) { return new ClobImpl(reader, length); } Index: HibernateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/HibernateException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HibernateException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- HibernateException.cs 29 Apr 2004 14:00:51 -0000 1.2 *************** *** 9,13 **** public class HibernateException : ApplicationException { ! public HibernateException(Exception e) : base("", e) { } public HibernateException(string str, Exception e) : base(str, e) { } --- 9,13 ---- public class HibernateException : ApplicationException { ! public HibernateException(Exception e) : base(string.Empty, e) { } public HibernateException(string str, Exception e) : base(str, e) { } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Driver Modified Files: OdbcDriver.cs OleDbDriver.cs Log Message: Some small H2.0.3 compatibility fix Index: OleDbDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OleDbDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OleDbDriver.cs 10 Mar 2004 15:36:46 -0000 1.1 --- OleDbDriver.cs 29 Apr 2004 14:00:52 -0000 1.2 *************** *** 38,42 **** public override string NamedPrefix { ! get {return "";} } --- 38,42 ---- public override string NamedPrefix { ! get {return string.Empty;} } Index: OdbcDriver.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/OdbcDriver.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OdbcDriver.cs 10 Mar 2004 15:36:46 -0000 1.1 --- OdbcDriver.cs 29 Apr 2004 14:00:52 -0000 1.2 *************** *** 38,42 **** public override string NamedPrefix { ! get {return "";} } } --- 38,42 ---- public override string NamedPrefix { ! get {return string.Empty;} } } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Cfg Modified Files: Binder.cs Log Message: Some small H2.0.3 compatibility fix Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Binder.cs 15 Apr 2004 21:07:17 -0000 1.16 --- Binder.cs 29 Apr 2004 14:00:52 -0000 1.17 *************** *** 240,244 **** Column col = new Column( model.Type, count++ ); BindColumn(subnode, col, isNullable); ! col.Name = (subnode.Attributes["name"]==null) ? "" : subnode.Attributes["name"].Value; if (table!=null) table.AddColumn(col); //table=null -> an association, fill it in later model.AddColumn(col); --- 240,244 ---- Column col = new Column( model.Type, count++ ); BindColumn(subnode, col, isNullable); ! col.Name = (subnode.Attributes["name"]==null) ? string.Empty : subnode.Attributes["name"].Value; if (table!=null) table.AddColumn(col); //table=null -> an association, fill it in later model.AddColumn(col); *************** *** 440,444 **** try { ! model.Type = (EntityType) NHibernate.Association( ReflectHelper.ClassForName( node.Attributes["class"].Value) ); } --- 440,444 ---- try { ! model.Type = (EntityType) NHibernate.Entity( ReflectHelper.ClassForName( node.Attributes["class"].Value) ); } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:32
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Cache Modified Files: CachedItem.cs Timestamper.cs Log Message: Some small H2.0.3 compatibility fix Index: CachedItem.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CachedItem.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CachedItem.cs 17 Feb 2003 18:16:13 -0000 1.1 --- CachedItem.cs 29 Apr 2004 14:00:51 -0000 1.2 *************** *** 1,5 **** using System; ! namespace NHibernate.Cache { /// <summary> --- 1,6 ---- using System; ! namespace NHibernate.Cache ! { /// <summary> *************** *** 8,12 **** /// </summary> [Serializable] ! public class CachedItem { private long freshTimestamp; private bool fresh; --- 9,14 ---- /// </summary> [Serializable] ! public class CachedItem ! { private long freshTimestamp; private bool fresh; *************** *** 15,19 **** private object value; ! public CachedItem(object value) { this.value = value; freshTimestamp = Timestamper.Next(); --- 17,22 ---- private object value; ! public CachedItem(object value) ! { this.value = value; freshTimestamp = Timestamper.Next(); *************** *** 22,53 **** } ! public long FreshTimestamp { get { return freshTimestamp; } } ! public long UnlockTimestamp { get { return unlockTimestamp; } } ! public object Value { get { return value; } } ! public bool IsFresh { get { return fresh; } } ! public void Lock() { ! if ( 0 == theLock++ ) { fresh = false; value = null; } } ! public void Unlock() { ! if ( --theLock == 0 ) { unlockTimestamp = Timestamper.Next(); } } ! public bool IsUnlocked { get { return theLock == 0; } } --- 25,65 ---- } ! public long FreshTimestamp ! { get { return freshTimestamp; } } ! public long UnlockTimestamp ! { get { return unlockTimestamp; } } ! public object Value ! { get { return value; } } ! public bool IsFresh ! { get { return fresh; } } ! public void Lock() ! { ! if ( 0 == theLock++ ) ! { fresh = false; value = null; } } ! public void Unlock() ! { ! if ( --theLock == 0 ) ! { unlockTimestamp = Timestamper.Next(); } } ! public bool IsUnlocked ! { get { return theLock == 0; } } Index: Timestamper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/Timestamper.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Timestamper.cs 23 Apr 2003 14:42:52 -0000 1.4 --- Timestamper.cs 29 Apr 2004 14:00:51 -0000 1.5 *************** *** 2,6 **** using System.Runtime.CompilerServices; ! namespace NHibernate.Cache { /// <summary> /// Geterates increasing identifiers. --- 2,7 ---- using System.Runtime.CompilerServices; ! namespace NHibernate.Cache ! { /// <summary> /// Geterates increasing identifiers. *************** *** 10,14 **** /// strickly increasing, but usually are. /// </remarks> ! public class Timestamper { private static short counter = 0; private static long time; --- 11,16 ---- /// strickly increasing, but usually are. /// </remarks> ! public class Timestamper ! { private static short counter = 0; private static long time; *************** *** 17,30 **** [MethodImpl(MethodImplOptions.Synchronized)] ! public static long Next() { long newTime = System.DateTime.Now.Ticks << BinDigits; //is this right? ! if (time < newTime) { time = newTime; counter = 0; ! } else if (counter < OneMs - 1) { counter++; } return time + counter; } } } --- 19,40 ---- [MethodImpl(MethodImplOptions.Synchronized)] ! public static long Next() ! { long newTime = System.DateTime.Now.Ticks << BinDigits; //is this right? ! if (time < newTime) ! { time = newTime; counter = 0; ! } ! else if (counter < OneMs - 1) ! { counter++; } return time + counter; } + + private Timestamper() + { + } } } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Some small H2.0.3 compatibility fix Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FooBarTest.cs 28 Apr 2004 14:17:54 -0000 1.15 --- FooBarTest.cs 29 Apr 2004 14:00:55 -0000 1.16 *************** *** 67,71 **** [Test] ! [Ignore("HQL is broke")] public void Sortables() { --- 67,71 ---- [Test] ! //[Ignore("HQL is broke")] public void Sortables() { |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Type Modified Files: ObjectType.cs TypeFactory.cs Log Message: Some small H2.0.3 compatibility fix Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TypeFactory.cs 27 Apr 2004 15:49:22 -0000 1.28 --- TypeFactory.cs 29 Apr 2004 14:00:54 -0000 1.29 *************** *** 363,367 **** else if ( typeof(ILifecycle).IsAssignableFrom(typeClass) ) { ! type = NHibernate.Association(typeClass); } else if ( typeClass.IsEnum ) --- 363,367 ---- else if ( typeof(ILifecycle).IsAssignableFrom(typeClass) ) { ! type = NHibernate.Entity(typeClass); } else if ( typeClass.IsEnum ) Index: ObjectType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/ObjectType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectType.cs 10 Feb 2004 18:41:42 -0000 1.4 --- ObjectType.cs 29 Apr 2004 14:00:54 -0000 1.5 *************** *** 127,131 **** public override string ToXML(object value, ISessionFactoryImplementor factory) { ! return NHibernate.Association( value.GetType() ).ToXML(value, factory); } --- 127,131 ---- public override string ToXML(object value, ISessionFactoryImplementor factory) { ! return NHibernate.Entity( value.GetType() ).ToXML(value, factory); } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/SqlCommand Modified Files: ForUpdateFragment.cs Template.cs Log Message: Some small H2.0.3 compatibility fix Index: Template.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/Template.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Template.cs 28 Apr 2004 14:20:03 -0000 1.5 --- Template.cs 29 Apr 2004 14:00:53 -0000 1.6 *************** *** 17,21 **** private static StringDictionary Keywords = new StringDictionary(); - private static readonly string empty = ""; public static readonly string PlaceHolder = "$PlaceHolder"; private static ArrayList delimiterList = new ArrayList(13); --- 17,20 ---- *************** *** 24,42 **** static Template() { ! Keywords["and"] = empty; ! Keywords["or"] = empty; ! Keywords["not"] = empty; ! Keywords["like"] = empty; ! Keywords["is"] = empty; ! Keywords["in"] = empty; ! Keywords["between"] = empty; ! Keywords["null"] = empty; ! Keywords["select"] = empty; ! Keywords["from"] = empty; ! Keywords["where"] = empty; ! Keywords["having"] = empty; ! Keywords["group"] = empty; ! Keywords["order"] = empty; ! Keywords["by"] = empty; delimiterList.Add(" "); --- 23,41 ---- static Template() { ! Keywords["and"] = string.Empty; ! Keywords["or"] = string.Empty; ! Keywords["not"] = string.Empty; ! Keywords["like"] = string.Empty; ! Keywords["is"] = string.Empty; ! Keywords["in"] = string.Empty; ! Keywords["between"] = string.Empty; ! Keywords["null"] = string.Empty; ! Keywords["select"] = string.Empty; ! Keywords["from"] = string.Empty; ! Keywords["where"] = string.Empty; ! Keywords["having"] = string.Empty; ! Keywords["group"] = string.Empty; ! Keywords["order"] = string.Empty; ! Keywords["by"] = string.Empty; delimiterList.Add(" "); *************** *** 71,75 **** public static void AddKeyword(string keyword) { ! Keywords[keyword] = empty; } --- 70,74 ---- public static void AddKeyword(string keyword) { ! Keywords[keyword] = string.Empty; } Index: ForUpdateFragment.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/ForUpdateFragment.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ForUpdateFragment.cs 18 Mar 2004 18:34:47 -0000 1.2 --- ForUpdateFragment.cs 29 Apr 2004 14:00:53 -0000 1.3 *************** *** 38,43 **** { return aliases.Length==0 ? ! new SqlString("") : ! new SqlString(" for update of " + aliases + ( nowait ? " nowait" : "")); } --- 38,43 ---- { return aliases.Length==0 ? ! new SqlString(string.Empty) : ! new SqlString(" for update of " + aliases + ( nowait ? " nowait" : string.Empty)); } |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Tool/hbm2net Modified Files: ClassMapping.cs Log Message: Some small H2.0.3 compatibility fix Index: ClassMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net/ClassMapping.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ClassMapping.cs 8 Apr 2004 15:51:57 -0000 1.11 --- ClassMapping.cs 29 Apr 2004 14:00:53 -0000 1.12 *************** *** 736,741 **** if ("map".Equals(xmlName)) { ! interfaceClass = typeof(System.Collections.SortedList).FullName; ! implementingClass = typeof(System.Collections.SortedList).FullName; } else if ("set".Equals(xmlName)) --- 736,741 ---- if ("map".Equals(xmlName)) { ! interfaceClass = typeof(System.Collections.IDictionary).FullName; ! implementingClass = typeof(System.Collections.IDictionary).FullName; } else if ("set".Equals(xmlName)) |
From: Peter S. <sz...@us...> - 2004-04-29 14:01:02
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32453/NHibernate/Impl Modified Files: QueryImpl.cs Log Message: Some small H2.0.3 compatibility fix Index: QueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/QueryImpl.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** QueryImpl.cs 20 Apr 2004 17:39:44 -0000 1.8 --- QueryImpl.cs 29 Apr 2004 14:00:52 -0000 1.9 *************** *** 146,150 **** } public IQuery SetEntity(int position, object val) { ! SetParameter(position, val, NHibernate.Association( HibernateProxyHelper.GetClass(val))); return this; } --- 146,150 ---- } public IQuery SetEntity(int position, object val) { ! SetParameter(position, val, NHibernate.Entity( HibernateProxyHelper.GetClass(val))); return this; } *************** *** 213,217 **** } public IQuery SetEntity(string name, object val) { ! SetParameter(name, val, NHibernate.Association( HibernateProxyHelper.GetClass( val ) ) ); return this; } --- 213,217 ---- } public IQuery SetEntity(string name, object val) { ! SetParameter(name, val, NHibernate.Entity( HibernateProxyHelper.GetClass( val ) ) ); return this; } *************** *** 251,255 **** } } ! return NHibernate.Association(clazz); } else { --- 251,255 ---- } } ! return NHibernate.Entity(clazz); } else { |
From: Peter S. <sz...@us...> - 2004-04-29 11:24:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2476/NHibernate/Collection Modified Files: CollectionPersister.cs Log Message: Added alias creation to constructor Index: CollectionPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/CollectionPersister.cs,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CollectionPersister.cs 19 Apr 2004 20:04:08 -0000 1.19 --- CollectionPersister.cs 29 Apr 2004 11:24:08 -0000 1.20 *************** *** 45,48 **** --- 45,49 ---- private IType elementType; private string[] keyColumnNames; + private string[] keyColumnAliases; private string[] indexColumnNames; private string[] unquotedIndexColumnNames; *************** *** 78,81 **** --- 79,83 ---- role = collection.Role; ownerClass = collection.OwnerClass; + Alias alias = new Alias("__"); sqlOrderByString = collection.OrderBy; *************** *** 87,90 **** --- 89,94 ---- sqlWhereStringTemplate = hasWhere ? Template.RenderWhereStringTemplate(sqlWhereString, dialect) : null; + //hasOrphanDelete = collection.hasOrphanDelete(); + cache = collection.Cache; *************** *** 92,100 **** --- 96,107 ---- int span = collection.Key.ColumnSpan; keyColumnNames = new string[span]; + string[] keyAliases = new string[span]; int k=0; foreach(Column col in collection.Key.ColumnCollection) { keyColumnNames[k] = col.GetQuotedName(dialect); + keyAliases[k] = col.Alias(dialect); k++; } + keyColumnAliases = alias.ToAliasStrings(keyAliases, dialect); isSet = collection.IsSet; *************** *** 355,359 **** public object ReadKey(IDataReader dr, ISessionImplementor session) { //TODO: h2.0.3 = use keyColumnAliases instead of keyColumnNames ! return KeyType.NullSafeGet(dr, keyColumnNames, session, null); } --- 362,366 ---- public object ReadKey(IDataReader dr, ISessionImplementor session) { //TODO: h2.0.3 = use keyColumnAliases instead of keyColumnNames ! return KeyType.NullSafeGet(dr, keyColumnAliases, session, null); } |
From: Michael D. <mik...@us...> - 2004-04-28 14:20:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21127/NHibernate/SqlCommand Modified Files: Template.cs Log Message: Removed code that was commented out instead of deleted originally. Index: Template.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/Template.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Template.cs 26 Apr 2004 03:46:45 -0000 1.4 --- Template.cs 28 Apr 2004 14:20:03 -0000 1.5 *************** *** 201,205 **** { return column; - //return dialect.QuoteForAliasName(column); } } --- 201,204 ---- |
From: Michael D. <mik...@us...> - 2004-04-28 14:18:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20703/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Fixed part of the Sortables test dealing with the Sets and the use of [index] Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FooBarTest.cs 26 Apr 2004 03:49:08 -0000 1.14 --- FooBarTest.cs 28 Apr 2004 14:17:54 -0000 1.15 *************** *** 67,71 **** [Test] ! [Ignore("unknown problem")] public void Sortables() { --- 67,71 ---- [Test] ! [Ignore("HQL is broke")] public void Sortables() { *************** *** 90,94 **** b = (Baz) result[0]; Assert.IsTrue( b.sortablez.Count==3 ); ! Assert.AreEqual( ( (Sortable) b.sortablez[0] ).name, "bar" ); s.Flush(); t.Commit(); --- 90,103 ---- b = (Baz) result[0]; Assert.IsTrue( b.sortablez.Count==3 ); ! ! // compare the first item in the "Set" sortablez - can't reference ! // the first item using b.sortablez[0] because it thinks 0 is the ! // DictionaryEntry key - not the index. ! foreach(DictionaryEntry de in b.sortablez) ! { ! Assert.AreEqual( ((Sortable)de.Key).name, "bar"); ! break; ! } ! s.Flush(); t.Commit(); |
From: Michael D. <mik...@us...> - 2004-04-28 14:17:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20499/NHibernate.DomainModel Modified Files: Baz.cs Log Message: Removed code that was commented out instead of deleted originally. Index: Baz.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Baz.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Baz.cs 26 Apr 2004 03:47:32 -0000 1.4 --- Baz.cs 28 Apr 2004 14:17:10 -0000 1.5 *************** *** 232,237 **** /// Holder for stringSet /// </summary> ! //private System.Collections.IList _stringSet; ! private System.Collections.IDictionary _stringSet; /// <summary> --- 232,236 ---- /// Holder for stringSet /// </summary> ! private System.Collections.IDictionary _stringSet; /// <summary> *************** *** 552,556 **** /// Get/set for stringSet /// </summary> - //public System.Collections.IList stringSet public System.Collections.IDictionary stringSet { --- 551,554 ---- *************** *** 704,709 **** public void setDefaults() { - // stringSet = new ArrayList(); - // stringSet.Add("foo"); stringSet.Add("bar"); stringSet.Add("baz"); stringSet = new Hashtable(); stringSet.Add("foo", new object()); --- 702,705 ---- *************** *** 716,720 **** stringDateMap.Add( "big bang", new DateTime(0) ); ArrayList list = new ArrayList(); ! list.AddRange(stringSet.Keys); // stringSet); stringList = list; intArray = new int[] { 1,3,3,7 }; --- 712,716 ---- stringDateMap.Add( "big bang", new DateTime(0) ); ArrayList list = new ArrayList(); ! list.AddRange(stringSet.Keys); stringList = list; intArray = new int[] { 1,3,3,7 }; *************** *** 744,748 **** bag.Add("duplicate"); bag.Add("unique"); ! //cached = new ArrayList(); cached = new SortedList(); --- 740,744 ---- bag.Add("duplicate"); bag.Add("unique"); ! cached = new SortedList(); |
From: Michael D. <mik...@us...> - 2004-04-28 14:16:27
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/TypesTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20304/NHibernate.Test/TypesTest Added Files: PersistentEnumTypeFixture.cs Log Message: Added test for PersistentEnumType to verify the change to Equals was valid. --- NEW FILE: PersistentEnumTypeFixture.cs --- using System; using NHibernate.Type; using NUnit.Framework; namespace NHibernate.Test.TypesTest { public enum A { Zero, One, Two } public enum B { Zero, One, Two } /// <summary> /// The Unit Test for the PersistentEnum Type. /// </summary> [TestFixture] public class PersistentEnumTypeFixture : BaseTypeFixture { [Test] public void EqualsTrue() { IType type = NHibernate.Enum(typeof(A)); A lhs = A.One; A rhs = A.One; Assert.IsTrue( type.Equals(lhs, rhs) ); } /// <summary> /// Verify that even if the Enum have the same underlying value but they /// are different Enums that they are not considered Equal. /// </summary> [Test] public void EqualsFalseSameUnderlyingValue() { IType type = NHibernate.Enum(typeof(A)); A lhs = A.One; B rhs = B.One; Assert.IsFalse(type.Equals(lhs, rhs)); } [Test] public void EqualsFalse() { IType type = NHibernate.Enum(typeof(A)); A lhs = A.One; A rhs = A.Two; Assert.IsFalse(type.Equals(lhs, rhs)); } } } |
From: Michael D. <mik...@us...> - 2004-04-28 14:16:27
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20304/NHibernate/Type Modified Files: PersistentEnumType.cs Log Message: Added test for PersistentEnumType to verify the change to Equals was valid. Index: PersistentEnumType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/PersistentEnumType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PersistentEnumType.cs 20 Apr 2004 17:37:02 -0000 1.5 --- PersistentEnumType.cs 28 Apr 2004 14:16:18 -0000 1.6 *************** *** 52,80 **** } - // protected DbType UnderlyingDbType { //Not overridable. These are the DbTypes. - // get { - // switch( Enum.GetUnderlyingType(enumClass).FullName ) { - // case "System.Byte": - // return DbType.Byte; - // case "System.Int16": - // return DbType.Int16; - // case "System.Int32": - // return DbType.Int32; - // case "System.Int64": - // return DbType.Int64; - // case "System.SByte": - // return DbType.SByte; - // case "System.UInt16": - // return DbType.UInt16; - // case "System.UInt32": - // return DbType.UInt32; - // case "System.UInt64": - // return DbType.UInt64; - // default: - // throw new HibernateException( "Unknown UnderlyingDbType for Enum"); //Impossible exception - // } - // } - // } - public virtual object GetInstance(object code) { try { --- 52,55 ---- *************** *** 113,117 **** public override bool Equals(object x, object y) { ! return (x==y) || ( x!=null && y!=null && x.GetType()==y.GetType() && x.ToString()==y.ToString() ); } --- 88,93 ---- public override bool Equals(object x, object y) { ! //return (x==y) || ( x!=null && y!=null && x.GetType()==y.GetType() && x.ToString()==y.ToString() ); ! return (x==y) || ( x!=null && y!=null && x.Equals(y) ) ; } |
From: Michael D. <mik...@us...> - 2004-04-28 14:16:26
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20304/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: Added test for PersistentEnumType to verify the change to Equals was valid. Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NHibernate.Test-1.1.csproj 19 Apr 2004 14:02:58 -0000 1.16 --- NHibernate.Test-1.1.csproj 28 Apr 2004 14:16:17 -0000 1.17 *************** *** 338,341 **** --- 338,346 ---- /> <File + RelPath = "TypesTest\PersistentEnumTypeFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "TypesTest\TypeFactoryFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2004-04-28 03:46:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14548/NHibernate/Persister Modified Files: EntityPersister.cs NormalizedEntityPersister.cs Log Message: Added support for sending one command to the db to handle the Insert and retrieval of the Id. Fixed the sql being generated by NormalizedEntityPersister when a native Id is used. Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NormalizedEntityPersister.cs 26 Apr 2004 03:46:00 -0000 1.16 --- NormalizedEntityPersister.cs 28 Apr 2004 03:46:51 -0000 1.17 *************** *** 610,615 **** //if (IsPolymorphic) builder.AddColumn(DiscriminatorColumnName, DiscriminatorSQLString); ! if(identityInsert && j==0) { ! builder.AddColumn(tableKeyColumns[j][0], dialect.IdentityInsertString); } --- 610,622 ---- //if (IsPolymorphic) builder.AddColumn(DiscriminatorColumnName, DiscriminatorSQLString); ! if(identityInsert && j==0) ! { ! // make sure the Dialect has an identity insert string because we don't want ! // to add the column when there is no value to supply the SqlBuilder ! if(dialect.IdentityInsertString!=null) ! { ! // only 1 column if there is IdentityInsert enabled. ! builder.AddColumn(tableKeyColumns[j][0], dialect.IdentityInsertString); ! } } *************** *** 850,855 **** /// <param name="session"></param> /// <returns></returns> ! public override object Insert(object[] fields, object obj, ISessionImplementor session) { ! if (log.IsDebugEnabled) { log.Debug("Inserting entity: " + ClassName + " (native id)"); if ( IsVersioned ) log.Debug( "Version: " + Versioning.GetVersion(fields, this) ); --- 857,864 ---- /// <param name="session"></param> /// <returns></returns> ! public override object Insert(object[] fields, object obj, ISessionImplementor session) ! { ! if (log.IsDebugEnabled) ! { log.Debug("Inserting entity: " + ClassName + " (native id)"); if ( IsVersioned ) log.Debug( "Version: " + Versioning.GetVersion(fields, this) ); *************** *** 858,894 **** SqlString[] sqlStrings = SqlIdentityInsertStrings; ! IDbCommand statement = session.Preparer.PrepareCommand(sqlStrings[0]); ! try { Dehydrate(null, fields, allProperties, 0, statement, session); - statement.ExecuteNonQuery(); } ! catch (Exception e) { ! throw e; } - finally { - //session.Batcher.CloseStatement(statement); - } ! // fetch the generated id: ! IDbCommand idSelect = session.Preparer.PrepareCommand(SqlIdentitySelect); - object id; - try { IDataReader rs = idSelect.ExecuteReader(); ! try { if ( !rs.Read() ) throw new HibernateException("The database returned no natively generated identity value"); ! id = IdentifierGeneratorFactory.Get(rs, IdentifierType.ReturnedClass ); } ! finally { rs.Close(); } log.Debug("Natively generated identity: " + id); } ! catch (Exception e) { throw e; } ! finally { ! //session.Batcher.CloseStatement(idselect); } --- 867,926 ---- SqlString[] sqlStrings = SqlIdentityInsertStrings; ! IDbCommand statement = null; ! IDbCommand idSelect = null; ! object id; ! ! if(dialect.SupportsIdentitySelectInInsert) ! { ! statement = session.Preparer.PrepareCommand( dialect.AddIdentitySelectToInsert(SqlIdentityInsertStrings[0]) ); ! idSelect = statement; ! } ! else ! { ! statement = session.Preparer.PrepareCommand(SqlIdentityInsertStrings[0]); ! idSelect = session.Preparer.PrepareCommand(SqlIdentitySelect); ! } ! ! try ! { Dehydrate(null, fields, allProperties, 0, statement, session); } ! catch (Exception e) ! { ! throw new HibernateException("NormalizedEntityPersister had a problem Dehydrating for an Insert", e); } ! try ! { ! // if it doesn't support identity select in insert then we have to issue the Insert ! // as a seperate command here ! if(dialect.SupportsIdentitySelectInInsert==false) ! { ! statement.ExecuteNonQuery(); ! } IDataReader rs = idSelect.ExecuteReader(); ! try ! { if ( !rs.Read() ) throw new HibernateException("The database returned no natively generated identity value"); ! id = IdentifierGeneratorFactory.Get( rs, IdentifierType.ReturnedClass ); } ! finally ! { rs.Close(); } + log.Debug("Natively generated identity: " + id); + } ! catch (Exception e) ! { throw e; } ! finally ! { ! // session.Batcher.CloseStatement(statement); ! // session.Batcher.CloseStatement(idselect); } Index: EntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/EntityPersister.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** EntityPersister.cs 26 Apr 2004 03:46:00 -0000 1.16 --- EntityPersister.cs 28 Apr 2004 03:46:51 -0000 1.17 *************** *** 667,706 **** } ! IDbCommand statement = session.Preparer.PrepareCommand(SqlIdentityInsertString); ! try { Dehydrate(null, fields, PropertyInsertability, statement, session); - statement.ExecuteNonQuery(); } ! catch (Exception e) { ! throw e; } - finally { - //session.Batcher.CloseStatement(statement); - } ! // fetch the generated id: ! IDbCommand idSelect = session.Preparer.PrepareCommand(SqlIdentitySelect); - try { IDataReader rs = idSelect.ExecuteReader(); object id; ! try { if ( !rs.Read() ) throw new HibernateException("The database returned no natively generated identity value"); id = IdentifierGeneratorFactory.Get( rs, IdentifierType.ReturnedClass ); } ! finally { rs.Close(); } log.Debug("Natively generated identity: " + id); return id; } ! catch (Exception e) { throw e; } ! finally { ! //session.Batcher.CloseStatement(idselect); } } --- 667,727 ---- } ! IDbCommand statement = null; ! IDbCommand idSelect = null; + if(dialect.SupportsIdentitySelectInInsert) + { + statement = session.Preparer.PrepareCommand( dialect.AddIdentitySelectToInsert(SqlIdentityInsertString) ); + idSelect = statement; + } + else + { + statement = session.Preparer.PrepareCommand(SqlIdentityInsertString); + idSelect = session.Preparer.PrepareCommand(SqlIdentitySelect); + } ! ! try ! { Dehydrate(null, fields, PropertyInsertability, statement, session); } ! catch (Exception e) ! { ! throw new HibernateException("EntityPersister had a problem Dehydrating for an Insert", e); } ! try ! { ! // if it doesn't support identity select in insert then we have to issue the Insert ! // as a seperate command here ! if(dialect.SupportsIdentitySelectInInsert==false) ! { ! statement.ExecuteNonQuery(); ! } IDataReader rs = idSelect.ExecuteReader(); object id; ! try ! { if ( !rs.Read() ) throw new HibernateException("The database returned no natively generated identity value"); id = IdentifierGeneratorFactory.Get( rs, IdentifierType.ReturnedClass ); } ! finally ! { rs.Close(); } + log.Debug("Natively generated identity: " + id); return id; } ! catch (Exception e) ! { throw e; } ! finally ! { ! // session.Batcher.CloseStatement(statement); ! // session.Batcher.CloseStatement(idselect); } } |
From: Michael D. <mik...@us...> - 2004-04-28 03:46:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/NHibernate/Dialect Modified Files: Dialect.cs MsSql2000Dialect.cs Log Message: Added support for sending one command to the db to handle the Insert and retrieval of the Id. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Dialect.cs 16 Apr 2004 14:12:09 -0000 1.28 --- Dialect.cs 28 Apr 2004 03:46:11 -0000 1.29 *************** *** 196,199 **** --- 196,220 ---- /// <summary> + /// Does this Dialect allow adding a Sql String at the end of the + /// INSERT statement to retrieve the new Identity value. + /// </summary> + /// <value>defaults to false</value> + /// <remarks> + /// <para> + /// If the Dialect supports this then only one Command will need to be executed + /// against the Database to do the Insert and get the Id. + /// </para> + /// <para> + /// If this is overridden and returns <c>true</c> then the Dialect + /// is expected to override the method <see cref="AddIdentitySelectToInsert(SqlString)"/> + /// </para> + /// </remarks> + public virtual bool SupportsIdentitySelectInInsert + { + get { return false; } + } + + + /// <summary> /// Does this dialect support identity column key generation? /// </summary> *************** *** 211,214 **** --- 232,240 ---- } + public virtual SqlString AddIdentitySelectToInsert(SqlString insertSql) + { + throw new NotSupportedException("This Dialect does not implement AddIdentitySelectToInsert"); + } + /// <summary> /// The syntax that returns the identity value of the last insert, if native Index: MsSql2000Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MsSql2000Dialect.cs 16 Apr 2004 14:12:10 -0000 1.11 --- MsSql2000Dialect.cs 28 Apr 2004 03:46:11 -0000 1.12 *************** *** 2,5 **** --- 2,6 ---- using System.Data; + using NHibernate.SqlCommand; using NHibernate.SqlTypes; *************** *** 38,41 **** --- 39,62 ---- } + /// <summary> + /// MsSql allows the use of SELECT SCOPE_IDENTITY to be in the same + /// Command as the INSERT + /// </summary> + /// <value>true</value> + public override bool SupportsIdentitySelectInInsert + { + get { return true; } + } + + /// <summary> + /// Add the Identity Select string to the Insert Sql. + /// </summary> + /// <param name="insertSql">The SqlString that contains the INSERT sql.</param> + /// <returns>A new SqlString with <c>; SELECT SCOPE_IDENTITY()</c> at the end.</returns> + public override SqlString AddIdentitySelectToInsert(SqlString insertSql) + { + return insertSql.Append( new SqlString("; SELECT SCOPE_IDENTITY()") ); + } + public override bool SupportsIdentityColumns { |
From: Michael D. <mik...@us...> - 2004-04-28 03:45:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14408/NHibernate.DomainModel Modified Files: JoinedSubclass.hbm.xml Log Message: Modified the JoinedSubclass to use the native generator to help fix a bug with the sql that was being generated. Index: JoinedSubclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/JoinedSubclass.hbm.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JoinedSubclass.hbm.xml 10 Apr 2004 03:15:44 -0000 1.4 --- JoinedSubclass.hbm.xml 28 Apr 2004 03:45:36 -0000 1.5 *************** *** 6,10 **** > <id name="Id" type="Int32" unsaved-value="null" column="joined_subclass_id" > ! <generator class="assigned" /> </id> --- 6,10 ---- > <id name="Id" type="Int32" unsaved-value="null" column="joined_subclass_id" > ! <generator class="native" /> </id> |
From: Michael D. <mik...@us...> - 2004-04-28 03:45:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14408/NHibernate.Test Modified Files: JoinedSubclassTest.cs Log Message: Modified the JoinedSubclass to use the native generator to help fix a bug with the sql that was being generated. Index: JoinedSubclassTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclassTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclassTest.cs 10 Feb 2004 19:16:54 -0000 1.1 --- JoinedSubclassTest.cs 28 Apr 2004 03:45:37 -0000 1.2 *************** *** 28,31 **** --- 28,34 ---- public void TestCRUD() { + int one1Id; + int base1Id; + // test the Save ISession s1 = sessions.OpenSession(); *************** *** 33,37 **** JoinedSubclassOne one1 = new JoinedSubclassOne(); ! one1.Id = 2; one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; --- 36,40 ---- JoinedSubclassOne one1 = new JoinedSubclassOne(); ! //one1.Id = 2; one1.TestDateTime = new System.DateTime(2003, 10, 17); one1.TestString = "the test one string"; *************** *** 42,46 **** JoinedSubclassBase base1 = new JoinedSubclassBase(); ! base1.Id = 1; base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; --- 45,49 ---- JoinedSubclassBase base1 = new JoinedSubclassBase(); ! //base1.Id = 1; base1.TestDateTime = new System.DateTime(2003, 10, 17); base1.TestString = "the test string"; *************** *** 52,55 **** --- 55,61 ---- s1.Close(); + one1Id = one1.Id; + base1Id = base1.Id; + // lets verify the correct classes were saved ISession s2 = sessions.OpenSession(); *************** *** 57,62 **** // perform a load based on the base class ! JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 1); ! JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), 2); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. --- 63,68 ---- // perform a load based on the base class ! JoinedSubclassBase base2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), base1Id); ! JoinedSubclassBase oneBase2 = (JoinedSubclassBase)s2.Load(typeof(JoinedSubclassBase), one1Id); // do some quick checks to make sure s2 loaded an object with the same data as s2 saved. |
From: Michael D. <mik...@us...> - 2004-04-27 15:49:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28813/NHibernate/Type Modified Files: SortedMapType.cs SortedSetType.cs TypeFactory.cs Log Message: Added support for the attributes "order-by" and "sort" attribute on <set> and <map> elements. Index: SortedMapType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SortedMapType.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SortedMapType.cs 20 Feb 2003 21:42:15 -0000 1.1 --- SortedMapType.cs 27 Apr 2004 15:49:22 -0000 1.2 *************** *** 1,16 **** using System; namespace NHibernate.Type { /// <summary> ! /// Summary description for SortedMapType. /// </summary> ! public class SortedMapType { ! public SortedMapType() { ! // ! // TODO: Add constructor logic here ! // } } --- 1,40 ---- using System; + using System.Collections; + + using NHibernate.Collection; + using NHibernate.Engine; namespace NHibernate.Type { /// <summary> ! /// Extends the MapType to provide Sorting. /// </summary> ! public class SortedMapType : MapType { ! private IComparer comparer; ! ! public SortedMapType(string role, IComparer comparer) : base(role) { ! this.comparer = comparer; ! } ! ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) ! { ! SortedMap sortedMap = new SortedMap(session, comparer); ! return sortedMap; ! } ! ! //public System.Type ReturnedClass {get;} -> was overridden in H2.0.3 ! // because they have different Interfaces for Sorted/UnSorted - since .NET ! // doesn't have that I don't need to override it. ! ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) ! { ! return new SortedMap(session, (IDictionary)collection, comparer); ! } ! ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) ! { ! return new SortedMap(session, persister, comparer, disassembled, owner); } } Index: TypeFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** TypeFactory.cs 21 Apr 2004 14:33:07 -0000 1.27 --- TypeFactory.cs 27 Apr 2004 15:49:22 -0000 1.28 *************** *** 1068,1076 **** return new SetType(role); } ! /* public static PersistentCollectionType SortedMap(string role, IComparer comparer) { return new SortedMapType(role, comparer); ! }*/ public static PersistentCollectionType SortedSet(string role, IComparer comparer) --- 1068,1076 ---- return new SetType(role); } ! public static PersistentCollectionType SortedMap(string role, IComparer comparer) { return new SortedMapType(role, comparer); ! } public static PersistentCollectionType SortedSet(string role, IComparer comparer) Index: SortedSetType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SortedSetType.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SortedSetType.cs 8 Apr 2004 21:11:33 -0000 1.3 --- SortedSetType.cs 27 Apr 2004 15:49:22 -0000 1.4 *************** *** 5,23 **** using NHibernate.Engine; ! namespace NHibernate.Type{ /// <summary> /// Extends the SetType to provide Sorting. /// </summary> ! public class SortedSetType : SetType { ! private IComparer comparer; ! public SortedSetType(string role, IComparer comparer) : base(role){ this.comparer = comparer; } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) { SortedSet sortedSet = new SortedSet(session, comparer); - //sortedSet.Comparer = comparer; return sortedSet; } --- 5,25 ---- using NHibernate.Engine; ! namespace NHibernate.Type ! { /// <summary> /// Extends the SetType to provide Sorting. /// </summary> ! public class SortedSetType : SetType ! { private IComparer comparer; ! public SortedSetType(string role, IComparer comparer) : base(role) ! { this.comparer = comparer; } ! public override PersistentCollection Instantiate(ISessionImplementor session, CollectionPersister persister) ! { SortedSet sortedSet = new SortedSet(session, comparer); return sortedSet; } *************** *** 27,40 **** // doesn't have that I don't need to override it. ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) { return new SortedSet(session, (IDictionary)collection, comparer); } ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) { return new SortedSet(session, persister, comparer, disassembled, owner); } - - } --- 29,42 ---- // doesn't have that I don't need to override it. ! public override PersistentCollection Wrap(ISessionImplementor session, object collection) ! { return new SortedSet(session, (IDictionary)collection, comparer); } ! public override PersistentCollection AssembleCachedCollection(ISessionImplementor session, CollectionPersister persister, object disassembled, object owner) ! { return new SortedSet(session, persister, comparer, disassembled, owner); } } |