Chapter 13 Class Keyword – ClientDataType

Specifies the client data type to use when projecting this data type onto the client technology. Applies only to data type classes.

usage

To specify the client data type to use when projecting this data type onto the client technology, use the following syntax:

Class MyApp.MyString [ ClientDataType = clienttype ]  
{ //class members }
Copy the code

Where clientType is one of the following:

  • BIGINT
  • BINARY
  • BINARYSTREAM
  • BOOLEAN
  • CHARACTERSTREAM
  • CURRENCY
  • DATE
  • DECIMAL
  • DOUBLE
  • FDATE
  • FTIMESTAMP
  • HANDLE
  • INTEGER
  • LIST
  • LONGVARCHAR
  • NUMERIC
  • STATUS
  • TIME
  • TIMESTAMP
  • VARCHAR(the default)

Break down

This keyword specifies the client data type to use when projecting this class onto the client technology. Each datatype class must specify a client datatype.

Effects on subclasses

This keyword is inherited from the primary superclass. Subclasses can override the value of a keyword.

The default

The default client data type is VARCHAR.

Chapter 14 Class Keyword – ClientName

The default class name used in the client projection of this class can be overridden.

usage

To override the default name of a class when projecting it to the client, use the following syntax:

Class MyApp.MyClass [ ClientName = clientclassname ]  
{ //class members }
Copy the code

Where clientClassName is an unquoted string used as the client name, not the classname.

Break down

This keyword allows you to define an alternative name for the class when it is projected to the client (for example, when using InterSystems IRIS Java bindings)

Effects on subclasses

This keyword is not inherited.

The default

If this keyword is omitted, the actual class name is used on the client.

Chapter 15 class keyword – CompileAfter

Specifies that this class should compile after other (specified) classes.

usage

To indicate that the class compiler should compile this class after the other classes, use the following syntax:

Class MyApp.MyClass [ CompileAfter = classlist ]  
{ //class members }
Copy the code

Where classList is one of the following:

  • The name of the class. Such as:
[ CompileAfter = MyApp.Class1 ]
Copy the code
  • A comma-separated list of class names, enclosed in parentheses. Such as:
[ CompileAfter = (MyApp.Class1,MyApp.Class2,MyApp.Class3) ]
Copy the code

Break down

This keyword specifies that the class compiler should compile the class after compiling the specified class.

Typically, this keyword is used when there are dependencies between classes that the compiler cannot detect, so that they must be compiled one after the other.

This keyword only affects compilation order, not runtime behavior.

Note:CompileAfterThe keyword does not ensure that a class specified before the class is compiled is runnable.

In addition, the CompileAfter keyword only affects classes that have a common value with the System keyword.

Effects on subclasses

This keyword is inherited from all superclasses. If a subclass specifies a value for the keyword, the value specifies the additional classes that must be compiled before the subclass can be compiled.

The default

By default, this keyword is not specified.

Chapter 16 Category Keyword – DdlAllowed

Specifies whether DDL statements can be used to change or delete class definitions. Applies only to persistent classes.

usage

To modify a class through DDL, use the following syntax:

Class MyApp.Person Extends %Persistent [ DdlAllowed ]  
{ //class members }
Copy the code

Otherwise, omit this keyword or use the following syntax:

Class MyApp.Person Extends %Persistent [ Not DdlAllowed ]  
{ //class members }
Copy the code

details

This keyword specifies whether a class definition can be changed or dropped using DDL statements such as drop table, change table, drop index, and so on.

In general, you do not want SQL users to use DDL statements to modify classes.

Effects on subclasses

This keyword is not inherited.

The default

If this keyword is omitted, the DDL statement cannot be used to affect the class definition.

Pay attention to

If a class is created by executing the DDL CREATE TABLE statement, the DdlAllowed keyword will initially be set to true for that class.