com.intersys.classes
Class Persistent

java.lang.Object
  extended bycom.intersys.classes.CacheGeneric
      extended bycom.intersys.classes.CacheRootObject
          extended bycom.intersys.classes.RegisteredObject
              extended bycom.intersys.classes.Persistent
All Implemented Interfaces:
ObjectHandle, Serializable

public class Persistent
extends RegisteredObject

This class is a superclass for all Persistent objects in Cache database. It is not a generated class.

See Also:
Serialized Form

Constructor Summary
Persistent(com.intersys.cache.CacheObject ref)
           
 
Method Summary
static void _buildIndices(Database db)
          Runs method _buildIndices in Cache
static void _buildIndices(Database db, SList idxlist)
          Runs method _buildIndices in Cache
static void _delete(Database db, Oid oid)
          Permanently destroys object in database.
static void _delete(Database db, Oid oid, Integer concurrency)
           
 void _downgradeConcurrency(int concurrency)
          Runs method _downgradeConcurrency in Cache
 void _downgradeConcurrency(Integer concurrency)
          Runs method _downgradeConcurrency in Cache
static Boolean _exists(Database db, Oid oid)
           
 Id _id()
          The same as method getId() but with conventional Cache signature.
 Oid _oid()
          The same as method getOid() but with conventional Cache signature.
static RegisteredObject _open(Database db, Oid oid)
          Runs method %Open in Cache to open an object from Cache database and creates corresponding object of class Persistent or its subclass.
static RegisteredObject _open(Database db, Oid oid, int concurrency)
          Runs method %Open in Cache to open an object from Cache database and creates corresponding object of class Persistent or its subclass.
 void _reload()
          Runs method _reload in Cache
 int _save()
          The same as save.
 void _upgradeConcurrency(int concurrency)
          Runs method _upgradeConcurrency in Cache
 void _upgradeConcurrency(Integer concurrency)
          Runs method _upgradeConcurrency in Cache
 void delete()
          Permanently destroys object in database.
static void delete(Database db, Oid oid)
          Permanently destroys object in database.
static boolean exists(Database db, Oid oid)
          The same as _exists.
static String getCacheClassName()
           
 Id getId()
          Returns Id of object (without class name).
 Oid getOid()
          Returns an object identity of this object.
 Integer JournalObject(Integer tranid)
          Runs method JournalObject in Cache
 Integer JournalObject(Integer tranid, Integer fileop)
          Runs method JournalObject in Cache
 int save()
          Saves any changes in object to Database.
 int save(boolean deep)
          Saves any changes in object to Database.
 
Methods inherited from class com.intersys.classes.RegisteredObject
_className, _className, _constructClone, _constructClone, _constructClone, _isA, _isModified, _normalizeObject, _packageName, _validateObject, _validateObject, checkAllFieldsValid, checkAllMethods, constructClone, constructClone, getCacheClass, getZRef
 
Methods inherited from class com.intersys.classes.CacheRootObject
_close, castTo, equals, getDatabase, getField, getOref, getProxy, getString, hashCode, release, releaseInternal, toString
 
Methods inherited from class com.intersys.classes.CacheGeneric
checkAllFieldsValid, checkFieldsLimited, reset
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Persistent

public Persistent(com.intersys.cache.CacheObject ref)
           throws CacheException
Method Detail

_open

public static RegisteredObject _open(Database db,
                                     Oid oid)
                              throws CacheException
Runs method %Open in Cache to open an object from Cache database and creates corresponding object of class Persistent or its subclass. Note that subclasses of Persistent have also _open method which takes Id instead of Oid. There is also a pair of _open methods which takes concurrency as an additional argument.

Parameters:
db - Database object used for connection with Cache database.
oid - Object ID as specified in Cache. represented as Oid.
Returns:
RegisteredObject , corresponding to opened object. This object may be of Persistent or of any of it's subclasses. Cast to Persistent is garanteed to pass without ClassCastException exception.
Throws:
CacheException - in case of error.
See Also:
_open(com.intersys.objects.Database, com.intersys.objects.Oid, int)

_open

public static RegisteredObject _open(Database db,
                                     Oid oid,
                                     int concurrency)
                              throws CacheException
Runs method %Open in Cache to open an object from Cache database and creates corresponding object of class Persistent or its subclass. Note that subclasses of Persistent have also _open method which takes Id instead of Oid.

Parameters:
db - Database object used for connection with Cache database.
oid - Object ID as specified in Cache. represented as Oid.
concurrency - concurrency argument which specifies the concurrency setting for this object (and sets the value of the %Concurrency attribute).
Returns:
RegisteredObject , corresponding to opened object. This object may be of Persistent or of any of it's subclasses. Cast to Persistent is garanteed to pass without ClassCastException exception.
Throws:
CacheException - in case of error.
See Also:
_open(com.intersys.objects.Database, com.intersys.objects.Oid), About Concurrency

getOid

public Oid getOid()
           throws CacheException
Returns an object identity of this object. Object identity is unique for any object in database. No two objects, the same or different classes can have the same Object identity.

Returns:
Object Id, represented as com.intersys.objects.Oid.
Throws:
CacheException
See Also:
getId(), _oid()

_oid

public Oid _oid()
         throws CacheException
