com.pega.pegarules.pub.database
Interface ClassDefinition


public interface ClassDefinition

Represents a PegaRULES class.

Version:
$Revision: 24536 $ $Date: 2012-04-03 19:53:22 -0400 (Tue, 03 Apr 2012) $
Author:
Jamie Gentry

Field Summary
static java.lang.String COPYRIGHT
           
static int DB_COL__PROP_EXIST_WITH_OTHER_NAME
           
static int DB_COL_PROP_EXIST
           
static int NO_DB_COL_PROP_EXIST
           
static java.lang.String VERSION
           
 
Method Summary
 boolean canWriteInstances()
          Can one write instances of this class?
 java.util.Set getAllAncestorClasses()
          Gets the ancestors of this class (using pattern and direct inheritance if applicable).
 java.util.List<java.lang.String> getAllAncestorClassesListWithoutDuplicates()
          Gets the ancestors of this class (using pattern and direct inheritance if applicable).
 java.util.Iterator getAncestorIter()
          Gets the ancestors of this class (using pattern inheritance if applicable).
 ClassDefinition getBaseClass()
          Returns this class's base class.
 java.util.Iterator getChildrenIter()
          Gets only the direct descendants (children) of this class.
 ClassDefinition getClassGroup()
          Returns the class group to which this class belongs.
 java.lang.String getDatabase()
          Returns the database (as defined in Data-Admin-DB-Name) in which instances of this class are stored.
 java.lang.String getDatabase(boolean isReportDb)
          Returns the database (as defined in Data-Admin-DB-Name) in which instances of this class are stored.
 java.lang.String getDBProductName()
          Deprecated. use getDBProductName(com.pega.pegarules.pub.runtime.PublicAPI) instead
 java.lang.String getDBProductName(PublicAPI aPega)
          Returns the name of the database program that manages the table in which this class is stored.
 java.util.Iterator getDescendantIter()
          Gets the descendants of this class.
 ClassDefinition getDirectedParent()
          Gets the parent of this class.
 java.util.Map getJavaGenerators()
          Returns the name of the Java generator classes for this PegaRULES class.
 java.lang.String getJavaWrapperClassName()
          Get the Java class used to back up any Java Properties defined on this class.
 java.util.List getKeyPropertyList()
          Gets the key properties.
 java.lang.String getName()
          Gets the name of this class.
 ClassDefinition getPatternParent()
          Gets the pattern parent of this class.
 java.util.Map getPropertyToColumnMap()
          Returns an immutable version of the explicit property to column map
 java.lang.String getRuleSetName()
          Get this class's ruleset.
 DatabaseTable getTable()
          Returns table that a class is mapped to.
 java.lang.String getTableName()
          Deprecated. use getTableName(com.pega.pegarules.pub.runtime.PublicAPI) instead
 java.lang.String getTableName(PublicAPI aPega)
          Returns the table in which this class is stored.
 boolean hasJavaGenerators()
          Indicates whether this class has any Java generator classes defined, for any aspect.
 boolean isAncestorOf(java.lang.String aPossibleDescendantName)
          Is this class defined to be the ancestor of another?
 boolean isConcrete()
          Is this class Concrete?
 boolean isExcludedFromFTIndex()
          Returns a boolean indicating, if true, that this class is excluded from full text indexing
 boolean isMappedToBaseTable()
          Is this class mapped to the base table?
 boolean isMappedToExternalTable()
          Is this class mapped to an external table?
 boolean isPropertyExposed(java.lang.String aPropertyName, PublicAPI aContext)
          Is a property exposed as a column in the table in which instances of this class live?
 int isPropertyMappedtoAnotherName(java.lang.String aPropertyName, PublicAPI aContext, java.lang.StringBuffer aMappedName)
          Determine if the passed in property is mapped to another case sensitive version of the property also mapped to the same db table
 boolean isRule()
          Is this a rule class?
 boolean usesInheritance()
          Does this class use inheritance?
 boolean usesPatternInheritance()
          Does this class use pattern inheritance?
 boolean usesRuleResolution()
          Does this class use rule resolution?
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

VERSION

static final java.lang.String VERSION
See Also:
Constant Field Values

DB_COL_PROP_EXIST

static final int DB_COL_PROP_EXIST
See Also:
Constant Field Values

NO_DB_COL_PROP_EXIST

static final int NO_DB_COL_PROP_EXIST
See Also:
Constant Field Values

DB_COL__PROP_EXIST_WITH_OTHER_NAME

