IRISLIB database
SerialObject Class Reference

Inherits SwizzleObject.

Inherited by AlternativeServer, ApplicationPath, CacheServer, CachedForms, Connection, Form, Action, Condition, FormButton, Link, Menu, MenuItem, JavaForeignKeyDef, JavaIndexDef, CalculatedMember, ChartDataSeries, Control, DataProperty, PivotCondition, PivotLevel, Widget, AbstractBuilder, Data, Field, ModelOutput, WorksheetAxis, WorksheetCell, Attributes, Call, LDA, NaiveBayes, Operation, PCA, Report, Sequence, Sort, Table, Object, JMSMessageProperty, SQSMessageAttribute, ArrayOfDataTypes, ArrayOfObjects, IStruct, ListOfDataTypes, ListOfObjects, RelationshipObject, MIMESerialPart, MailMessagePart, Error, Claim, Column, ObjectId, Parameter, Created, Password, StatementColumn, StatementObject, StatementParameter, MenuItem, AppServers, GeneratorStatus, Processes, Progress, Parameters, Response, Generators, Data, Session, Algorithm, OutputKeyValue, OutputLocation, and OutputSection.

Collaboration diagram for SerialObject:

Static Public Member Functions

_.Library.String LogicalToOdbc (_.Library.String val)
 Converts the serial state of this serial object to a delimited string. More...
 
_.Library.String OdbcToLogical (_.Library.String val)
 Converts the value of an incoming delimited string to a serialized state. More...
 

Static Public Attributes

 ODBCDELIMITER = None
 A serial object is converted to a delimited string containing the. More...
 
 SERIALDELIMITER = None
 This parameter specifies the delimiter character used when created a serialized. More...
 
 VALIDIFNULL = None
 If true, ValidateObject will return $$$OK for instances that are null as determined by IsNull(). More...
 
- Static Public Attributes inherited from SwizzleObject
 DEFAULTCONCURRENCY = None
 DEFAULTCONCURRENCY is the default value for the concurrency formal argument. More...
 
 JOURNALSTREAM = None
 If OBJJOURNAL is true then the value of the JOURNALSTREAM parameter defines whether or not. More...
 
 OBJJOURNAL = None
 if OBJJOURNAL is TRUE then inserts, updates and deletes will be logged in ^OBJ.JournalT More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Private Member Functions

_.Library.Status GetSwizzleObject (_.Library.Integer force, _.Library.ObjectIdentity oid)
 GetSwizzleObject() is used to obtain the serial value of the object that can More...
 
_.Library.Boolean IsNull ()
 Returns true if this is a "NULL" serial object. More...
 

Static Private Member Functions

_.Library.Status Delete (_.Library.ObjectIdentity oid, _.Library.Integer concurrency)
 Deletes streams referenced by this object and calls Delete on any embedded objects. More...
 
_.Library.Status DeleteId (_.Library.String id, _.Library.Integer concurrency)
 Deletes the stored version of the object with ID id from the database. More...
 
_.Library.ObjectHandle Open (_.Library.ObjectIdentity initvalue, _.Library.Integer concurrency, _.Library.Status sc)
 Creates an instance (in-memory version) of a serial object from the. More...
 
_.Library.ObjectHandle OpenId (_.Library.String initvalue, _.Library.Integer concurrency, _.Library.Status sc)
 Swizzles a serial object from the value passed and returns an OREF referring to the object. More...
 

Additional Inherited Members

- Public Member Functions inherited from SwizzleObject
_.Library.Status OnJournalObject (_.Library.Integer tranid, _.Library.Integer jrnid, _.Library.String filter)
 This callback method is invoked by the <METHOD>JournalObject</METHOD> method to. More...
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Detailed Description

For information on this class, see Introduction to Serial Objects.

The SerialObject class builds upon the functionality provided by the <CLASS>RegisteredObject</CLASS> class and gives an object the ability to serialize itself and be embedded within another object.

Member Function Documentation

◆ Delete()

_.Library.Status Delete ( _.Library.ObjectIdentity  oid,
_.Library.Integer  concurrency 
)
staticprivate

Deletes streams referenced by this object and calls Delete on any embedded objects.

Refer to <a href="/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_concurrency" target="_blank">Object Concurrency Options</a> for more details 
on the optional <var>concurrency</var> argument.

<p>Returns a <CLASS>%Status</CLASS> value indicating success or failure.

Reimplemented from SwizzleObject.

◆ DeleteId()

_.Library.Status DeleteId ( _.Library.String  id,
_.Library.Integer  concurrency 
)
staticprivate

Deletes the stored version of the object with ID id from the database.

<p><METHOD>%DeleteId</METHOD> is identical in operation to the <METHOD>%Delete</METHOD> method except 
that it uses and Id value instead of an OID value to find an object.

Refer to <a href="/csp/docbook/DocBook.UI.Page.cls?KEY=GOBJ_concurrency" target="_blank">Object Concurrency Options</a> for more details 
on the optional <var>concurrency</var> argument.

Reimplemented from SwizzleObject.

◆ GetSwizzleObject()

_.Library.Status GetSwizzleObject ( _.Library.Integer  force,
_.Library.ObjectIdentity  oid 
)
private

