ClassAlias and FieldAlias annotations

[Version 8.6 and later]Use ClassAlias and FieldAlias annotations to enable sharing of data grid data between classes. You can either share data between two Java™ classes or a Java and a .NET class.

If you define two classes with the same name and fields, the data grid data is automatically shared between the classes. For example, if you have a Customer1 class in your Java application, and a Customer1 class in your .NET application that has the same fields, the data is shared between the classes. This example assumes that the class name also includes the class qualifier, which is also the package name in Java and namespace name in C#. The package name and namespace name are automatically shared because the namespace and package names match. See the following example, where both names are case insensitive:
Java:
package com.mycompany.app
public class SampleClass {
int field1;
String field2;
}

C#
namespace Com.MyCompany.App
public class SampleClass {
int field1;
string field2;
}

However, you can also correlate data between classes that have different names. To correlate data to be stored in the data grid between different classes with different names, use ClassAlias or FieldAlias annotations.

Between two Java applications: You can define two different classes with different names in separate Java application environments. By marking the classes with the same ClassAlias annotation, and all fields and field types are matched between these two classes.  The classes get correlated with the same class type ID even though they have the different class names. The same class type ID and the metadata can then be reused between the classes in the different Java application run times.

Between a Java application and a .NET application: You can use similar annotations in your C# application to correlate the C# class with a Java class. The ClassAlias attributes that are defined for the class C# and fields are matched to a Java class with the same ClassAlias annotation.