The same as method getOid() but with conventional Cache signature. Returns an object identity of this object. Object identity is unique for any object in database. No two objects, the same or different classes can have the same Object identity.

Returns:
Object Id, represented as com.intersys.objects.Oid.
Throws:
CacheException
See Also:
getOid(), getId(), _id(), getId()

getId

public Id getId()
         throws CacheException
Returns Id of object (without class name). Object Id is unique for object of the same class but may coinside for different object of different classes.

Returns:
Object Id, represented as com.intersys.objects.Id
Throws:
CacheException
See Also:
getOid(), _id()

_id

public Id _id()
       throws CacheException
The same as method getId() but with conventional Cache signature. Returns Id of object (without class name). Object Id is unique for object of the same class but may coinside for different object of different classes.

Returns:
Object Id, represented as com.intersys.objects.Id
Throws:
CacheException
See Also:
getOid(), getId(), _oid()

save

public int save()
         throws CacheException
Saves any changes in object to Database. Before this method is invoked, no changes in the object are visible to other processes. If this (no arguments) method is called than deep save is performed for full Java Binding. For shallow save call save(false). On the other hand, for Light Java Binding default mode is shallow, i.e. if this (no arguments) method is called than shallow save is performed. For deep save call save(true) if you are using Light connection.

Returns:
1 if save was successful.
Throws:
CacheException - if error occured during save.
See Also:
save(boolean)

save

public int save(boolean deep)
         throws CacheException
Saves any changes in object to Database. Before this method is invoked, no changes in the object are visible to other processes.

Parameters:
deep - Whether to perform deep save. If value is true then deep save is performed and all objects referred by the one on which method is called are also saved recursively. If the value is false then shallow save is performed and only the calling object is saved.
Returns:
1 if save was successful.
Throws:
CacheException - if error occured during save.

_save

public int _save()
          throws CacheException
The same as save. This method is left to comply to naming convention, according to which Cache system methods (those, which name starts with '%' in Cache) are translated to methods, starting with '_' in Java.

Throws:
CacheException
See Also:
save()

_exists

public static Boolean _exists(Database db,
                              Oid oid)
                       throws CacheException
Throws:
CacheException

exists

public static boolean exists(Database db,
                             Oid oid)
                      throws CacheException
The same as _exists.

Throws:
CacheException
See Also:
_exists(com.intersys.objects.Database, com.intersys.objects.Oid)

_delete

public static void _delete(Database db,
                           Oid oid)
                    throws CacheException
Permanently destroys object in database.

Throws:
CacheException

delete

public static void delete(Database db,
                          Oid oid)
                   throws CacheException
Permanently destroys object in database.

Throws:
CacheException

delete

public void delete()
            throws CacheException
Permanently destroys object in database.

Throws:
CacheException

_delete

public static void _delete(Database db,
                           Oid oid,
                           Integer concurrency)
                    throws CacheException
Throws:
CacheException

_downgradeConcurrency

public void _downgradeConcurrency(Integer concurrency)
                           throws CacheException
Runs method _downgradeConcurrency in Cache

Parameters:
concurrency - represented as an Integer
Throws:
CacheException - if any error occured while running the method.

_downgradeConcurrency

public void _downgradeConcurrency(int concurrency)
                           throws CacheException
Runs method _downgradeConcurrency in Cache

Parameters:
concurrency - represented as an int
Throws:
CacheException - if any error occured while running the method.

_upgradeConcurrency

public void _upgradeConcurrency(Integer concurrency)
                         throws CacheException
Runs method _upgradeConcurrency in Cache

Parameters:
concurrency - represented as an Integer
Throws:
CacheException - if any error occured while running the method.

_upgradeConcurrency

public void _upgradeConcurrency(int concurrency)
                         throws CacheException
Runs method _upgradeConcurrency in Cache

Parameters:
concurrency - represented as an int
Throws:
CacheException - if any error occured while running the method.

_reload

public void _reload()
             throws CacheException
Runs method _reload in Cache

Throws:
CacheException - if any error occured while running the method.

_buildIndices

public static void _buildIndices(Database db)
                          throws CacheException
Runs method _buildIndices in Cache

Parameters:
db - represented as Database
Throws:
CacheException - if any error occured while running the method.
See Also:
_buildIndices(Database,SList)

_buildIndices

public static void _buildIndices(Database db,
                                 SList idxlist)
                          throws CacheException
Runs method _buildIndices in Cache

Parameters:
db - represented as Database
idxlist - represented as SList
Throws:
CacheException - if any error occured while running the method.

JournalObject

public Integer JournalObject(Integer tranid)
                      throws CacheException
Runs method JournalObject in Cache

Parameters:
tranid - represented as java.lang.Integer
Throws:
CacheException - if any error occured while running the method.
See Also:
JournalObject(java.lang.Integer,java.lang.Integer), Method JournalObject

JournalObject

public Integer JournalObject(Integer tranid,
                             Integer fileop)
                      throws CacheException
Runs method JournalObject in Cache

Parameters:
tranid - represented as java.lang.Integer
fileop - represented as java.lang.Integer
Throws:
CacheException - if any error occured while running the method.
See Also:
Method JournalObject

getCacheClassName

public static String getCacheClassName()