GetSwizzleObject() is used to obtain the serial value of the object that can

later be used by SetSerial() to restore the object. It calls SerializeObject() which returns the serialized state of the object or the OID (for persistent objects). Before calling GetSerial(), GetSwizzleObject() calls AddToSaveSet([force]) which will result in calling the GetSwizzleObject() method of other referenced objects, passing along the value of force.

<METHOD>GetSwizzleObject</METHOD> automatically detects and handles circular references between objects. For example, <METHOD>GetSwizzleObject</METHOD> will detect if object A refers to object B and object B likewise refers to object A. In this case it will avoid falling into an infinite, recursive loop.

Note that either reference attribute, A to B or B to A, can be specified as being a required attribute but not both of them. If both reference attributes are required then <METHOD>GetSwizzleObject</METHOD> will fail.

By default <METHOD>GetSwizzleObject</METHOD> automatically manages transactions. You can enable and disable automatic transaction support using the $$SetTransactionMode^apiOBJ() routine.

When <METHOD>GetSwizzleObject</METHOD> serializes an object, it initiates one transaction (by calling TSTART) for the entire set of serializations, including the original object and any related objects. If the serialization operation is successful, <METHOD>GetSwizzleObject</METHOD> will issue a TCOMMIT command to commit the transaction and write the data to the database. If <METHOD>GetSwizzleObject</METHOD> encounters an error during the transaction it rolls back the entire transaction and performs the following actions:

  • It issues a TROLLBACK command to rollback any changes to the database that may have occurred. (In the case of persistent objects with system assigned ids changes to the on-disk counter value, used to determine the next available object id number, are not rolled back.)
  • It attempts to restore the in-memory state of all the objects involved in the transaction to their pre-transaction state. This includes restoring any modified flags, and restoring to null ("") any OID values that have been assigned during the course of the transaction. Additional property values changed during the course of the transaction are not restored, however.
  • It calls the <METHOD>RollBack</METHOD> method on each object involved with the transaction. The order in which the <METHOD>RollBack</METHOD> methods are called is undefined. <METHOD>RollBack</METHOD> will call a user-written <METHOD>OnRollback</METHOD> method if it is present.

Returns a <CLASS>Status</CLASS> value indicating success or failure.

◆ IsNull()

_.Library.Boolean IsNull ( )
private

Returns true if this is a "NULL" serial object.

Subclasses of SerialObject are expected to override

this method. The default implementation returns 0 (false) indicating that the serial object is not null. The default serialization class will generate an IsNull method that checks each property for null and if all are null then IsNull() is 1 (true).

Reimplemented from SwizzleObject.

◆ Open()

_.Library.ObjectHandle Open ( _.Library.ObjectIdentity  initvalue,
_.Library.Integer  concurrency,
_.Library.Status  sc 
)
staticprivate

Creates an instance (in-memory version) of a serial object from the.

serialized value initvalue. Note that concurrency is not used, the argument is kept to keep the interface consistent with <class>Library.Persistent</class>. If an error occurrs it is returned by refence in sc.

◆ OpenId()

_.Library.ObjectHandle OpenId ( _.Library.String  initvalue,
_.Library.Integer  concurrency,
_.Library.Status  sc 
)
staticprivate

Swizzles a serial object from the value passed and returns an OREF referring to the object.

initvalue is the Id (serial value, not a full OID) value of the object to swizzle.

<METHOD>OpenId</METHOD> is identical in operation to the <METHOD>Open</METHOD> method except that it uses and Id value instead of an OID value to find an object instance.

<METHOD>OpenId</METHOD> returns an OREF value that refers to the in-memory object instance.

◆ LogicalToOdbc()

_.Library.String LogicalToOdbc ( _.Library.String  val)
static

Converts the serial state of this serial object to a delimited string.

using the value of the ODBCDELIMITER parameter as a delimiter.

Reimplemented in ListOfDataTypes, and ArrayOfDataTypes.

◆ OdbcToLogical()

_.Library.String OdbcToLogical ( _.Library.String  val)
static

Converts the value of an incoming delimited string to a serialized state.

using the value of the ODBCDELIMITER parameter as a delimiter.

Reimplemented in ListOfDataTypes, and ArrayOfDataTypes.

Member Data Documentation

◆ ODBCDELIMITER

ODBCDELIMITER = None
static

A serial object is converted to a delimited string containing the.

object's property values when it is projected via ODBC. ODBCDELIMITER is the delimiter character used to construct the delimited string.

◆ SERIALDELIMITER

SERIALDELIMITER = None
static

This parameter specifies the delimiter character used when created a serialized.

version of the object. If the parameter is set to null string ("") then a length delimited ($List) string is used which can be manipulated using the $List functions.

◆ VALIDIFNULL

VALIDIFNULL = None
static

If true, ValidateObject will return $$$OK for instances that are null as determined by IsNull().

If FALSE (the default), ValidateObject will perform a full validation on the instance, even if it is null. This means that if VALIDIFNULL is TRUE then the property constraint, REQUIRED, can be defined without causing failures on null objects. It is important to note that a property with an INITIALEXPRESSION that returns a non-null initial value will cause IsNull() to return FALSE for a new, otherwise unmodified instance.