IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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


@Retention(value=RUNTIME)
public @interface FieldAlias

Specifies the field alias that you can use to correlate different class field names that have the same class field alias. The class alias, field alias and field 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 @FieldAlias annotation can be specified for a field within a user defined class.
For example, the syntax for the field alias could look like :

 @FieldAlias("Employee ID")
 
In the above example, "Employee ID" is a field alias for the empId field in this user defined class.

If @FieldAlias annotation is not defined, the name of this field is set as the FieldAlias
 @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 field alias
 

Element Detail

value

public abstract String value
The field alias

Returns:
the field alias

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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