Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8086 Modified Files: AtomsFramework.ndoc AtomsFramework.xml CAssociationKey.vb CAssociationTable.vb CCacheEntry.vb CClassMap.vb CColumnMap.vb CConnection.vb CCriteriaCondition.vb CCursor.vb CDatabaseMap.vb CInjectedObject.vb CJoin.vb CMultiRetrieveCriteria.vb CMultiSummaryCriteria.vb COID.vb COrderEntry.vb CPersistenceBroker.vb CPersistentCriteria.vb CPersistentObject.vb CRelationalDatabase.vb CResultset.vb CRetrieveCriteria.vb CSelectInCriteria.vb CSelectionCriteria.vb CSqlStatement.vb CSummaryCriteria.vb CTableMap.vb CUDAMap.vb CXMLConfigLoader.vb IPersistentObject.vb modAliasNull.vb modPersistenceBrokerSingleton.vb Log Message: More documentation updates Index: modAliasNull.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modAliasNull.vb,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- modAliasNull.vb 20 May 2005 06:03:42 -0000 1.9 +++ modAliasNull.vb 24 May 2005 07:43:44 -0000 1.10 @@ -29,25 +29,124 @@ ' 4-Usar "AliasToNull" cuando grabamos los datos del objeto a la base de datos '----------------------------------------------------------- - + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null Alias for Integers. + ''' </summary> + ''' <remarks>Value us -32767 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullInteger As Short = -32767 '-32768 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Longs + ''' </summary> + ''' <remarks>Value is -2147483647.0# (double) + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullLong As Double = -2147483647.0# '-2147483648# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Singles + ''' </summary> + ''' <remarks>Value is -3.402823E+38 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullSingle As Double = -3.402823E+38 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Doubles. + ''' </summary> + ''' <remarks>Value is -1.7976931348623E+308 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullDouble As Double = -1.7976931348623E+308 + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Currency. + ''' </summary> + ''' <remarks>Value is -922337203685477.0# + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullCurrency As Double = -922337203685477.0# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Strings. + ''' </summary> + ''' <remarks>Value is "" + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullString As String = "" + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Dates + ''' </summary> + ''' <remarks>Value is 1/1/0100 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullDate As Date = #1/1/0100# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Null alias for Bytes + ''' </summary> + ''' <remarks>Value is 0 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const NullByte As Short = 0 'Constantes para devolver DATE y NOW + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Default date value. + ''' </summary> + ''' <remarks>Value is 1/1/0101 + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const DefaultDate As Date = #1/1/0101# + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Constant. Default value for Now. + ''' </summary> + ''' <remarks>Value is 1/1/0101 1:01:01 AM + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Const DefaultNow As Date = #1/1/0101 1:01:01 AM# '''----------------------------------------------------------------------------- ''' <summary> ''' Check is a value should be mapped to a NULL. ''' </summary> - ''' <param name="InValue">The value to be checked</param> + ''' <param name="inValue">The value to be checked</param> ''' <returns>True if the object values is a NULL alias value</returns> ''' <remarks>Returns True is the value is an aliased null number. For example ''' if the value is a date of #01/01/100# the method will return true, whilst @@ -91,6 +190,17 @@ Return blnValue End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Replaces a NULL with a defined value (the aliased NULL value). + ''' </summary> + ''' <param name="inValue">The value to check</param> + ''' <param name="outValue">The returned value</param> + ''' <remarks>The the value is NULL (IsDBNull) then the appropriate aliased version is returned.</remarks> + ''' <history> + ''' [rbanks] 18/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Sub NullToAlias(ByVal inValue As Object, ByRef outValue As Object) Call NullToAlias(inValue, outValue, Nothing) End Sub @@ -107,9 +217,9 @@ ''' <summary> ''' Replaces a NULL with a defined value (the aliased NULL value). ''' </summary> - ''' <param name="InValue">The value to check</param> - ''' <param name="OutValue">The returned value</param> - ''' <param name="Override">A value to return if something other than the alias value should be returned.</param> + ''' <param name="inValue">The value to check</param> + ''' <param name="outValue">The returned value</param> + ''' <param name="override">A value to return if something other than the alias value should be returned.</param> ''' <remarks>The the value is NULL (IsDBNull) then the appropriate aliased version is returned. ''' If the override value was specified, then that value is returned instead.</remarks> ''' <history> @@ -157,6 +267,18 @@ outValue = vntOutValue End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Converts an Aliased Value to NULL + ''' </summary> + ''' <param name="inValue">The value to check</param> + ''' <returns>NULL if value is an alias for null, or the inValue</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function AliasToNull(ByVal inValue As Object) As Object Return AliasToNull(inValue, Nothing) End Function @@ -170,8 +292,8 @@ ''' <summary> ''' Converts an Aliased value to a NULL ''' </summary> - ''' <param name="InValue">The value to check</param> - ''' <param name="NullValue">The value to use for NULL (default is DBNull)</param> + ''' <param name="inValue">The value to check</param> + ''' <param name="nullValue">The value to use for NULL (default is DBNull)</param> ''' <returns>Either the InValue or a NULL</returns> ''' <remarks>If InValue is a NULL alias value then a proper DBNull is returned otherwise the ''' original value is returned.</remarks> @@ -218,7 +340,7 @@ ''' <summary> ''' Returns the number digits after the decimal point. ''' </summary> - ''' <param name="InNumber">The number to check.</param> + ''' <param name="inNumber">The number to check.</param> ''' <returns>The number of digits after the decimal.</returns> ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and @@ -250,7 +372,7 @@ ''' <summary> ''' Returns the number digits before the decimal point. ''' </summary> - ''' <param name="InNumber">The number to check.</param> + ''' <param name="inNumber">The number to check.</param> ''' <returns>The number of digits before the decimal.</returns> ''' <remarks>The calculation is based on a period (".") and will need ''' reworking in locales where the decimal is the thousands separator and Index: modPersistenceBrokerSingleton.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/modPersistenceBrokerSingleton.vb,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- modPersistenceBrokerSingleton.vb 20 May 2005 06:03:42 -0000 1.12 +++ modPersistenceBrokerSingleton.vb 24 May 2005 07:43:44 -0000 1.13 @@ -109,7 +109,7 @@ ''' <summary> ''' Gets a reference to the persistence broker. ''' </summary> - ''' <param name="xmlfile">The file name where the XML O/R mappings reside.</param> + ''' <param name="xmlFile">The file name where the XML O/R mappings reside.</param> ''' <returns>A reference to the persistence broker</returns> ''' <remarks>The existing persistence broker object is located. If no ''' configuration information has been loaded then the persistence broker Index: CPersistenceBroker.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistenceBroker.vb,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- CPersistenceBroker.vb 20 May 2005 06:03:40 -0000 1.110 +++ CPersistenceBroker.vb 24 May 2005 07:43:42 -0000 1.111 @@ -16,7 +16,7 @@ ''' The persistence broker provides the major functionality for the interaction of ''' objects with the database(s). ''' </summary> -''' <remarks></remarks> +''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -38,6 +38,20 @@ Private m_injectedObjects As New InjectedObjectCache Private m_objectsToDelete As New ArrayList + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Fires when the database mapping does not contain sufficient information to establish a connection + ''' ''' </summary> + ''' <param name="sender">The database that is attempting to create a connection</param> + ''' <param name="user">The user name to use</param> + ''' <param name="password">The password to use</param> + ''' <remarks>If the user and/or password is not supplied in the XML mapping file (for security reasons) this event must be + ''' handled by the application in order to establish a connection to the database. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Event LogOnDetailsNeeded(ByVal sender As Object, ByRef user As String, ByRef password As String) Private m_disposed As Boolean @@ -80,7 +94,7 @@ ''' The singleton instance of the persistence broker. ''' </summary> ''' <value>A reference to the singleton instance of the persistence broker.</value> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -158,6 +172,7 @@ ''' <param name="obj">The skeleton of the object to retrieve.</param> ''' <param name="useFind">Flag to indicate wether object retrieval should be based on the find attributes or key attributes.</param> ''' <param name="useCache">Flag to indicate wether the in-memory object cache should be checked.</param> + ''' <returns>Boolean indicating success or failure</returns> ''' <remarks>This method takes an object and uses the values contained in either ''' it's key attributes or it's find attributes to locate and retrieve data from the ''' database. @@ -1336,9 +1351,9 @@ ''' <summary> ''' Retrieves a ClassMap object by name. ''' </summary> - ''' <param name="ClassName">The name of the class map to retrieve.</param> + ''' <param name="className">The name of the class map to retrieve.</param> ''' <returns>A class map object if it exists, otherwise Nothing.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1349,6 +1364,17 @@ GetClassMap = ClassMap End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves a ClassMap object by name. + ''' </summary> + ''' <param name="inType">The class type of the class map to retrieve.</param> + ''' <returns>A class map object if it exists, otherwise Nothing.</returns> + ''' <remarks> </remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function GetClassMap(ByVal inType As Type) As ClassMap Dim ClassMap As ClassMap Dim tmpCMap As ClassMap @@ -1395,9 +1421,9 @@ ''' <summary> ''' Retrieves a IRelationalDatabase object by name ''' </summary> - ''' <param name="Name">The name of the database object to retrieve.</param> + ''' <param name="name">The name of the database object to retrieve.</param> ''' <returns>The database object, if it is in the Databases collection, otherwise Nothing.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1412,7 +1438,7 @@ ''' <summary> ''' Initialises the persistence broker. ''' </summary> - ''' <param name="xmlfile">The name of the XML file containing the object/database mappings.</param> + ''' <param name="xmlFile">The name of the XML file containing the object/database mappings.</param> ''' <remarks>This will create the persistence broker singleton object and ''' read the XMl mapping file to build all of the class, attribute, database and ''' association maps that will be used by the persistence broker. @@ -1453,7 +1479,7 @@ ''' <summary> ''' Initialises the persistence broker. ''' </summary> - ''' <param name="xmlfile">The XML file that contains the mappings.</param> + ''' <param name="xmlFile">The XML file that contains the mappings.</param> ''' <param name="useCache">Flag indicating wether the in-memory cache should ''' be used.</param> ''' <remarks>Calls the main init method and then specifically sets the usage of the @@ -1576,6 +1602,21 @@ Return ProcessRetrieveCriteria(clMap, criteria, fullObjects) End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Processes a selection criteria to retrieve multiple objects from the database. + ''' </summary> + ''' <param name="classMap">A class map to process.</param> + ''' <param name="criteria">The selection criteria to use.</param> + ''' <param name="fullObjects">Flag indicating wether proxy objects or full objects are to be retrieved.</param> + ''' <returns>A ResultCursor object referencing the retrieved data.</returns> + ''' <remarks>Generates the SQL statement required to retrieve the data from the + ''' database and populates a ResultCursor object. The ResultCursor object is used by the + ''' application to actually instantiate the objects.</remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function ProcessRetrieveCriteria(ByRef classMap As ClassMap, ByRef criteria As RetrieveCriteria, ByVal fullObjects As Boolean) As ResultCursor Dim conn As IConnection Dim cursor As ResultCursor @@ -1716,7 +1757,7 @@ ''' <param name="criteria">Criteria to use for retrieval.</param> ''' <param name="fullObjects">Flag indicating wether full objects or proxy objects should be returned.</param> ''' <returns>A ResultCursor containing data from the database.</returns> - ''' <remarks></remarks> + ''' <remarks> </remarks> ''' <history> ''' [rbanks] 16/12/2003 Created ''' </history> @@ -1894,7 +1935,7 @@ ''' <summary> ''' Method to allow SQL statements based on objects and attributes to be processed. ''' </summary> - ''' <param name="inSQL">The SQL statement to be processed.</param> + ''' <param name="inSql">The SQL statement to be processed.</param> ''' <returns>A ResultCursor containing the data from the query.</returns> ''' <remarks>The SQL statement that is passed in should not use any table or field ''' names, but rather should be based on classes and attributes. Eg "Select Ccustomer.Name from CCustomer". @@ -2036,6 +2077,20 @@ End Function + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Method to allow SQL statements to be processed directly. + ''' </summary> + ''' <param name="inSql">The SQL statement to be processed.</param> + ''' <param name="connection">The connection to use for execution</param> + ''' <returns>A ResultCursor containing the data from the query.</returns> + ''' <remarks>The SQL statement that is passed in will be executed with no interpretation. + ''' <para>Use of this method is not recommended for normal operations, however some + ''' circumstances may require it.</para></remarks> + ''' <history> + ''' [rbanks] 16/12/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Public Function ProcessPureSql(ByVal inSql As String, ByVal connection As IConnection) As ResultCursor Dim statement As New AtomsSqlStatement statement.SqlString = inSql @@ -2086,9 +2141,11 @@ ''' <summary> ''' Initiates a transaction on all database connections using the specified isolation level. ''' </summary> + ''' <param name="isolationLevel">The isolation level for the transaction</param> ''' <remarks>This function initiates a transaction on all databases defined ''' in the mapping file. Transactions commenced in this manner must be completed using ''' the matching commit/rollback functions from the persistence broker. + ''' <para>Use the isolation level for pessimistic locking if required</para> ''' </remarks> ''' <history> ''' [rbanks] 20/01/2004 Created @@ -2580,7 +2637,7 @@ ''' </summary> ''' <param name="obj">The obj to check</param> ''' <param name="includeBaseObject">Indicates is obj is included in the returned stack</param> - ''' <param name="checkAssociationsRecursivly">Indicates whether to check if all associations needs saving + ''' <param name="checkAssociationsRecursively">Indicates whether to check if all associations needs saving ''' if obj is not dirty</param> ''' <returns>Stack. The all the objects that needs to be saved.</returns> ''' <remarks> The function traverse the all associated objects and checks whether it needs saving. @@ -2811,7 +2868,7 @@ ''' Function to get all objects to save. Includes checks of associated objects. ''' </summary> ''' <param name="obj">The object to checl</param> - ''' <param name="checkAssociationsRecursivly">Boolean indicating whether associations + ''' <param name="checkAssociationsRecursively">Boolean indicating whether associations ''' should be checked.</param> ''' <returns>Queue. The all the objects that need to be saved.</returns> ''' <remarks>The function traverses all associated objects and checks whether they need saving. @@ -2825,28 +2882,104 @@ Return GetObjectsToSave(obj, True, checkAssociationsRecursively) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Fires the LogOnDetailsNeeded event with the specified paraneters. + ''' </summary> + ''' <param name="sender">The database that needs the logon values</param> + ''' <param name="user">A reference to the user property</param> + ''' <param name="password">A reference to the password property</param> + ''' <remarks>Fires the event and updates the user and password properties. If there are no listeners to the event nothing happens. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetLogOnDetails(ByVal sender As IRelationalDatabase, ByRef user As String, ByRef password As String) RaiseEvent LogOnDetailsNeeded(sender, user, password) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Initialise a transaction on the cache. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on.</param> + ''' <remarks>All objects in the cache for the specified database are copied. This provides a rollback point should the transaction be + ''' aborted. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub StartCacheTransaction(ByVal db As IRelationalDatabase) m_cache.StartTransaction(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits the changes in a transaction on the cache. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on.</param> + ''' <remarks>Since objects are updated in the cache as the transaction progresses this method does very little other than change + ''' state for new objects, and removed objects marked as deleted. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub CommitCache(ByVal db As IRelationalDatabase) m_cache.CommitChanges(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Returns the cache to it's pre-transaction state. + ''' </summary> + ''' <param name="db">The database the transaction is being performed on</param> + ''' <remarks>Restores the copies of the objects made at the start of the transaction. Only objects belonging to the specified + ''' database are restored. Any objects added to the cache during the transaction are removed, and any obejcts removed from the cache are + ''' restored. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub RollbackCache(ByVal db As IRelationalDatabase) m_cache.AbortChanges(db) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Executes a stored procedure on the database. + ''' </summary> + ''' <param name="databaseName">The name of the database to execute the procedure on.</param> + ''' <param name="sqlString">The name of the stored procedure.</param> + ''' <returns>A ResultCursor with the results of the execution</returns> + ''' <remarks>Parameter passing is not supported with this method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ProcessStoredProcedure(ByVal databaseName As String, ByVal sqlString As String) As ResultCursor Dim db As IRelationalDatabase db = GetRelationalDatabase(databaseName) Return ProcessStoredProcedure(db, sqlString) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Executes a stored procedure on the database. + ''' </summary> + ''' <param name="database">Thedatabase to execute the procedure on.</param> + ''' <param name="sqlString">The name of the stored procedure.</param> + ''' <returns>A ResultCursor with the results of the execution</returns> + ''' <remarks>Parameter passing is not supported with this method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ProcessStoredProcedure(ByVal database As IRelationalDatabase, ByVal sqlString As String) As ResultCursor Dim cursor As New ResultCursor Dim st As New AtomsSqlStatement @@ -2863,6 +2996,16 @@ Return cursor End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Disposes of the PersistenceBroker. + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Overloads Sub Dispose() Implements System.IDisposable.Dispose Dispose(True) GC.SuppressFinalize(Me) @@ -2870,8 +3013,9 @@ '''----------------------------------------------------------------------------- ''' <summary> - ''' Disposed of an instance of the PersistenceBroker class. + ''' Disposes of an instance of the PersistenceBroker class. ''' </summary> + ''' <param name="disposing"> </param> ''' <remarks>Clears all of the collections and the in-memory cache, regardless ''' of wether it was used or not.</remarks> ''' <history> @@ -2930,6 +3074,16 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' + ''' </summary> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Protected Overrides Sub Finalize() ' Simply call Dispose(False). Dispose(False) @@ -2942,6 +3096,16 @@ End Get End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Clears the cache. + ''' </summary> + ''' <remarks>Clears all entries from the cache, regardless of their current state. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub ClearCache() m_cache.Clear() Try @@ -2950,10 +3114,36 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves an object. + ''' </summary> + ''' <param name="obj">An object to retrieve</param> + ''' <remarks>Do not use this method with PersistentObject based classes - use the Retrieve/Find methods. + ''' <para>This method will attempt to retrieve an object using the primary key values in much the same way as the PersistentObject.Retrieve method works</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetObject(ByRef obj As Object) GetObject(obj, True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Retrieves an object. + ''' </summary> + ''' <param name="obj">An object to retrieve</param> + ''' <param name="useCache">Flag to control cache behavour</param> + ''' <remarks>Do not use this method with PersistentObject based classes - use the Retrieve/Find methods. + ''' <para>This method will attempt to retrieve an object using the primary key values in much the same way as the PersistentObject.Retrieve method works</para> + ''' <para>If the useCache flag is off, the cache is not checked and the object is read directly from the database.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub GetObject(ByRef obj As Object, ByVal useCache As Boolean) Dim injObj As InjectedObject injObj = LocateOrCacheInjObject(obj, False, True) @@ -3005,14 +3195,57 @@ obj = injObj.GetSourceObject End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets an InjectedObject from the injection cache. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <returns>An injected object if the object is found. Otherwise null.</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetInjectedObject(ByVal obj As Object) As InjectedObject Return LocateOrCacheInjObject(obj, False, False) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Gets an InjectedObject from the injection cache. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <param name="createTemporary">Flag to create a temporary InjectedObject if the object is not found</param> + ''' <returns>An injected object if the object is found.</returns> + ''' <remarks>If the object cannot be found and createTemporary is True a new InjectedObject is created for the passed in obj Object. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function GetInjectedObject(ByVal obj As Object, ByVal createTemporary As Boolean) As InjectedObject Return LocateOrCacheInjObject(obj, True, createTemporary) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Locates and object in the Injection cache, or adds the object to the cache if it is not present. + ''' </summary> + ''' <param name="obj">The object to locate.</param> + ''' <param name="replaceCachedValues">Flag to control what happens when the object exists.</param> + ''' <param name="addToCache">Flag to control wether a new object should be added to the cache.</param> + ''' <returns>The InjectedObject (if found) or nothing.</returns> + ''' <remarks>This method is used in multiple ways. Primarily it used to check for the existence of the obj Object in the cache. If it is + ''' not found the object can be optionally added to the cache for future use. + ''' <para>If the object is found then the cache copy of the object can (optionally) have its values updated with the values from + ''' the passed in obj Object.</para> + ''' <para>It is not recommended that this method be used directly by your code</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function LocateOrCacheInjObject(ByVal obj As Object, ByVal replaceCachedValues As Boolean, ByVal addToCache As Boolean) As InjectedObject Dim injObj As InjectedObject injObj = m_injectedObjects.Find(obj) @@ -3040,15 +3273,50 @@ Return injObj End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if an object is beign tracked in the Injection cache. + ''' </summary> + ''' <param name="obj">The object to check</param> + ''' <returns>Boolean indicating status</returns> + ''' <remarks>Checks if the object is in the injection cache or not. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Function ObjectIsTracked(ByVal obj) As Boolean Debug.WriteLine(m_injectedObjects) Return m_injectedObjects.IsTracked(obj) End Function + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Marks an object for deletion. + ''' </summary> + ''' <param name="obj">The object to delete.</param> + ''' <remarks>The object is not actually deleted, just flagged for deletion. The object will only be deleted when the PersistChanges method is called. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub MarkForDeletion(ByVal obj As Object) MarkForDeletion(obj, False) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Marks an object for deletion. + ''' </summary> + ''' <param name="obj">The object to delete.</param> + ''' <param name="deleteParents">Delete the objects parents as well</param> + ''' <remarks>The object is not actually deleted, just flagged for deletion. The object will only be deleted when the PersistChanges method is called. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub MarkForDeletion(ByVal obj As Object, ByVal deleteParents As Boolean) Dim injObj As InjectedObject injObj = m_injectedObjects.Find(obj) @@ -3060,10 +3328,32 @@ End If End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits all object changes for every object in the Injection Cache. + ''' </summary> + ''' <remarks>All objects in the injection cache are saved or deleted (depending on status). + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges() PersistChanges(True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Commits all object changes for every object in the Injection Cache. + ''' </summary> + ''' <param name="checkAssociationsRecursively">Save the associated objects even if the main object hasn't changed</param> + ''' <remarks>All objects in the injection cache are saved or deleted (depending on status). + ''' <para>Objects to be saved are processed first, and then objects to be deleted are processed. All changes are performed in a single transaction</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal checkAssociationsRecursively As Boolean) Me.StartTransaction() Try @@ -3106,10 +3396,36 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Persist the changes for a single object + ''' </summary> + ''' <param name="obj">The object to process</param> + ''' <remarks>obj must be an InjectedObject. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal obj As Object) PersistChanges(obj, True) End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Persist teh changes for a single object + ''' </summary> + ''' <param name="obj">The object to process</param> + ''' <param name="checkAssociationsRecursively">Check the objects associations</param> + ''' <remarks>The obj object should not inherit from the PersistentObject class. + ''' <para>Any changes to the object are persisted (including deletion). If the object is unchanged associated object will be checked only + ''' if the checkAssociationsRecursively flag is set</para> + ''' </remarks> + ''' <exception name="AtomsFramework.SaveException">obj inherits from PersistentObject or implements IPersistentObject</exception> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Sub PersistChanges(ByVal obj As Object, ByVal checkAssociationsRecursively As Boolean) Dim value As IPersistableObject Dim q As Queue @@ -3313,6 +3629,22 @@ End Try End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies the collections of one object to another. + ''' </summary> + ''' <param name="source">The object to copy collections from.</param> + ''' <param name="target">The object to copy collections to.</param> + ''' <remarks>The two objects must be of the same type. + ''' <para>Only IList or IDictionary based collections are copied. If the collection supports the clone interface then the clone method is used + ''' to copy the collection, otherwise the collections are copied one element at a time.</para> + ''' <para>This is a one-level deep copy of the collection, objects referenced in the source collection are copied to new objects and + ''' added to the target collection. Event listeners attached to the first collection are also wired up to the new collection.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public Shared Sub CopyCollections(ByVal source As Object, ByRef target As Object) Dim t, t1, iListType, iDicType As Type Dim fromColl, toColl, collItem As Object @@ -3532,6 +3864,17 @@ obj = injObj.GetSourceObject End Sub + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Provides direct access to the cache. + ''' </summary> + ''' <value> </value> + ''' <remarks>Should really only be used for debugging purposes, but you never know - you may have a better use for it. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Public ReadOnly Property Cache() As CacheEntryDictionary Get Return m_cache Index: IPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/IPersistentObject.vb,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- IPersistentObject.vb 11 Apr 2005 00:31:44 -0000 1.15 +++ IPersistentObject.vb 24 May 2005 07:43:44 -0000 1.16 @@ -1,84 +1,906 @@ +''' ----------------------------------------------------------------------------- +''' <summary> +''' Base interface for persistable objects. +''' </summary> +''' <value> </value> +''' <remarks>This interface represents the core functionality that must be provided by each of the persistable object classes used internall +''' in the framework. That is, both the PersistentObject class and the InjectedObject class implement this interface. +''' <para>It is possible to implement this interface in your own classes but it is not recommended and there may be other problems</para> +''' </remarks> +''' <history> +''' [rbanks] 24/05/2005 Created +''' </history> +''' ----------------------------------------------------------------------------- Public Interface IPersistableObject + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating wether the object is persistent or not + ''' </summary> + ''' <value>Boolean indicating if the object is persistent</value> + ''' <remarks>Objects that are retrieved from the persistent broker are either + ''' marked as persistent or not. If the object was successfully retrieved using values from the + ''' database then the object will be marked as persistent. If no relevant database records + ''' could be found the object is instantiated, but marked as non persistent. + ''' <para>An new object that is created is initially marked as non-persistent, however + ''' once the object is successfully saved to the database it will be marked as + ''' persistent</para> + ''' <para>Setting this value manually is not recommended and can result in unexpected behaviour</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property Persistent() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if the all atributes are populated or only those marked as proxy attributes + ''' </summary> + ''' <value>Boolean indicating only proxy attributes are populated</value> + ''' <remarks>When an object is retrieved via a ResultCursor the returned object can either + ''' be a proxy object or a full object. This behaviour is determined by the ResultCursor. + ''' <para>If the ResultCursor returns proxy objects, only information related to the proxy + ''' attributes will be returned and only a partially populated object can be + ''' instantiated. The proxy flag will be set to indicate to the application that the + ''' object is not complete, and also to prevent the framework from performing any + ''' persistence operations such as save and delete.</para> + ''' <para>Once a proxy object is fully retrieved the proxy flag will be turned off and + ''' normal object operations can be performed</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property IsProxy() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating that the object has been modified + ''' </summary> + ''' <value>Boolean indicating that the object has been modified</value> + ''' <remarks>This flag must be set by the object whenever one of it's properties changes. + ''' Failing to do so will prevent the AtomsFramework from updating the database when + ''' the save method is performed. + ''' <para>When an object is initially received this flag will be False.</para> + ''' <para>Note: Changes to objects in a PersistentObjectCollection can result in this flag being set.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property IsDirty() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The minimum time (in minutes) that the object will remain in the cache before it is + ''' re-read from the database. + ''' </summary> + ''' <value>The expiry time period in minutes</value> + ''' <remarks>When an object is initially retrieved it is typically stored in the + ''' local object cache. Each object has a default expiry time of 30 minutes. During this + ''' time any attempts to retrieve the object will result in the cached copy being returned + ''' instead of the database being hit. + ''' <para>For some objects the 30 minute interval is too long or too short. By setting + ''' this value you can control when the cached version of the object will expire and + ''' thus force the database to be queried the next time the object is retrieved.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property ExpiryInterval() As Double + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The ObjectID of the current object + ''' </summary> + ''' <value>The text representation of the object's OID</value> + ''' <remarks>Each object has an object ID regardless of wether those OID's are + ''' actually used in the database or not. This property will return the current + ''' OID value for the object. + ''' <para>If the object is persistent and OID's are used in the database the property + ''' will be the current OID value of the object. If the object is not persistent then + ''' the OID Value will be generated automatically.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property OidValue() As String + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The GUID (Globally Unique Identifier) of the current object + ''' </summary> + ''' <value>The string representation of the object's GUID</value> + ''' <remarks>Each object has a GUID regardless of wether GUIDs are + ''' actually used in the database or not. This property will return the current + ''' GUID as a string. + ''' <para>If the object is persistent and GUIDs are used in the database the property + ''' will be the current GUID value of the object. If the object is not persistent then + ''' the GUID Value will be generated automatically.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property GuidValue() As String + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag indicating that an objects AutoRetrieve associations have been retrieved. + ''' </summary> + ''' <value>Boolean indicating that associations have been retrieved</value> + ''' <remarks>If this flag is set then the object has been retrieved and all associations + ''' marked as AutoRetrieve-"true" have been processed and retrieved. + ''' <para>This flag is only used internally bu the framework and it should not be set manually.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Property AssociationsLoaded() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates if the object is currently being loaded by the persistence broker. + ''' </summary> + ''' <returns>Boolean indicating if the object is currently loading</returns> + ''' <remarks>When the persistence broker loads an object this flag will be set to + ''' indicate the object is currently loading. This flag can then be used inside + ''' subclasses to adjust behaviour accordingly. + ''' </remarks> + ''' <history> + ''' [rbanks] 16/08/2004 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property IsLoading() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indictaes if the object has been queued for saving + ''' </summary> + ''' <value> </value> + ''' <remarks>During the saving of objects using the PersistenceBroker.PersistChanges method objects are added to a + ''' queue for saving. Since it is possible that there are circular references in the object hierarchy this flag is used to prevent + ''' an object being added multiple times, and to help prevent infinite loops. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property IsQueued() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag to indicate if the object is read only. + ''' </summary> + ''' <value>Boolean indicating whether the object is read only or not.</value> + ''' <remarks>Objects that are read only can still be modified by the application + ''' however when any of the persistence methods are called (such as save and delete) + ''' an exception will be thrown indicating that the object is read only. + ''' <para>Read only objects are typically used to map database views.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- ReadOnly Property IsReadOnly() As Boolean + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Flag to indicate that objects cannot be created or deleted. + ''' </summary> + ''' <value>Boolean to indicate wether the object only permits modification.</value> + ''' <remarks>When this flag is on it indicates that the persistent object is only + ''' able to be modified. Any attempt to delete or save a newly created object will + ''' result in an exception being thrown. + ''' <para>This flag is different to the isReadOnly property in that it also allows + ''' an object to be changed.</para> + ''' <para>Typical uses include mapping an object to a view that also permits updates + ''' to occur, but for which creation and deletion of records is not permitted.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- ReadOnly Property IsModifyOnly() As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' A CacheKey object used to hold the original key values for an object + ''' </summary> + ''' <value> </value> + ''' <remarks>After an object is retrieved it is possible for the key values of the object to be modified. If this occurs, we + ''' need a way to store the original values so that SQL update statements can correctly populate the values for the where clause. + ''' This property is used to store and retrieve those values. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property OriginalCacheKey() As CacheKey + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' The PesistenceState of the object + ''' </summary> + ''' <value> </value> + ''' <remarks>A simple indication of wether an object is known to be persistent + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Property State() As PersistenceState + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the class map for an object + ''' </summary> + ''' <returns>A ClassMap object for calling object</returns> + ''' <remarks>Returns the class map of the calling object. If no class map can + ''' be found an exception is thrown.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetClassMap() As ClassMap + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the length of a mapped attribute in the database + ''' </summary> + ''' <param name="propertyName">The name of the attribute to examine</param> + ''' <returns>The length of the mapped field</returns> + ''' <remarks>Returns the length of the field in the database that an attribute + ''' is mapped to. For numeric fields the length will be the storage size, and for + ''' string fields the length will be the maximum length permitted by the database. + ''' </remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetFieldLengthByName(ByVal propertyName As String) As Integer + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets the database type of a mapped attribute + ''' </summary> + ''' <param name="propertyName">The name of the attribute to examine</param> + ''' <returns>The type of the mapped field</returns> + ''' <remarks>Returns the type of the field that the named attribute maps to.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetFieldTypeByName(ByVal propertyName As String) As Type + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Gets a PersistentObjectCollection from an object attribute by name + ''' </summary> + ''' <param name="name">The name of the attribute referencing a PersistentObjectCollection</param> + ''' <returns>A PersistentObjectCollection object</returns> + ''' <remarks>Returns a PersistentObjectCollection object from the named attribute in the object. If there + ''' is an error an exception will be thrown.</remarks> + ''' <history> + ''' [rbanks] 26/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetCollectionByAttribute(ByVal name As String) As IList + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Returns a persistent object using a named attribute. + ''' </summary> + ''' <param name="name">The attribute name that stores a reference to a persistent object</param> + ''' <returns>A persistent object (PersistentObject)</returns> + ''' <remarks>If the attribute does not reference a PersistentObject then a type mismatch + ''' exception will be thrown. + ''' <para>Internal use only.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetObjectByAttribute(ByVal name As String) As IPersistableObject + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Returns the value of any attribute in the object + ''' </summary> + ''' <param name="name">The name of the attribute being queried. Case sensitive.</param> + ''' <returns>The value of the attribute as an Object.</returns> + ''' <remarks>The name of the attribute can be specified as a direct property name or it can + ''' be a period separated path name such as <c>ObjectAttribute.SubAttribute</c> + ''' <para>This is primarily for internal use only</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Function GetValueByAttribute(ByVal name As String) As Object + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Set the value of any attribute in an object. + ''' </summary> + ''' <param name="name">The name of the attribute to modify. Case sensitive.</param> + ''' <param name="value">The value to apply to the attribute</param> + ''' <remarks>Sets the value of any attribute in an object based on the name of the attribute. + ''' <para>Most atomic types are supported and any unsupported types will result + ''' in an exception being thrown.</para> + ''' <para>This is primarily for internal use but can be useful in some application instances</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- Sub SetAttributeValue(ByVal name As String, ByRef value As Object) + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Returns a collection of objects that have been removed from a property since the object was retrieved. + ''' </summary> + ''' <param name="propertyName">The property to check.</param> + ''' <returns>A collection containing the objects that have been removed from the collection</returns> + ''' <remarks>The propertyName must be the name of an IList or IDictionary based property otherwise an exception is likely to + ''' be thrown. + ''' <para>This function is used to determine what objects have been removed since an object was retrieved. The implementation should + ''' be based on a comparison of the original collection and the current collection.</para> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function GetRemovedCollectionItems(ByVal propertyName As String) As Collection + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Copies collections used in One-To-Many associations. + ''' </summary> + ''' <remarks>This Method is called by the framework after an object has been retrieved so that there is an original starting point + ''' for data for the GetRemovedCollectionItems method. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Sub CopyOneToManyCollections() + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Obtains the type of the current source object + ''' </summary> + ''' <returns>A Type object</returns> + ''' <remarks>This will get the Type of the referenced/source object. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function GetObjectType() As Type + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Determines if another object is equivalent to the current object. + ''' </summary> + ''' <param name="obj">The object to compare with</param> + ''' <returns>A boolean indicating equality</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function Equals(ByVal obj As IPersistableObject) As Boolean + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Make a copy of the current object + ''' </summary> + ''' <returns>A value copy of the current object</returns> + ''' <remarks> + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Function Copy() As IPersistableObject + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Replaces member values of the current object with values from the supplied object + ''' </summary> + ''' <param name="obj">The object to copy from</param> + ''' <param name="copyEventHandlers">Copy eventHandlers or not</param> + ''' <remarks>Both objects must be of the same type. All public and private member values are copied. + ''' </remarks> + ''' <history> + ''' [rbanks] 24/05/2005 Created + ''' </history> + ''' ----------------------------------------------------------------------------- Sub ReplaceWith(ByVal obj As IPersistableObject, ByVal copyEventHandlers As Boolean) + '''----------------------------------------------------------------------------- + ''' <summary> + ''' Get an object by a class map + ''' </summary> + ''' <param name="classMap">The class map to get</param> + ''' <returns>PersistentObject The object.</returns> + ''' <remarks>The method creates an object based on the class m... [truncated message content] |