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...> - 2005-02-14 03:14:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9976/NHibernate/Proxy Modified Files: ProxyGeneratorFactory.cs Log Message: Added a default private ctor to prevent .net from adding a default public one. Index: ProxyGeneratorFactory.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Proxy/ProxyGeneratorFactory.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProxyGeneratorFactory.cs 31 Dec 2004 22:08:37 -0000 1.4 --- ProxyGeneratorFactory.cs 14 Feb 2005 03:13:56 -0000 1.5 *************** *** 12,15 **** --- 12,20 ---- private static IProxyGenerator _generator = new CastleProxyGenerator(); + private ProxyGeneratorFactory() + { + // should not be created. + } + /// <summary></summary> public static IProxyGenerator GetProxyGenerator() |
From: John M. <joh...@us...> - 2005-02-13 04:18:40
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9861/src/NHibernate.Tool.Net2Hbm Modified Files: CollectionOneToManyAttribute.cs Log Message: Removed incorrect comments. Index: CollectionOneToManyAttribute.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/CollectionOneToManyAttribute.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CollectionOneToManyAttribute.cs 11 Feb 2005 22:53:35 -0000 1.1 --- CollectionOneToManyAttribute.cs 13 Feb 2005 04:18:30 -0000 1.2 *************** *** 1,19 **** - #region Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. - /* ============================================================================ - // $Header$ - // - // Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. - // - // Purpose: [To be filled in.] - // - // $Log$ - // Revision 1.1 2005/02/11 22:53:35 johntmorris - // Added a collection one to many attribute. - // - // - // $NoKeywords: $ - // ========================================================================= */ - #endregion - using System; --- 1,2 ---- |
From: John M. <joh...@us...> - 2005-02-13 04:17:36
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9416/src/NHibernate.Tool.Net2Hbm Modified Files: GeneratorParameterAttribute.cs Log Message: Removed incorrect comments. Index: GeneratorParameterAttribute.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/GeneratorParameterAttribute.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GeneratorParameterAttribute.cs 13 Feb 2005 01:32:12 -0000 1.1 --- GeneratorParameterAttribute.cs 13 Feb 2005 04:17:25 -0000 1.2 *************** *** 1,19 **** - #region Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. - /* ============================================================================ - // $Header$ - // - // Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. - // - // Purpose: [To be filled in.] - // - // $Log$ - // Revision 1.1 2005/02/13 01:32:12 johntmorris - // Added the generator parameter attribute to support generator params on the id tag. - // - // - // $NoKeywords: $ - // ========================================================================= */ - #endregion - using System; --- 1,2 ---- |
From: John M. <joh...@us...> - 2005-02-13 03:40:53
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25848/src/NHibernate.Tool.Net2Hbm Modified Files: IdAttribute.cs MapGenerator.cs PropertyAttribute.cs Log Message: Added support for the access attribute on the prooerty and id tags. Index: MapGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/MapGenerator.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MapGenerator.cs 13 Feb 2005 01:32:12 -0000 1.3 --- MapGenerator.cs 13 Feb 2005 03:40:44 -0000 1.4 *************** *** 375,378 **** --- 375,379 ---- writer.WriteAttributeString( "name", property.Name ); writer.WriteAttributeString( "column", attribute.Column == null ? property.Name : attribute.Column ); + writer.WriteAttributeString( "access", attribute.Access ); string typeName = null; *************** *** 503,506 **** --- 504,508 ---- writer.WriteAttributeString( "type", GetShortTypeName( property.PropertyType ) ); writer.WriteAttributeString( "column", attribute.Column ); + writer.WriteAttributeString( "access", attribute.Access ); if( attribute.UnsavedValueType == UnsavedValueType.Specified ) Index: PropertyAttribute.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/PropertyAttribute.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyAttribute.cs 30 Dec 2004 16:54:02 -0000 1.1 --- PropertyAttribute.cs 13 Feb 2005 03:40:44 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- private string m_Column; private System.Type m_Type; + private string m_Access = "property"; private bool m_Update = true; private bool m_Insert = true; *************** *** 94,97 **** --- 95,107 ---- /// <summary> + /// Gets and sets the Access. + /// </summary> + public string Access + { + get { return m_Access; } + set { m_Access = value; } + } + + /// <summary> /// Gets and sets the Column. /// </summary> Index: IdAttribute.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/IdAttribute.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdAttribute.cs 30 Dec 2004 16:54:02 -0000 1.1 --- IdAttribute.cs 13 Feb 2005 03:40:44 -0000 1.2 *************** *** 12,15 **** --- 12,16 ---- private string m_Column; + private string m_Access = "property"; private UnsavedValueType m_UnsavedValueType = UnsavedValueType.Null; private string m_UnsavedValue; *************** *** 37,40 **** --- 38,50 ---- /// <summary> + /// Gets and sets the Access. + /// </summary> + public string Access + { + get { return m_Access; } + set { m_Access = value; } + } + + /// <summary> /// Gets and sets the UnsavedValueType. /// </summary> |
From: John M. <joh...@us...> - 2005-02-13 01:32:22
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5742/src/NHibernate.Tool.Net2Hbm Modified Files: MapGenerator.cs NHibernate.Tool.Net2Hbm-1.1.csproj Added Files: GeneratorParameterAttribute.cs Log Message: Added the generator parameter attribute to support generator params on the id tag. Index: MapGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/MapGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MapGenerator.cs 11 Feb 2005 22:54:01 -0000 1.2 --- MapGenerator.cs 13 Feb 2005 01:32:12 -0000 1.3 *************** *** 497,500 **** --- 497,501 ---- PropertyInfo property = FindAttributedProperty( typeof(IdAttribute), type ); if( property == null ) throw new Exception( "Missing required IdAttribute." ); + IdAttribute attribute = (IdAttribute)Attribute.GetCustomAttribute( property, typeof(IdAttribute), false ); writer.WriteStartElement( "id" ); *************** *** 510,513 **** --- 511,515 ---- writer.WriteStartElement("generator"); writer.WriteAttributeString( "class", GetShortTypeName( attribute.Generator ) ); + WriteGeneratorParameters( writer, property ); writer.WriteEndElement(); //</generator> writer.WriteEndElement(); //</id> *************** *** 515,518 **** --- 517,537 ---- /// <summary> + /// Writes the generator parameters. + /// </summary> + /// <param name="writer"></param> + /// <param name="property"></param> + private void WriteGeneratorParameters( XmlWriter writer, PropertyInfo property ) + { + GeneratorParameterAttribute[] attributes = (GeneratorParameterAttribute[])Attribute.GetCustomAttributes( property, typeof(GeneratorParameterAttribute), true ); + foreach( GeneratorParameterAttribute attribute in attributes ) + { + writer.WriteStartElement( "param" ); + writer.WriteAttributeString( "name", attribute.Name ); + writer.WriteString( attribute.Value ); + writer.WriteEndElement(); //</param> + } + } + + /// <summary> /// Writes the joined subclass. /// </summary> Index: NHibernate.Tool.Net2Hbm-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/NHibernate.Tool.Net2Hbm-1.1.csproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NHibernate.Tool.Net2Hbm-1.1.csproj 11 Feb 2005 22:54:01 -0000 1.3 --- NHibernate.Tool.Net2Hbm-1.1.csproj 13 Feb 2005 01:32:12 -0000 1.4 *************** *** 135,138 **** --- 135,143 ---- /> <File + RelPath = "GeneratorParameterAttribute.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "IdAttribute.cs" SubType = "Code" --- NEW FILE: GeneratorParameterAttribute.cs --- #region Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. /* ============================================================================ // $Header: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/GeneratorParameterAttribute.cs,v 1.1 2005/02/13 01:32:12 johntmorris Exp $ // // Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. // // Purpose: [To be filled in.] // // $Log: GeneratorParameterAttribute.cs,v $ // Revision 1.1 2005/02/13 01:32:12 johntmorris // Added the generator parameter attribute to support generator params on the id tag. // // // $NoKeywords: $ // ========================================================================= */ #endregion using System; namespace NHibernate.Tool.Net2Hbm { /// <summary> /// Summary description for GeneratorParameterAttribute. /// </summary> [AttributeUsage(AttributeTargets.Property, AllowMultiple=true)] public class GeneratorParameterAttribute : Attribute { #region Member Variables private string m_Name; private string m_Value; #endregion /// <summary> /// Class constructor. /// </summary> public GeneratorParameterAttribute( string name, string value ) { m_Name = name; m_Value = value; } /// <summary> /// Gets and sets the Name. /// </summary> public string Name { get { return m_Name; } set { m_Name = value; } } /// <summary> /// Gets and sets the Value. /// </summary> public string Value { get { return m_Value; } set { m_Value = value; } } } } |
From: John M. <joh...@us...> - 2005-02-11 22:54:15
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7306/src/NHibernate.Tool.Net2Hbm Modified Files: MapGenerator.cs NHibernate.Tool.Net2Hbm-1.1.csproj Log Message: Added a collection one to many attribute. Index: MapGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/MapGenerator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MapGenerator.cs 30 Dec 2004 16:54:02 -0000 1.1 --- MapGenerator.cs 11 Feb 2005 22:54:01 -0000 1.2 *************** *** 176,179 **** --- 176,180 ---- WriteCollectionKey( writer, property ); WriteCollectionIndex( writer, property ); + WriteCollectionOneToMany( writer, property ); WriteCollectionCompositeElement( writer, property ); WriteCollectionManyToMany( writer, property ); *************** *** 194,197 **** --- 195,199 ---- if( attribute.IsLazy ) writer.WriteAttributeString( "lazy", "true" ); WriteCollectionKey( writer, property ); + WriteCollectionOneToMany( writer, property ); WriteCollectionCompositeElement( writer, property ); writer.WriteEndElement(); //<list> *************** *** 284,287 **** --- 286,305 ---- } } + + /// <summary> + /// Writes the collection one to many tag. + /// </summary> + /// <param name="writer"></param> + /// <param name="property"></param> + private void WriteCollectionOneToMany( XmlWriter writer, PropertyInfo property ) + { + CollectionOneToManyAttribute attribute = (CollectionOneToManyAttribute)Attribute.GetCustomAttribute( property, typeof(CollectionOneToManyAttribute) ); + if( attribute != null ) + { + writer.WriteStartElement( "one-to-many" ); + writer.WriteAttributeString( "class", GetShortTypeName( attribute.Type ) ); + writer.WriteEndElement(); //<one-to-many> + } + } /// <summary> Index: NHibernate.Tool.Net2Hbm-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/NHibernate.Tool.Net2Hbm-1.1.csproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernate.Tool.Net2Hbm-1.1.csproj 30 Jan 2005 15:04:37 -0000 1.2 --- NHibernate.Tool.Net2Hbm-1.1.csproj 11 Feb 2005 22:54:01 -0000 1.3 *************** *** 125,128 **** --- 125,133 ---- /> <File + RelPath = "CollectionOneToManyAttribute.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "DiscriminatorAttribute.cs" SubType = "Code" |
From: John M. <joh...@us...> - 2005-02-11 22:53:47
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7115/src/NHibernate.Tool.Net2Hbm Added Files: CollectionOneToManyAttribute.cs Log Message: Added a collection one to many attribute. --- NEW FILE: CollectionOneToManyAttribute.cs --- #region Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. /* ============================================================================ // $Header: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.Net2Hbm/CollectionOneToManyAttribute.cs,v 1.1 2005/02/11 22:53:35 johntmorris Exp $ // // Copyright (c) 2004 Schwab Performance Technologies, Inc. All rights reserved. // // Purpose: [To be filled in.] // // $Log: CollectionOneToManyAttribute.cs,v $ // Revision 1.1 2005/02/11 22:53:35 johntmorris // Added a collection one to many attribute. // // // $NoKeywords: $ // ========================================================================= */ #endregion using System; namespace NHibernate.Tool.Net2Hbm { /// <summary> /// Summary description for CollectionOneToManyAttribute. /// </summary> [AttributeUsage(AttributeTargets.Property)] public class CollectionOneToManyAttribute : Attribute { #region Member Variables private System.Type m_Type; #endregion /// <summary> /// Class constructor. /// </summary> public CollectionOneToManyAttribute( System.Type type ) { this.Type = type; } /// <summary> /// Gets and sets the Type. /// </summary> public System.Type Type { get { return m_Type; } set { m_Type = value; } } } } |
From: Sergey K. <jus...@us...> - 2005-02-11 22:02:19
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19650/src/NHibernate/Engine Modified Files: Cascades.cs Log Message: Make StyleSaveUpdate also cascade on locks (forgot to add this) Index: Cascades.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Cascades.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Cascades.cs 6 Feb 2005 01:58:56 -0000 1.13 --- Cascades.cs 11 Feb 2005 22:02:07 -0000 1.14 *************** *** 228,232 **** public override bool DoCascade( CascadingAction action ) { ! return action == CascadingAction.ActionSaveUpdate; } } --- 228,234 ---- public override bool DoCascade( CascadingAction action ) { ! return action == CascadingAction.ActionSaveUpdate ! || action == CascadingAction.ActionLock; ! // TODO: H2.1 also includes Copy and Replicate actions here } } |
From: Sergey K. <jus...@us...> - 2005-02-11 21:27:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5205/src/NHibernate/Impl Modified Files: SessionImpl.cs Log Message: ISession.Get implementation (both overloads), including a test Index: SessionImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionImpl.cs,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** SessionImpl.cs 7 Feb 2005 01:34:41 -0000 1.65 --- SessionImpl.cs 11 Feb 2005 21:26:23 -0000 1.66 *************** *** 2334,2350 **** /// Load the data for the object with the specified id into a newly created object /// using "for update", if supported. A new key will be assigned to the object. ! /// This should return an existing proxy where appropriate. /// </summary> /// <param name="clazz"></param> /// <param name="id"></param> /// <param name="lockMode"></param> /// <returns></returns> ! public object Load( System.Type clazz, object id, LockMode lockMode ) { - if( lockMode == LockMode.Write ) - { - throw new HibernateException( "invalid lock mode for Load()" ); - } - if( log.IsDebugEnabled ) { --- 2334,2347 ---- /// Load the data for the object with the specified id into a newly created object /// using "for update", if supported. A new key will be assigned to the object. ! /// This method always hits the db, and does not create proxies. It should return ! /// an existing proxy where appropriate. /// </summary> /// <param name="clazz"></param> /// <param name="id"></param> /// <param name="lockMode"></param> + /// <param name="allowNull"></param> /// <returns></returns> ! private object DoLoad( System.Type clazz, object id, LockMode lockMode, bool allowNull ) { if( log.IsDebugEnabled ) { *************** *** 2376,2386 **** } ! ThrowObjectNotFound( result, id, persister.MappedClass ); ! // retunr existing proxy (if one exists) return ProxyFor( persister, new Key( id, persister ), result ); } /// <summary> /// Actually do all the hard work of loading up an object /// </summary> --- 2373,2440 ---- } ! if( !allowNull ) ThrowObjectNotFound( result, id, persister.MappedClass ); ! // return existing proxy (if one exists) return ProxyFor( persister, new Key( id, persister ), result ); } /// <summary> + /// Load the data for the object with the specified id into a newly created object + /// using "for update", if supported. A new key will be assigned to the object. + /// This should return an existing proxy where appropriate. + /// + /// If the object does not exist in the database, an exception is thrown. + /// </summary> + /// <param name="clazz"></param> + /// <param name="id"></param> + /// <param name="lockMode"></param> + /// <returns></returns> + /// <exception cref="ObjectNotFoundException"> + /// Thrown when the object with the specified id does not exist in the database. + /// </exception> + public object Load( System.Type clazz, object id, LockMode lockMode ) + { + if( lockMode == LockMode.Write ) + { + throw new HibernateException( "invalid lock mode for Load()" ); + } + + if( lockMode == LockMode.None ) + { + // we don't necessarily need to hit the db in this case + return Load( clazz, id ); + } + + return DoLoad( clazz, id, lockMode, false ); + } + + /// <summary> + /// Load the data for the object with the specified id into a newly created object + /// using "for update", if supported. A new key will be assigned to the object. + /// This should return an existing proxy where appropriate. + /// + /// If the object does not exist in the database, null is returned. + /// </summary> + /// <param name="clazz"></param> + /// <param name="id"></param> + /// <param name="lockMode"></param> + /// <returns></returns> + public object Get( System.Type clazz, object id, LockMode lockMode ) + { + if( lockMode == LockMode.Write ) + { + throw new HibernateException( "invalid lock mode for Get()" ); + } + + if( lockMode == LockMode.None ) + { + // we don't necessarily need to hit the db in this case + return Load( clazz, id ); + } + + return DoLoad( clazz, id, lockMode, true ); + } + + /// <summary> /// Actually do all the hard work of loading up an object /// </summary> |
From: Sergey K. <jus...@us...> - 2005-02-11 21:27:11
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5205/src/NHibernate Modified Files: ISession.cs Log Message: ISession.Get implementation (both overloads), including a test Index: ISession.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ISession.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ISession.cs 1 Jan 2005 03:33:40 -0000 1.13 --- ISession.cs 11 Feb 2005 21:26:21 -0000 1.14 *************** *** 53,57 **** /// } catch (Exception e) { /// if (tx != null) tx.Rollback(); ! /// throw e; /// } finally { /// sess.Close(); --- 53,57 ---- /// } catch (Exception e) { /// if (tx != null) tx.Rollback(); ! /// throw; /// } finally { /// sess.Close(); *************** *** 193,196 **** --- 193,217 ---- /// <summary> + /// Return the persistent instance of the given entity class with the given identifier, or null + /// if there is no such persistent instance. (If the instance, or a proxy for the instance, is + /// already associated with the session, return that instance or proxy.) + /// </summary> + /// <param name="clazz">a persistent class</param> + /// <param name="id">an identifier</param> + /// <returns>a persistent instance or null</returns> + object Get(System.Type clazz, object id); + + /// <summary> + /// Return the persistent instance of the given entity class with the given identifier, or null + /// if there is no such persistent instance. Obtain the specified lock mode if the instance + /// exists. + /// </summary> + /// <param name="clazz">a persistent class</param> + /// <param name="id">an identifier</param> + /// <param name="lockMode">the lock mode</param> + /// <returns>a persistent instance or null</returns> + object Get(System.Type clazz, object id, LockMode lockMode); + + /// <summary> /// Persist the given transient instance, first assigning a generated identifier. /// </summary> |
From: Sergey K. <jus...@us...> - 2005-02-11 21:27:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5205/src/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: ISession.Get implementation (both overloads), including a test Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** NHibernate.Test-1.1.csproj 10 Feb 2005 17:47:59 -0000 1.62 --- NHibernate.Test-1.1.csproj 11 Feb 2005 21:26:21 -0000 1.63 *************** *** 438,441 **** --- 438,446 ---- /> <File + RelPath = "NHSpecificTest\GetTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\LazyLoadBugTest.cs" SubType = "Code" |
From: Sergey K. <jus...@us...> - 2005-02-11 21:26:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5205/src/NHibernate.Test/NHSpecificTest Added Files: GetTest.cs Log Message: ISession.Get implementation (both overloads), including a test --- NEW FILE: GetTest.cs --- using NHibernate; using NHibernate.DomainModel; using NUnit.Framework; namespace NHibernate.Test.NHSpecificTest { [TestFixture] public class GetTest : TestCase { [SetUp] public void SetUp() { // A class with a proxy is needed to actually test Get vs Load. ExportSchema( new string[] { "ABCProxy.hbm.xml" }, true ); } [Test] public void GetVsLoad() { A a = new A( "name" ); using( ISession s = sessions.OpenSession() ) { s.Save( a ); } using( ISession s = sessions.OpenSession() ) { A loadedA = ( A )s.Load( typeof( A ), a.Id ); Assert.IsFalse( NHibernateUtil.IsInitialized( loadedA ), "Load should not initialize the object" ); Assert.IsNotNull( s.Load( typeof( A ), 2 ), "Loading non-existent object should not return null" ); } using( ISession s = sessions.OpenSession() ) { A gotA = (A)s.Get( typeof( A ), a.Id ); Assert.IsTrue(NHibernateUtil.IsInitialized( gotA ), "Get should initialize the object" ); Assert.IsNull( s.Get( typeof( A ), 2 ), "Getting non-existent object should return null" ); } } } } |
From: Sergey K. <jus...@us...> - 2005-02-11 21:01:43
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27544/src/NHibernate/Type Modified Files: IType.cs Log Message: Fixed a typo in an XML comment Index: IType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IType.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** IType.cs 31 Dec 2004 23:53:39 -0000 1.11 --- IType.cs 11 Feb 2005 21:01:17 -0000 1.12 *************** *** 105,109 **** /// <include file='IType.cs.xmldoc' ! /// path='//members[@type="IType"]/member[@name=M:IType.Disassemble"]/*' /// /> object Disassemble( object value, ISessionImplementor session ); --- 105,109 ---- /// <include file='IType.cs.xmldoc' ! /// path='//members[@type="IType"]/member[@name="M:IType.Disassemble"]/*' /// /> object Disassemble( object value, ISessionImplementor session ); |
From: Sergey K. <jus...@us...> - 2005-02-11 20:22:41
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10714/src/NHibernate/Dialect Modified Files: TypeNames.cs Log Message: Throw an exception for unsupported DbTypes Index: TypeNames.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/TypeNames.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TypeNames.cs 31 Dec 2004 17:07:24 -0000 1.5 --- TypeNames.cs 11 Feb 2005 20:22:25 -0000 1.6 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Data; *************** *** 60,64 **** public string Get( DbType typecode ) { ! return ( string ) defaults[ typecode ]; } --- 61,72 ---- public string Get( DbType typecode ) { ! string result = ( string ) defaults[ typecode ]; ! ! if( result == null ) ! { ! throw new ArgumentException("Dialect does not support DbType." + typecode, ! "typecode"); ! } ! return result; } |
From: Michael D. <mik...@us...> - 2005-02-11 05:15:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16616/NHibernate.DomainModel/NHSpecific Modified Files: LazyLoadBug.cs Log Message: added comments about why an exception should be thrown. Index: LazyLoadBug.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific/LazyLoadBug.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LazyLoadBug.cs 10 Feb 2005 17:48:00 -0000 1.1 --- LazyLoadBug.cs 11 Feb 2005 05:15:35 -0000 1.2 *************** *** 47,50 **** --- 47,53 ---- { _parent = value; + // this is the source of the "bug" - more accurately described as user error + // but it raised a Null Pointer Exception instead of a LazyInitializationException + // like it should have. _parent.Children.Add( this ); } |
From: Michael D. <mik...@us...> - 2005-02-11 05:15:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16616/NHibernate.Test/NHSpecificTest Modified Files: LazyLoadBugTest.cs Log Message: added comments about why an exception should be thrown. Index: LazyLoadBugTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest/LazyLoadBugTest.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LazyLoadBugTest.cs 10 Feb 2005 17:48:00 -0000 1.1 --- LazyLoadBugTest.cs 11 Feb 2005 05:15:35 -0000 1.2 *************** *** 1,9 **** using System; - using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; ! namespace NHibernate.Test { [TestFixture] --- 1,8 ---- using System; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; ! namespace NHibernate.Test.NHSpecificTest { [TestFixture] *************** *** 42,46 **** LLParent parent2 = (LLParent)s2.Load( typeof(LLParent), parentId ); ! // this should throw an exception int count = parent2.Children.Count; } --- 41,48 ---- LLParent parent2 = (LLParent)s2.Load( typeof(LLParent), parentId ); ! // this should throw the exception - the property setter access is not mapped correctly. ! // Because it maintains logic to maintain the collection during the property set it should ! // tell NHibernate to skip the setter and access the field. If it doesn't, then throw ! // a LazyInitializationException. int count = parent2.Children.Count; } |
From: Michael D. <mik...@us...> - 2005-02-11 05:12:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15294/NHibernate/Id Modified Files: TableGenerator.cs Log Message: modified how id is read from the db to support IDataReaders (like the Oracle one) don't work with GetInt32. Index: TableGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/TableGenerator.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TableGenerator.cs 30 Jan 2005 19:39:12 -0000 1.15 --- TableGenerator.cs 11 Feb 2005 05:12:34 -0000 1.16 *************** *** 143,147 **** } ! result = rs.GetInt32( 0 ); rs.Close(); } --- 143,147 ---- } ! result = Convert.ToInt32( rs[ 0 ] ); rs.Close(); } |
From: Sergey K. <jus...@us...> - 2005-02-10 17:48:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHSpecificTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/src/NHibernate.Test/NHSpecificTest Added Files: LazyLoadBugTest.cs Log Message: A test case from NH-200 and a fix for the bug (NullReferenceException when accessing a loading Set). --- NEW FILE: LazyLoadBugTest.cs --- using System; using System.Collections; using NHibernate.DomainModel.NHSpecific; using NUnit.Framework; namespace NHibernate.Test { [TestFixture] public class LazyLoadBugTest : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "NHSpecific.LazyLoadBug.hbm.xml"} ); } [Test] [ExpectedException(typeof(LazyInitializationException))] public void TestLazyLoad() { int parentId = 0; using( ISession s1 = sessions.OpenSession() ) using( ITransaction t1 = s1.BeginTransaction() ) { // create a new LLParent parent = new LLParent(); LLChild child = new LLChild(); child.Parent = parent; s1.Save( parent ); parentId = (int)s1.GetIdentifier( parent ); t1.Commit(); } // try to Load the object to get the exception using( ISession s2 = sessions.OpenSession() ) using( ITransaction t2 = s2.BeginTransaction() ) { LLParent parent2 = (LLParent)s2.Load( typeof(LLParent), parentId ); // this should throw an exception int count = parent2.Children.Count; } } [Test] public void TestLazyLoadNoAdd() { int parentId = 0; using( ISession s1 = sessions.OpenSession() ) using( ITransaction t1 = s1.BeginTransaction() ) { // create a new LLParent parent = new LLParent(); LLChildNoAdd child = new LLChildNoAdd(); parent.ChildrenNoAdd.Add( child ); child.Parent = parent; s1.Save( parent ); parentId = (int)s1.GetIdentifier( parent ); t1.Commit(); } // try to Load the object to make sure the save worked using( ISession s2 = sessions.OpenSession() ) using( ITransaction t2 = s2.BeginTransaction() ) { LLParent parent2 = (LLParent)s2.Load( typeof( LLParent ), parentId ); Assert.AreEqual( 1, parent2.ChildrenNoAdd.Count ); } } } } |
From: Sergey K. <jus...@us...> - 2005-02-10 17:48:09
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/src/NHibernate/Collection Modified Files: Set.cs Log Message: A test case from NH-200 and a fix for the bug (NullReferenceException when accessing a loading Set). Index: Set.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Set.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Set.cs 7 Feb 2005 01:34:40 -0000 1.23 --- Set.cs 10 Feb 2005 17:47:59 -0000 1.24 *************** *** 404,407 **** --- 404,408 ---- public override void BeginRead() { + base.BeginRead(); tempList = new ArrayList(); } |
From: Sergey K. <jus...@us...> - 2005-02-10 17:48:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/src/NHibernate.DomainModel Modified Files: NHibernate.DomainModel-1.1.csproj Log Message: A test case from NH-200 and a fix for the bug (NullReferenceException when accessing a loading Set). Index: NHibernate.DomainModel-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel-1.1.csproj,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** NHibernate.DomainModel-1.1.csproj 12 Dec 2004 07:18:19 -0000 1.29 --- NHibernate.DomainModel-1.1.csproj 10 Feb 2005 17:47:58 -0000 1.30 *************** *** 672,675 **** --- 672,684 ---- /> <File + RelPath = "NHSpecific\LazyLoadBug.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "NHSpecific\LazyLoadBug.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File RelPath = "NHSpecific\Node.cs" SubType = "Code" |
From: Sergey K. <jus...@us...> - 2005-02-10 17:48:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHSpecific In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/src/NHibernate.DomainModel/NHSpecific Added Files: LazyLoadBug.cs LazyLoadBug.hbm.xml Log Message: A test case from NH-200 and a fix for the bug (NullReferenceException when accessing a loading Set). --- NEW FILE: LazyLoadBug.cs --- using System; using Iesi.Collections; namespace NHibernate.DomainModel.NHSpecific { /// <summary> /// Summary description for LLParent. /// </summary> public class LLParent { private ISet _children; private ISet _childrenNoAdd; public ISet Children { get { if( _children == null ) _children = new HashedSet( ); return _children; } set { _children = value; } } public ISet ChildrenNoAdd { get { if( _childrenNoAdd == null ) _childrenNoAdd = new HashedSet( ); return _childrenNoAdd; } set { _childrenNoAdd = value; } } } /// <summary> /// Summary description for LLChild. /// </summary> public class LLChild { private LLParent _parent; public LLParent Parent { get { return _parent; } set { _parent = value; _parent.Children.Add( this ); } } } /// <summary> /// Summary description for LLChild. /// </summary> public class LLChildNoAdd { private LLParent _parent; public LLParent Parent { get { return _parent; } set { _parent = value; } } } } --- NEW FILE: LazyLoadBug.hbm.xml --- (This appears to be a binary file; contents omitted.) |
From: Sergey K. <jus...@us...> - 2005-02-10 17:48:08
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv969/src/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: A test case from NH-200 and a fix for the bug (NullReferenceException when accessing a loading Set). Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** NHibernate.Test-1.1.csproj 17 Jan 2005 05:54:37 -0000 1.61 --- NHibernate.Test-1.1.csproj 10 Feb 2005 17:47:59 -0000 1.62 *************** *** 438,441 **** --- 438,446 ---- /> <File + RelPath = "NHSpecificTest\LazyLoadBugTest.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "NHSpecificTest\MapFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2005-02-09 03:09:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20176/NHibernate/Mapping Modified Files: Constraint.cs ForeignKey.cs PrimaryKey.cs UniqueKey.cs Log Message: NH-173: modify how ddl is generated for MySql 4.1+ Index: PrimaryKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PrimaryKey.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PrimaryKey.cs 2 Jan 2005 22:03:39 -0000 1.7 --- PrimaryKey.cs 9 Feb 2005 03:09:39 -0000 1.8 *************** *** 57,60 **** --- 57,75 ---- return buf.Append( StringHelper.ClosedParen ).ToString(); } + + #region IRelationalModel Members + + /// <summary> + /// Get the SQL string to drop this Constraint in the database. + /// </summary> + /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> + /// <returns> + /// A string that contains the SQL to drop this Constraint. + /// </returns> + public override string SqlDropString(NHibernate.Dialect.Dialect dialect) + { + return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropPrimaryKeyConstraintString( Name ); + } + #endregion } } \ No newline at end of file Index: Constraint.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Constraint.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Constraint.cs 2 Jan 2005 22:03:39 -0000 1.6 --- Constraint.cs 9 Feb 2005 03:09:38 -0000 1.7 *************** *** 80,84 **** /// A string that contains the SQL to drop this Constraint. /// </returns> ! public string SqlDropString( Dialect.Dialect dialect ) { return "alter table " + Table.GetQualifiedName( dialect ) + " drop constraint " + Name; --- 80,84 ---- /// A string that contains the SQL to drop this Constraint. /// </returns> ! public virtual string SqlDropString( Dialect.Dialect dialect ) { return "alter table " + Table.GetQualifiedName( dialect ) + " drop constraint " + Name; Index: ForeignKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/ForeignKey.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ForeignKey.cs 2 Jan 2005 22:03:39 -0000 1.7 --- ForeignKey.cs 9 Feb 2005 03:09:39 -0000 1.8 *************** *** 89,92 **** --- 89,108 ---- set { referencedClass = value; } } + + #region IRelationalModel Memebers + + /// <summary> + /// Get the SQL string to drop this Constraint in the database. + /// </summary> + /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> + /// <returns> + /// A string that contains the SQL to drop this Constraint. + /// </returns> + public override string SqlDropString(NHibernate.Dialect.Dialect dialect) + { + return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropForeignKeyConstraintString( Name ); + } + + #endregion } } \ No newline at end of file Index: UniqueKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/UniqueKey.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** UniqueKey.cs 6 Jan 2005 14:19:59 -0000 1.7 --- UniqueKey.cs 9 Feb 2005 03:09:39 -0000 1.8 *************** *** 66,69 **** --- 66,85 ---- return StringHelper.Replace( buf.Append( StringHelper.ClosedParen ).ToString(), "primary key", "unique" ); } + + #region IRelationalModel Members + + /// <summary> + /// Get the SQL string to drop this Constraint in the database. + /// </summary> + /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> + /// <returns> + /// A string that contains the SQL to drop this Constraint. + /// </returns> + public override string SqlDropString(NHibernate.Dialect.Dialect dialect) + { + return "alter table " + Table.GetQualifiedName( dialect ) + dialect.GetDropIndexConstraintString( Name ); + } + + #endregion } } \ No newline at end of file |
From: Michael D. <mik...@us...> - 2005-02-09 03:09:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20176/NHibernate/Dialect Modified Files: Dialect.cs MySQLDialect.cs Log Message: NH-173: modify how ddl is generated for MySql 4.1+ Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Dialect.cs 31 Jan 2005 03:24:43 -0000 1.43 --- Dialect.cs 9 Feb 2005 03:09:38 -0000 1.44 *************** *** 217,220 **** --- 217,232 ---- /// <summary> + /// The syntax used to drop a foreign key constraint from a table. + /// </summary> + /// <param name="constraintName">The name of the foreign key constraint to drop.</param> + /// <returns> + /// The SQL string to drop the foreign key constraint. + /// </returns> + public virtual string GetDropForeignKeyConstraintString( string constraintName ) + { + return " drop constraint " + constraintName; + } + + /// <summary> /// The syntax used to add a primary key constraint to a table /// </summary> *************** *** 226,229 **** --- 238,265 ---- /// <summary> + /// The syntax used to drop a primary key constraint from a table. + /// </summary> + /// <param name="constraintName">The name of the primary key constraint to drop.</param> + /// <returns> + /// The SQL string to drop the primary key constraint. + /// </returns> + public virtual string GetDropPrimaryKeyConstraintString( string constraintName ) + { + return " drop constraint " + constraintName; + } + + /// <summary> + /// The syntax used to drop an index constraint from a table. + /// </summary> + /// <param name="constraintName">The name of the index constraint to drop.</param> + /// <returns> + /// The SQL string to drop the primary key constraint. + /// </returns> + public virtual string GetDropIndexConstraintString( string constraintName ) + { + return " drop constraint " + constraintName; + } + + /// <summary> /// The keyword used to specify a nullable column /// </summary> Index: MySQLDialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/MySQLDialect.cs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** MySQLDialect.cs 30 Jan 2005 19:39:11 -0000 1.25 --- MySQLDialect.cs 9 Feb 2005 03:09:38 -0000 1.26 *************** *** 80,89 **** /// <summary></summary> - public override bool DropConstraints - { - get { return false; } - } - - /// <summary></summary> public override bool QualifyIndexName { --- 80,83 ---- *************** *** 178,181 **** --- 172,205 ---- .ToString(); } + + /// <summary> + /// Create the SQL string to drop a foreign key constraint. + /// </summary> + /// <param name="constraintName">The name of the foreign key to drop.</param> + /// <returns>The SQL string to drop the foreign key constraint.</returns> + public override string GetDropForeignKeyConstraintString(string constraintName) + { + return " drop foreign key " + constraintName; + } + + /// <summary> + /// Create the SQL string to drop a primary key constraint. + /// </summary> + /// <param name="constraintName">The name of the primary key to drop.</param> + /// <returns>The SQL string to drop the primary key constraint.</returns> + public override string GetDropPrimaryKeyConstraintString(string constraintName) + { + return " drop primary key " + constraintName; + } + + /// <summary> + /// Create the SQL string to drop an index. + /// </summary> + /// <param name="constraintName">The name of the index to drop.</param> + /// <returns>The SQL string to drop the index constraint.</returns> + public override string GetDropIndexConstraintString(string constraintName) + { + return " drop index " + constraintName; + } } } \ No newline at end of file |
From: Donald L M. Jr. <lu...@us...> - 2005-02-08 19:15:15
|
Update of /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17703/src/Nullables.Tests Modified Files: NullableBooleanFixture.cs NullableByteFixture.cs NullableDateTimeFixture.cs NullableDecimalFixture.cs NullableDoubleFixture.cs NullableGuidFixture.cs NullableInt16Fixture.cs NullableInt32Fixture.cs NullableInt64Fixture.cs NullableSByteFixture.cs NullableSingleFixture.cs Log Message: Changed the behavior of Nullables.Value (getter) to throw an InvalidOperationException when there is no value (null). This was intended (but forgotten). Index: NullableBooleanFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableBooleanFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableBooleanFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableBooleanFixture.cs 8 Feb 2005 19:12:47 -0000 1.4 *************** *** 35,38 **** --- 35,46 ---- Assert.IsTrue( y.CompareTo( x ) > 0 ); } + + [Test, ExpectedException(typeof(InvalidOperationException))] + public void BooleanMissingValueTest() + { + NullableBoolean x = NullableBoolean.Default; + + bool y = x.Value; + } } } \ No newline at end of file Index: NullableGuidFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableGuidFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableGuidFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableGuidFixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void GuidMissingValueTest() + { + NullableGuid x = NullableGuid.Default; + + Guid y = x.Value; + } + [Test] public void GuidIComparableTest() Index: NullableDateTimeFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDateTimeFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDateTimeFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDateTimeFixture.cs 8 Feb 2005 19:12:48 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DateTimeMissingValueTest() + { + NullableDateTime x = NullableDateTime.Default; + + DateTime y = x.Value; + } + [Test] public void DateTimeIComparableTest() Index: NullableInt16Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt16Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt16Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt16Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int16MissingValueTest() + { + NullableInt16 x = NullableInt16.Default; + + Int16 y = x.Value; + } + [Test] public void Int16IComparableTest() Index: NullableDoubleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDoubleFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDoubleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDoubleFixture.cs 8 Feb 2005 19:12:52 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DoubleMissingValueTest() + { + NullableDouble x = NullableDouble.Default; + + double y = x.Value; + } + [Test] public void DoubleIComparableTest() Index: NullableInt64Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt64Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt64Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt64Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int64MissingValueTest() + { + NullableInt64 x = NullableInt64.Default; + + Int64 y = x.Value; + } + [Test] public void Int64IComparableTest() Index: NullableDecimalFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableDecimalFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableDecimalFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableDecimalFixture.cs 8 Feb 2005 19:12:50 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void DecimalMissingValueTest() + { + NullableDecimal x = NullableDecimal.Default; + + decimal y = x.Value; + } + [Test] public void DecimalIComparableTest() Index: NullableSByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSByteFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NullableSByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.2 --- NullableSByteFixture.cs 8 Feb 2005 19:12:53 -0000 1.3 *************** *** 46,49 **** --- 46,57 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void SByteMissingValueTest() + { + NullableSByte x = NullableSByte.Default; + + SByte y = x.Value; + } + [Test] public void SByteIComparableTest() Index: NullableSingleFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableSingleFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableSingleFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableSingleFixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void SingleMissingValueTest() + { + NullableSingle x = NullableSingle.Default; + + float y = x.Value; + } + [Test] public void SingleIComparableTest() Index: NullableByteFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableByteFixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableByteFixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableByteFixture.cs 8 Feb 2005 19:12:48 -0000 1.4 *************** *** 42,45 **** --- 42,53 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void ByteMissingValueTest() + { + NullableByte x = NullableByte.Default; + + byte y = x.Value; + } + [Test] public void ByteIComparableTest() Index: NullableInt32Fixture.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/Nullables.Tests/NullableInt32Fixture.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NullableInt32Fixture.cs 16 Dec 2004 15:26:13 -0000 1.3 --- NullableInt32Fixture.cs 8 Feb 2005 19:12:53 -0000 1.4 *************** *** 37,40 **** --- 37,41 ---- Assert.IsFalse( v2.HasValue ); + Assert.IsFalse( v2.Equals( 12 ) ); Assert.IsTrue( v2.Equals( NullableInt32.Default ) ); *************** *** 43,46 **** --- 44,55 ---- } + [Test, ExpectedException(typeof(InvalidOperationException))] + public void Int32MissingValueTest() + { + NullableInt32 x = NullableInt32.Default; + + int y = x.Value; + } + [Test] public void Int32IComparableTest() |