IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins.io.annotations
Annotation Type ClassAlias


@Retention(value=RUNTIME)
public @interface ClassAlias

Specifies the class alias that you can use to correlate different class names that have the same class alias. The class alias and class fields or types are used to identify a unique class type ID during the object class serialization and de-serialization.
(Note: this annotation is currently only used when eXtreme scale data format (XDF) is enabled)
The @ClassAlias annotation can be specified for a user defined class.
For example, the syntax for the class could look like :

 @ClassAlias("ACME_Employee")
 
In the above example, ACME_Employee is the class alias for this user defined class.

If @ClassAlias annotation is not defined, the name of this class is set as the ClassAlias.
 @ClassAlias("ACME_Employee")
 class Employee1 {
    @FieldAlias("Employee ID")
    int empId = -1;

    @FieldAlias("Department No.")
    int deptId = -1;

    @FieldAlias("Year Salary")
    float salary = 0;

    @FieldAlias("SEX")
    String sex = "M";

    int age = -1;
    String homeAddress = "";
 
When a ClassAlias and/or FieldAlias are specified in a user defined class, the ClassAlias and/or FieldAlias will be used to create or correlate with an object that are stored or will be stored in the grid. If two user defined classes (in a separate java application environment) have the different class name, but they were marked as the same ClassAlias, and all fields and field types are matched between these 2 classes, they will be correlated with the same class type ID even though they have the different class name. This way will allow the same class metadata to be reused between these 2 classes when running serialization and de-serialization in the different Java application runtime, as well as to shared with C# when the Alias for the class defined in C# and fields are also matched.

Since:
8.6

Required Element Summary
 String value
          The class alias
 

Element Detail

value

public abstract String value
The class alias

Returns:
the class alias

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.