From: Paul H. <pha...@us...> - 2005-03-30 16:30:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21350/nhibernate/src/NHibernate Modified Files: IQuery.cs NHibernate-1.1.csproj nhibernate-mapping-2.0.xsd Added Files: NonUniqueResultException.cs Log Message: Implemented Copy, enhanced versioning, support named query/sql-query Index: IQuery.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/IQuery.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IQuery.cs 28 Jan 2005 13:33:56 -0000 1.14 --- IQuery.cs 30 Mar 2005 16:28:29 -0000 1.15 *************** *** 94,97 **** --- 94,105 ---- /// <summary> + /// Convenience method to return a single instance that matches + /// the query, or null if the query returns no results. + /// </summary> + /// <returns>the single result or <tt>null</tt></returns> + /// <remarks>throws HibernateException if there is more than one matching result</remarks> + object UniqueResult(); + + /// <summary> /// The maximum number of rows to retrieve /// </summary> Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** NHibernate-1.1.csproj 28 Mar 2005 12:45:57 -0000 1.78 --- NHibernate-1.1.csproj 30 Mar 2005 16:28:33 -0000 1.79 *************** *** 250,253 **** --- 250,258 ---- /> <File + RelPath = "NonUniqueResultException.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "ObjectDeletedException.cs" SubType = "Code" --- NEW FILE: NonUniqueResultException.cs --- using System; using System.Runtime.Serialization; using log4net; namespace NHibernate { /// <summary> /// Thrown when the application calls <tt>Query.uniqueResult()</tt> and /// the query returned more than one result. Unlike all other Hibernate /// exceptions, this one is recoverable! /// </summary> [Serializable] public class NonUniqueResultException : HibernateException { /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> public NonUniqueResultException() : this( 0 ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> /// <param name="resultCount">The number of items in the result.</param> public NonUniqueResultException( int resultCount ) : base( "query did not return a unique result: " + resultCount.ToString() ) { LogManager.GetLogger( typeof( NonUniqueResultException ) ).Error( "query did not return a unique result: " + resultCount.ToString(), this ); } /// <summary> /// Initializes a new instance of the <see cref="LazyInitializationException"/> class. /// </summary> /// <param name="innerException"> /// The exception that is the cause of the current exception. If the innerException parameter /// is not a null reference, the current exception is raised in a catch block that handles /// the inner exception. /// </param> public NonUniqueResultException( Exception innerException ) : base( "NHibernate non-unique result problem", innerException ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class. /// </summary> /// <param name="message">The message that describes the error. </param> /// <param name="innerException"> /// The exception that is the cause of the current exception. If the innerException parameter /// is not a null reference, the current exception is raised in a catch block that handles /// the inner exception. /// </param> public NonUniqueResultException( string message, Exception innerException ) : base( message, innerException ) { } /// <summary> /// Initializes a new instance of the <see cref="NonUniqueResultException"/> class /// with serialized data. /// </summary> /// <param name="info"> /// The <see cref="SerializationInfo"/> that holds the serialized object /// data about the exception being thrown. /// </param> /// <param name="context"> /// The <see cref="StreamingContext"/> that contains contextual information about the source or destination. /// </param> protected NonUniqueResultException( SerializationInfo info, StreamingContext context ) : base( info, context ) { } } } Index: nhibernate-mapping-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-mapping-2.0.xsd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** nhibernate-mapping-2.0.xsd 28 Mar 2005 10:13:56 -0000 1.12 --- nhibernate-mapping-2.0.xsd 30 Mar 2005 16:28:35 -0000 1.13 *************** *** 1,3 **** ! <xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:simpleType name="propertyAccess"> <xs:annotation> --- 1,3 ---- ! <xs:schema targetNamespace="urn:nhibernate-mapping-2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:nhibernate-mapping-2.0" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:simpleType name="propertyAccess"> <xs:annotation> *************** *** 90,94 **** <xs:element ref="joined-subclass"/> </xs:choice> ! <xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="schema" type="xs:string" use="optional"> --- 90,95 ---- <xs:element ref="joined-subclass"/> </xs:choice> ! <xs:element name="query" type="query" minOccurs="0" maxOccurs="unbounded"/> ! <xs:element name="sql-query" type="sql-query" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="schema" type="xs:string" use="optional"> *************** *** 248,251 **** --- 249,257 ---- <xs:attribute name="column" type="xs:string"/> <xs:attribute name="type" type="xs:string" default="Int32"/> + <xs:attribute name="unsaved-value" type="xs:string" default="null"> + <xs:annotation> + <xs:documentation>any|none|null|0|-1|... </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> *************** *** 258,261 **** --- 264,272 ---- <xs:attribute name="access" type="propertyAccess"/> <xs:attribute name="column" type="xs:string"/> + <xs:attribute name="unsaved-value" type="xs:string" default="null"> + <xs:annotation> + <xs:documentation>any|none|null|0|-1|... </xs:documentation> + </xs:annotation> + </xs:attribute> </xs:complexType> </xs:element> *************** *** 694,702 **** </xs:complexType> </xs:element> ! <xs:element name="query"> ! <xs:complexType mixed="true"> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> <xs:element name="list"> <xs:complexType> --- 705,731 ---- </xs:complexType> </xs:element> ! <xs:complexType name="query"> ! <xs:simpleContent> ! <xs:extension base="xs:string"> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:extension> ! </xs:simpleContent> ! </xs:complexType> ! <xs:complexType name="sql-query" mixed="true"> ! <xs:sequence> ! <xs:element name="return" maxOccurs="unbounded"> ! <xs:complexType> ! <xs:attribute name="alias" type="xs:string" use="required"/> ! <xs:attribute name="class" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> ! <xs:element name="synchronize" minOccurs="0" maxOccurs="unbounded"> ! <xs:complexType> ! <xs:attribute name="table" type="xs:string" use="required"/> ! </xs:complexType> ! </xs:element> ! </xs:sequence> ! <xs:attribute name="name" type="xs:string" use="required"/> ! </xs:complexType> <xs:element name="list"> <xs:complexType> |