Skip to main content

Caché Collections

Caché classes primarily use two different types of collections. The Java type of the corresponding projection property can be controlled through the property's JAVATYPE parameter. The following table describes the Caché collection types and lists their recommended Java projection types:

Collection Type Details Recommended Projection Type
Array
  • Contains an unordered set of key-value mappings. Resembles a Java hash map more closely than it does a Java array.
  • Can contain instances of data type classes, objects with no interdependencies, and relationship objects (objects with interdependencies).
java.util.Map
List
  • Contains an ordered list of data.
  • Can contain instances of data type classes, objects with no interdependencies, and relationship objects (objects with interdependencies).
java.util.List

Set the Java projection type for a Caché property using the property's JAVATYPE parameter. Set the parameter to the recommended projection type either through the Studio Inspector or directly in the property declaration. Here the projection type for PhoneNumbers has been set to java.util.Map:

Relationship PhoneNumbers As JavaTutorial.PhoneNumber
                    (JAVATYPE = "java.util.Map")
                            [ Cardinality = children, Inverse = Contact ];
Note:

To learn more about Caché collections, read the chapter “Working with Collections” in Using Caché Objects.

FeedbackOpens in a new tab