static final int DB_COL__PROP_EXIST_WITH_OTHER_NAME
See Also:
Constant Field Values
Method Detail

getName

java.lang.String getName()
Gets the name of this class.

Returns:
the name

getDirectedParent

ClassDefinition getDirectedParent()
Gets the parent of this class.

Returns:
the parent, or null if this is the ultimate base class

getPatternParent

ClassDefinition getPatternParent()
Gets the pattern parent of this class.

Returns:
the pattern parent, or null if none

isRule

boolean isRule()
Is this a rule class?

Returns:
true if this is a rule class; that is, if it inherits from the base rule class--not necessarily that it uses rule resolution

isConcrete

boolean isConcrete()
Is this class Concrete?

Returns:
true if concrete, false if abstract

usesRuleResolution

boolean usesRuleResolution()
Does this class use rule resolution?

Returns:
true if it does

getJavaWrapperClassName

java.lang.String getJavaWrapperClassName()
Get the Java class used to back up any Java Properties defined on this class.

Returns:
the package-qualified Java class name

usesInheritance

boolean usesInheritance()
Does this class use inheritance?

Returns:
true if it does

usesPatternInheritance

boolean usesPatternInheritance()
Does this class use pattern inheritance?

Returns:
true if it does

getRuleSetName

java.lang.String getRuleSetName()
Get this class's ruleset.

Returns:
the name of the ruleset

getDBProductName

java.lang.String getDBProductName(PublicAPI aPega)
                                  throws DatabaseException
Returns the name of the database program that manages the table in which this class is stored.

Parameters:
aPega - the current executable context
Returns:
the name of the program
Throws:
ConfigurationException - if classes and/or databases are not configured properly
DatabaseException - if there is a problem with the database

getDBProductName

java.lang.String getDBProductName()
                                  throws DatabaseException
Deprecated. use getDBProductName(com.pega.pegarules.pub.runtime.PublicAPI) instead

Returns the name of the database program that manages the table in which this class is stored.

Returns:
the name of the program
Throws:
ConfigurationException - if classes and/or databases are not configured properly
DatabaseException - if there is a problem with the database

getTableName

java.lang.String getTableName()
                              throws DatabaseException
Deprecated. use getTableName(com.pega.pegarules.pub.runtime.PublicAPI) instead

Returns the table in which this class is stored. (Does not check to see if it is actually valid to store instances of this class.)

Returns:
the name of the table
Throws:
ConfigurationException - if the class and/or table is not configured correctly
DatabaseException - if there is a database problem

getTableName

java.lang.String getTableName(PublicAPI aPega)
                              throws DatabaseException
Returns the table in which this class is stored. (Does not check to see if it is actually valid to store instances of this class.)

Parameters:
aPega - the current executable context
Returns:
the name of the table
Throws:
ConfigurationException - if the class and/or table is not configured correctly
DatabaseException - if there is a database problem

getKeyPropertyList

java.util.List getKeyPropertyList()
Gets the key properties.

Returns:
the key properties, as an unmodifiable collection of String

canWriteInstances

boolean canWriteInstances()
Can one write instances of this class?

Returns:
true if you can write instances of this class; in other words, if
  • the class does is not an ancestor of Code-
  • the class is not an ancestor of Embed-
  • the class has at least one key property defined
  • the class is not abstract

isPropertyExposed

boolean isPropertyExposed(java.lang.String aPropertyName,
                          PublicAPI aContext)
                          throws DatabaseException
Is a property exposed as a column in the table in which instances of this class live?

Parameters:
aPropertyName - the property
aContext - the context from which this is called
Returns:
true if the property is exposed, false otherwise (or if the property does not exist)
Throws:
DatabaseException - if there is a database problem

isPropertyMappedtoAnotherName

int isPropertyMappedtoAnotherName(java.lang.String aPropertyName,
                                  PublicAPI aContext,
                                  java.lang.StringBuffer aMappedName)
                                  throws DatabaseException
Determine if the passed in property is mapped to another case sensitive version of the property also mapped to the same db table

Parameters:
aPropertyName - the name of the desired property to be checked
aContext - is a context to be passed in
aMappedName - if the column is mapped then the string buffer returns the other mapped column name
Returns:
int where the values correspond to the static variables valid return values are ClassDefinition.DB_COL_PROP_EXIST, ClassDefinition.NO_DB_COL_PROP_EXIST, ClassDefinition.DB_COL__PROP_EXIST_WITH_OTHER_NAME;
Throws:
DatabaseException - if there is a database problem

