Defining ClassAlias and FieldAlias annotations to correlate Java and .NET classes

[Version 8.6 and later]Use ClassAlias and FieldAlias annotations to enable sharing of data grid data between your Java™ and .NET classes.

Before you begin

About this task

You might consider using ClassAlias and FieldAlias annotations if you have an existing Java class and want to create a corresponding C# class. In this scenario, you can add the annotations to your C# class that include the Java class name. For more information about the ClassAlias and FieldAlias annotations, see ClassAlias and FieldAlias annotations.

Procedure

Use ClassAlias and FieldAlias annotations to correlate objects between a Java class and a C# class.
[Java programming language only]
Figure 1. Java example with ClassAlias and FieldAlias annotations
@ClassAlias("Employee")
class com.company.department.Employee {

     @FieldAlias("id")
     int myId;

      String name;
}
[.net programming language only]
Figure 2. .NET example with ClassAlias and FieldAlias attributes
[ ClassAlias( "Employee") ]
class Com.MyCompany.Employee {

     [ FieldAlias("id") ]
      int identifier;

      string name;
}