From: Richard B. <rb...@us...> - 2004-10-13 01:36:47
|
Update of /cvsroot/jcframework/dotnet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29501 Modified Files: AToMSFramework.vbproj CPersistentObject.vb Added Files: IPersistentObject.vb Log Message: Added interface to CPersistentObject (called IPersistentObject) to allow other interfaces to inherit the persistence functions. Index: AToMSFramework.vbproj =================================================================== RCS file: /cvsroot/jcframework/dotnet/AToMSFramework.vbproj,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- AToMSFramework.vbproj 27 Sep 2004 02:39:31 -0000 1.16 +++ AToMSFramework.vbproj 13 Oct 2004 01:36:34 -0000 1.17 @@ -359,6 +359,11 @@ BuildAction = "Compile" /> <File + RelPath = "IPersistentObject.vb" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "modAliasNull.vb" SubType = "Code" BuildAction = "Compile" --- NEW FILE: IPersistentObject.vb --- Public Interface IPersistentObject Property Persistent() As Boolean Property IsProxy() As Boolean Property IsDirty() As Boolean Property ExpiryInterval() As Double Property OIDValue() As String Property GUIDValue() As String Property CreatedDate() As Date Property ModifiedDate() As Date Property AssociationsLoaded() As Boolean Property IsLoading() As Boolean ReadOnly Property isReadOnly() As Boolean ReadOnly Property isModifyOnly() As Boolean Function Retrieve() As Boolean Function Retrieve(ByRef obj As CPersistentObject) As Boolean Function Retrieve(ByRef obj As CPersistentObject, ByVal usecache As Boolean) As Boolean Function Find() As Boolean Function Find(ByRef obj As CPersistentObject) As Boolean Function Find(ByRef obj As CPersistentObject, ByVal usecache As Boolean) As Boolean Sub Save() Sub Save(ByVal checkAssociationsRecursively As Boolean) Sub Save(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) Sub Delete() Sub Delete(ByVal deleteSuperClass As Boolean) Sub Delete(ByVal obj As CPersistentObject) Sub Delete(ByVal obj As CPersistentObject, ByVal deleteSuperClass As Boolean) Sub DeleteAll() Function Copy() As CPersistentObject Function IsValid() As Boolean Function IsReferenced() As Boolean Function getNewObject() As CPersistentObject Function getClassMap() As CClassMap Function getFieldLengthByName(ByVal x As String) As Integer Function getFieldTypeByName(ByVal x As String) As Type Event MarkedAsDirty As EventHandler Event LoadStarted As EventHandler Event LoadFinished As EventHandler End Interface Index: CPersistentObject.vb =================================================================== RCS file: /cvsroot/jcframework/dotnet/CPersistentObject.vb,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- CPersistentObject.vb 11 Oct 2004 22:50:56 -0000 1.39 +++ CPersistentObject.vb 13 Oct 2004 01:36:35 -0000 1.40 @@ -26,6 +26,7 @@ Implements IComponent Implements IEditableObject Implements IDataErrorInfo + Implements IPersistentObject Private m_persistent As Boolean Private m_proxy As Boolean @@ -44,9 +45,9 @@ Private m_editing As Boolean <NonSerialized()> Private m_classmap As CClassMap - Public Event MarkedAsDirty As EventHandler - Public Event LoadStarted As EventHandler - Public Event LoadFinished As EventHandler + Public Event MarkedAsDirty As EventHandler Implements IPersistentObject.MarkedAsDirty + Public Event LoadStarted As EventHandler Implements IPersistentObject.LoadStarted + Public Event LoadFinished As EventHandler Implements IPersistentObject.LoadFinished Friend Event RemoveMe(ByVal pObj As CPersistentObject) <NonSerialized()> Private m_preEditCopy As CPersistentObject @@ -67,291 +68,291 @@ ''' [rbanks] 25/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - <Browsable(False)> Public ReadOnly Property isReadOnly() As Boolean - Get - Return getClassMap(Me).isReadOnly - End Get - End Property + <Browsable(False)> Public ReadOnly Property isReadOnly() As Boolean Implements IPersistentObject.isReadOnly + Get + Return getClassMap(Me).isReadOnly + End Get + End Property - '''----------------------------------------------------------------------------- - ''' <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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public ReadOnly Property isModifyOnly() As Boolean - Get - Return getClassMap(Me).isModifyOnly - End Get - End Property + '''----------------------------------------------------------------------------- + ''' <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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public ReadOnly Property isModifyOnly() As Boolean Implements IPersistentObject.isModifyOnly + Get + Return getClassMap(Me).isModifyOnly + End Get + End Property - '''----------------------------------------------------------------------------- - ''' <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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property Persistent() As Boolean - Get - Persistent = m_persistent - End Get - Set(ByVal Value As Boolean) - m_persistent = Value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property Persistent() As Boolean Implements IPersistentObject.Persistent + Get + Persistent = m_persistent + End Get + Set(ByVal Value As Boolean) + m_persistent = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <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 CCursor the returned object can either - ''' be a proxy object or a full object. This behaviour is determined by the CCursor. - ''' <para>If the CCursor 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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property IsProxy() As Boolean - Get - IsProxy = m_proxy - End Get - Set(ByVal Value As Boolean) - m_proxy = Value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <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 CCursor the returned object can either + ''' be a proxy object or a full object. This behaviour is determined by the CCursor. + ''' <para>If the CCursor 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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property IsProxy() As Boolean Implements IPersistentObject.IsProxy + Get + IsProxy = m_proxy + End Get + Set(ByVal Value As Boolean) + m_proxy = Value + End Set + End Property - ''' ----------------------------------------------------------------------------- - ''' <summary> - ''' Indicates wether the persistence broker is currently checking the objects associations - ''' </summary> - ''' <returns>Boolean indicating whether the check is currently in progress</returns> - ''' <remarks>When an object is retrieved it's associations must be checked to determine - ''' if they are instantiated or not. This flag indicates wether the check - ''' is in progress or not. - ''' </remarks> - ''' <history> - ''' [rbanks] 16/08/2004 Created - ''' </history> - ''' ----------------------------------------------------------------------------- - <Browsable(False)> Friend Property CheckingAssociations() As Boolean - Get - Return m_checkingAssociations - End Get - Set(ByVal Value As Boolean) - m_checkingAssociations = Value - End Set - End Property + ''' ----------------------------------------------------------------------------- + ''' <summary> + ''' Indicates wether the persistence broker is currently checking the objects associations + ''' </summary> + ''' <returns>Boolean indicating whether the check is currently in progress</returns> + ''' <remarks>When an object is retrieved it's associations must be checked to determine + ''' if they are instantiated or not. This flag indicates wether the check + ''' is in progress or not. + ''' </remarks> + ''' <history> + ''' [rbanks] 16/08/2004 Created + ''' </history> + ''' ----------------------------------------------------------------------------- + <Browsable(False)> Friend Property CheckingAssociations() As Boolean + Get + Return m_checkingAssociations + End Get + Set(ByVal Value As Boolean) + m_checkingAssociations = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <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 CPersistentCollection can result in this flag being set.</para></remarks> - ''' <history> - ''' [rbanks] 25/11/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property IsDirty() As Boolean - Get - IsDirty = m_dirty - End Get - Set(ByVal Value As Boolean) - If Value = True Then - m_modifiedDate = Now 'Set modified date - 'Set milliseconds to zero to avoid issues with millisecond inconsistencies in SQL db's - m_modifiedDate = m_modifiedDate.AddMilliseconds(-m_modifiedDate.Millisecond) - If m_dirty = False Then - RaiseEvent MarkedAsDirty(Me, New EventArgs) - End If - End If - m_dirty = Value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <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 CPersistentCollection can result in this flag being set.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property IsDirty() As Boolean Implements IPersistentObject.IsDirty + Get + IsDirty = m_dirty + End Get + Set(ByVal Value As Boolean) + If Value = True Then + m_modifiedDate = Now 'Set modified date + 'Set milliseconds to zero to avoid issues with millisecond inconsistencies in SQL db's + m_modifiedDate = m_modifiedDate.AddMilliseconds(-m_modifiedDate.Millisecond) + If m_dirty = False Then + RaiseEvent MarkedAsDirty(Me, New EventArgs) + End If + End If + m_dirty = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <summary> - ''' The 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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property ExpiryInterval() As Double - Get - Return m_cacheExpiry - End Get - Set(ByVal Value As Double) - m_cacheExpiry = Value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The 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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property ExpiryInterval() As Double Implements IPersistentObject.ExpiryInterval + Get + Return m_cacheExpiry + End Get + Set(ByVal Value As Double) + m_cacheExpiry = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property OIDValue() As String - Get - Dim oidfactory As COIDFactory - If m_oid Is Nothing Then - oidfactory = getOIDFactoryInstance() - m_oid = oidfactory.newOID - End If - OIDValue = m_oid.OID - End Get - Set(ByVal value As String) - If m_oid Is Nothing Then - m_oid = New COID - End If - m_oid.OID = value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property OIDValue() As String Implements IPersistentObject.OIDValue + Get + Dim oidfactory As COIDFactory + If m_oid Is Nothing Then + oidfactory = getOIDFactoryInstance() + m_oid = oidfactory.newOID + End If + OIDValue = m_oid.OID + End Get + Set(ByVal value As String) + If m_oid Is Nothing Then + m_oid = New COID + End If + m_oid.OID = value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property GUIDValue() As String - Get - If m_guid.Equals(Guid.Empty) Then - m_guid = Guid.NewGuid - End If - GUIDValue = m_guid.ToString("N") - End Get - Set(ByVal value As String) - m_guid = New Guid(value) - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property GUIDValue() As String Implements IPersistentObject.GUIDValue + Get + If m_guid.Equals(Guid.Empty) Then + m_guid = Guid.NewGuid + End If + GUIDValue = m_guid.ToString("N") + End Get + Set(ByVal value As String) + m_guid = New Guid(value) + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <summary> - ''' The date that the object was originally created. - ''' </summary> - ''' <value>The created date of the current object</value> - ''' <remarks>If the created date is mapped to a database field then this value - ''' will be based on dates in the database. However, if the created date field is not - ''' mapped then the value will return todays date in most circumstances. - ''' <para>Note that typically the created date is mapped to a database field and is - ''' marked as a TimeStamp field to be used in creating and updating SQL data.</para></remarks> - ''' <history> - ''' [rbanks] 25/11/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property CreatedDate() As Date - Get - Return m_createdDate - End Get - Set(ByVal Value As Date) - m_createdDate = Value - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The date that the object was originally created. + ''' </summary> + ''' <value>The created date of the current object</value> + ''' <remarks>If the created date is mapped to a database field then this value + ''' will be based on dates in the database. However, if the created date field is not + ''' mapped then the value will return todays date in most circumstances. + ''' <para>Note that typically the created date is mapped to a database field and is + ''' marked as a TimeStamp field to be used in creating and updating SQL data.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property CreatedDate() As Date Implements IPersistentObject.CreatedDate + Get + Return m_createdDate + End Get + Set(ByVal Value As Date) + m_createdDate = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <summary> - ''' The modified date and time of an object. - ''' </summary> - ''' <value>The date and time that any attribute of an object was modified.</value> - ''' <remarks>This property is set whenever an object is marked as dirty, indicating - ''' that the object has changed. - ''' The value can be set manually but it is not recommended or neccessary.</remarks> - ''' <history> - ''' [rbanks] 25/11/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property ModifiedDate() As Date - Get - Return m_modifiedDate - End Get - Set(ByVal Value As Date) - If m_modifiedDate <> Value Then - m_modifiedDate = Value - If m_originalModDate = m_blankDate Then - m_originalModDate = Value - End If - End If - End Set - End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The modified date and time of an object. + ''' </summary> + ''' <value>The date and time that any attribute of an object was modified.</value> + ''' <remarks>This property is set whenever an object is marked as dirty, indicating + ''' that the object has changed. + ''' The value can be set manually but it is not recommended or neccessary.</remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property ModifiedDate() As Date Implements IPersistentObject.ModifiedDate + Get + Return m_modifiedDate + End Get + Set(ByVal Value As Date) + If m_modifiedDate <> Value Then + m_modifiedDate = Value + If m_originalModDate = m_blankDate Then + m_originalModDate = Value + End If + End If + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <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> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public Property AssociationsLoaded() As Boolean - Get + '''----------------------------------------------------------------------------- + ''' <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> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public Property AssociationsLoaded() As Boolean Implements IPersistentObject.AssociationsLoaded + Get If Me.getClassMap.AssociationMapCount > 0 Then Return m_associationsLoaded Else @@ -359,77 +360,77 @@ 'However if the object is not persistent then the associations can't be loaded Return Me.Persistent End If - End Get - Set(ByVal Value As Boolean) - m_associationsLoaded = Value - End Set - End Property + End Get + Set(ByVal Value As Boolean) + m_associationsLoaded = Value + End Set + End Property - '''----------------------------------------------------------------------------- - ''' <summary> - ''' The date that an object was last modified and saved to the persistent store. - ''' </summary> - ''' <value>The date and time that the object was last changed.</value> - ''' <remarks>When a persistent object is saved the original modified date is checked against - ''' the value in the database. If the dates are different we know that someone else - ''' has changed the object and that this object can no longer be saved. This forms the - ''' basis for the optimistic lock management performed by the framework. - ''' <para>Note that this funcitonality is only performed if the ModifiedDate attribute is - ''' mapped to a column in the database and is also marked as a Timestamp field.</para></remarks> - ''' <history> - ''' [rbanks] 25/11/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public ReadOnly Property OriginalModifiedDate() As Date - Get - Return m_originalModDate - End Get - End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The date that an object was last modified and saved to the persistent store. + ''' </summary> + ''' <value>The date and time that the object was last changed.</value> + ''' <remarks>When a persistent object is saved the original modified date is checked against + ''' the value in the database. If the dates are different we know that someone else + ''' has changed the object and that this object can no longer be saved. This forms the + ''' basis for the optimistic lock management performed by the framework. + ''' <para>Note that this funcitonality is only performed if the ModifiedDate attribute is + ''' mapped to a column in the database and is also marked as a Timestamp field.</para></remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public ReadOnly Property OriginalModifiedDate() As Date + Get + Return m_originalModDate + End Get + End Property - '''----------------------------------------------------------------------------- - ''' <summary> - ''' The original date that the object was created - ''' </summary> - ''' <value></value> - ''' <remarks>This is for internal use only</remarks> - ''' <history> - ''' [rbanks] 25/11/2003 Created - ''' </history> - '''----------------------------------------------------------------------------- - <Browsable(False)> Public ReadOnly Property OriginalCreatedDate() As Date - Get - Return m_createdDate - End Get - End Property + '''----------------------------------------------------------------------------- + ''' <summary> + ''' The original date that the object was created + ''' </summary> + ''' <value></value> + ''' <remarks>This is for internal use only</remarks> + ''' <history> + ''' [rbanks] 25/11/2003 Created + ''' </history> + '''----------------------------------------------------------------------------- + <Browsable(False)> Public ReadOnly Property OriginalCreatedDate() As Date + Get + Return m_createdDate + End Get + End Property - ''' ----------------------------------------------------------------------------- - ''' <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> - ''' ----------------------------------------------------------------------------- - <Browsable(False)> Public Property IsLoading() As Boolean - Get - Return m_isLoading - End Get - Set(ByVal Value As Boolean) - If m_isLoading <> Value Then - If Value = True Then - RaiseEvent LoadStarted(Me, New EventArgs) - Else - RaiseEvent LoadFinished(Me, New EventArgs) - End If - End If - m_isLoading = Value - End Set - End Property + ''' ----------------------------------------------------------------------------- + ''' <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> + ''' ----------------------------------------------------------------------------- + <Browsable(False)> Public Property IsLoading() As Boolean Implements IPersistentObject.IsLoading + Get + Return m_isLoading + End Get + Set(ByVal Value As Boolean) + If m_isLoading <> Value Then + If Value = True Then + RaiseEvent LoadStarted(Me, New EventArgs) + Else + RaiseEvent LoadFinished(Me, New EventArgs) + End If + End If + m_isLoading = Value + End Set + End Property <Browsable(False)> Friend Property OriginalCacheKey() As CCacheKey Get @@ -582,7 +583,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public MustOverride Function getNewObject() As CPersistentObject + Public MustOverride Function getNewObject() As CPersistentObject Implements IPersistentObject.getNewObject '''----------------------------------------------------------------------------- ''' <summary> @@ -709,7 +710,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getClassMap() As CClassMap + Public Function getClassMap() As CClassMap Implements IPersistentObject.getClassMap Dim persistenceBroker As CPersistenceBroker If m_classmap Is Nothing Then persistenceBroker = getPersistenceBrokerInstance() @@ -763,7 +764,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Function Retrieve(ByRef obj As CPersistentObject, ByVal useCache As Boolean) As Boolean + Public Overridable Function Retrieve(ByRef obj As CPersistentObject, ByVal useCache As Boolean) As Boolean Implements IPersistentObject.Retrieve Dim persistentBroker As CPersistenceBroker persistentBroker = getPersistenceBrokerInstance() Return persistentBroker.retrieveObject(obj, False, useCache) @@ -786,7 +787,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Function Retrieve(ByRef obj As CPersistentObject) As Boolean + Public Overridable Function Retrieve(ByRef obj As CPersistentObject) As Boolean Implements IPersistentObject.Retrieve Return Retrieve(obj, True) End Function @@ -808,7 +809,7 @@ ''' [rbanks] 16/08/2004 Created ''' </history> ''' ----------------------------------------------------------------------------- - Public Overridable Function Retrieve() As Boolean + Public Overridable Function Retrieve() As Boolean Implements IPersistentObject.Retrieve Dim x As Boolean Dim obj As CPersistentObject obj = Me.getNewObject @@ -846,7 +847,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Sub Save(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) + Public Overridable Sub Save(ByVal obj As CPersistentObject, ByVal checkAssociationsRecursivly As Boolean) Implements IPersistentObject.save Dim persistentBroker As CPersistenceBroker Dim value As CPersistentObject Dim queue As Queue @@ -884,11 +885,11 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Sub Save() + Public Overridable Sub Save() Implements IPersistentObject.save Save(Me, False) End Sub - Public Overridable Sub Save(ByVal checkAssociationsRecursively As Boolean) + Public Overridable Sub Save(ByVal checkAssociationsRecursively As Boolean) Implements IPersistentObject.save Save(Me, checkAssociationsRecursively) End Sub @@ -906,7 +907,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Sub Delete(ByVal obj As CPersistentObject) + Public Overridable Sub Delete(ByVal obj As CPersistentObject) Implements IPersistentObject.Delete Delete(obj, False) End Sub @@ -924,7 +925,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Sub Delete(ByVal obj As CPersistentObject, ByVal deleteSuperClass As Boolean) + Public Overridable Sub Delete(ByVal obj As CPersistentObject, ByVal deleteSuperClass As Boolean) Implements IPersistentObject.Delete If obj.isReadOnly Then Throw New DeleteException("This class is read only. No modifications can be made.") Return @@ -947,11 +948,11 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Sub Delete() + Public Overridable Sub Delete() Implements IPersistentObject.Delete Delete(Me, False) End Sub - Public Overridable Sub Delete(ByVal deleteSuperClass As Boolean) + Public Overridable Sub Delete(ByVal deleteSuperClass As Boolean) Implements IPersistentObject.Delete Delete(Me, deleteSuperClass) End Sub @@ -964,7 +965,7 @@ ''' [mfo] 27/09/2004 Created ''' </history> ''' ----------------------------------------------------------------------------- - Public Overridable Sub deleteAll() + Public Overridable Sub DeleteAll() Implements IPersistentObject.DeleteAll Dim obj As CPersistentObject Dim obRC As CRetrieveCriteria Dim obCursor As CCursor @@ -994,7 +995,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Function Find(ByRef obj As CPersistentObject, ByVal useCache As Boolean) As Boolean + Public Overridable Function Find(ByRef obj As CPersistentObject, ByVal useCache As Boolean) As Boolean Implements IPersistentObject.find Dim persistentBroker As CPersistenceBroker persistentBroker = getPersistenceBrokerInstance() Find = persistentBroker.retrieveObject(obj, True, useCache) @@ -1013,7 +1014,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Function Find(ByRef obj As CPersistentObject) As Boolean + Public Overridable Function Find(ByRef obj As CPersistentObject) As Boolean Implements IPersistentObject.find Return Find(obj, True) End Function @@ -1035,7 +1036,7 @@ ''' [rbanks] 16/08/2004 Created ''' </history> ''' ----------------------------------------------------------------------------- - Public Overridable Function Find() As Boolean + Public Overridable Function Find() As Boolean Implements IPersistentObject.find Dim x As Boolean Dim obj As CPersistentObject obj = Me.getNewObject @@ -1089,7 +1090,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public MustOverride Function IsValid() As Boolean + Public MustOverride Function IsValid() As Boolean Implements IPersistentObject.IsValid '''----------------------------------------------------------------------------- ''' <summary> @@ -1173,7 +1174,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Overridable Function Copy() As CPersistentObject + Public Overridable Function Copy() As CPersistentObject Implements IPersistentObject.Copy Return Me.MemberwiseClone End Function @@ -1233,7 +1234,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getFieldLengthByName(ByVal x As String) As Integer + Public Function getFieldLengthByName(ByVal x As String) As Integer Implements IPersistentObject.getFieldLengthByName Return Me.getClassMap(Me).getAttributeMapByString(x, True).ColumnMap.StorageSize() End Function @@ -1248,7 +1249,7 @@ ''' [rbanks] 26/11/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function getFieldTypeByName(ByVal x As String) As Type + Public Function getFieldTypeByName(ByVal x As String) As Type Implements IPersistentObject.getFieldTypeByName Return Me.getClassMap(Me).getAttributeMapByString(x, True).ColumnMap.StorageType End Function @@ -1456,7 +1457,7 @@ ''' [rbanks] 18/12/2003 Created ''' </history> '''----------------------------------------------------------------------------- - Public Function IsReferenced() As Boolean + Public Function IsReferenced() As Boolean Implements IPersistentObject.IsReferenced Dim obAssociation As CUDAMap Dim obObjectCol As CPersistentCollection Dim colAttributes As Collection |