getAncestorIter

java.util.Iterator getAncestorIter()
Gets the ancestors of this class (using pattern inheritance if applicable).

Returns:
an iterator of ancestors, not including this class, in the order they would be searched for rule resolution. It is a non-modifiable iterator of ClassDefinitions.

getDescendantIter

java.util.Iterator getDescendantIter()
Gets the descendants of this class.

Returns:
an unmodifiable iterator of descendants, not including this class. The iterator returns ClassDefinitions.

getChildrenIter

java.util.Iterator getChildrenIter()
Gets only the direct descendants (children) of this class. It returns both pattern and directed children without duplicates.

Returns:
an unmodifiable iterator of descendants, not including this class. The iterator returns ClassDefinitions.

isAncestorOf

boolean isAncestorOf(java.lang.String aPossibleDescendantName)
Is this class defined to be the ancestor of another?

Parameters:
aPossibleDescendantName - name of the other class
Returns:
true if this class is an ancestor of aPossibleDescendantName, or if the classes are the same. Returns false otherwise. Also returns false If either class does not exist.

getClassGroup

ClassDefinition getClassGroup()
Returns the class group to which this class belongs.

Returns:
if this class is the head of a class group or belongs to a class group, returns the definition of the class at the head of the group; if this class does not belong to a class group, returns null.

getDatabase

java.lang.String getDatabase()
                             throws DatabaseException
Returns the database (as defined in Data-Admin-DB-Name) in which instances of this class are stored.

Returns:
the name of the database
Throws:
DatabaseException - if there is a problem

getDatabase

java.lang.String getDatabase(boolean isReportDb)
                             throws DatabaseException
Returns the database (as defined in Data-Admin-DB-Name) in which instances of this class are stored.

Parameters:
isReportDb - specify if we need to get the reports db
Returns:
the name of the database
Throws:
DatabaseException - if there is a problem

isMappedToExternalTable

boolean isMappedToExternalTable()
                                throws DatabaseException
Is this class mapped to an external table?

Returns:
true if it is. This does not necessarily imply that this class is an Obj-external class--that is, that this class may be accessed with Obj- methods.
Throws:
NonexistentTableException - if the table to which the class is mapped does not exist
ConfigurationException - if the table to which this class is mapped does not exist, or if there is some other configuration problem
DatabaseException - if there is a database problem

isMappedToBaseTable

boolean isMappedToBaseTable()
                            throws DatabaseException
Is this class mapped to the base table?

Returns:
true if is.
Throws:
DatabaseException - if there is a database problem

getTable

DatabaseTable getTable()
                       throws DatabaseException
Returns table that a class is mapped to.

Returns:
the table
Throws:
DatabaseException - if there is a problem

getBaseClass

ClassDefinition getBaseClass()
Returns this class's base class. The base class is the directed ancestor of this class whose immediate directed parent is @baseclass. (This is usually something like Embed-, Work-, Data- or Rule-.)

Returns:
the base class; or null if this class is @baseclass, or if this parent's directed parent is @baseclass

isExcludedFromFTIndex

boolean isExcludedFromFTIndex()
Returns a boolean indicating, if true, that this class is excluded from full text indexing

Returns:
true if this class is excluded from full text indexing

getPropertyToColumnMap

java.util.Map getPropertyToColumnMap()
Returns an immutable version of the explicit property to column map

Returns:
a map from property name to column name

getJavaGenerators

java.util.Map getJavaGenerators()
Returns the name of the Java generator classes for this PegaRULES class.

Returns:
The names of the Java assembled classes (as strings), keyed by the aspect name (as a string). If there is only one default Java assembly class, then the single entry in this map will have a null key. If this class has no assemblers, then an empty map is returned.

hasJavaGenerators

boolean hasJavaGenerators()
Indicates whether this class has any Java generator classes defined, for any aspect. Will also iterate through all the direct parents of this class to find any inherited generators.

Returns:
boolean If this class, or a direct parent, has any java generators of any aspect defined.

getAllAncestorClasses

java.util.Set getAllAncestorClasses()
Gets the ancestors of this class (using pattern and direct inheritance if applicable).

Returns:
an Set of ancestors, not including this class.

getAllAncestorClassesListWithoutDuplicates

java.util.List<java.lang.String> getAllAncestorClassesListWithoutDuplicates()
Gets the ancestors of this class (using pattern and direct inheritance if applicable).

Returns:
an List of ancestors, not including this class.


Copyright © 2012 Pegasystems Inc. All Rights Reserved.