SoftReference.md 1.25 KB
Newer Older
1 2 3 4 5 6 7
---
name: Soft Reference
route: /SoftReference
menu: Documentation
submenu: Misc
---

8 9
import  themen  from 'theme/styles/styled-colors';
import  * as theme  from 'react-syntax-highlighter/dist/esm/styles/hljs';
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
import SyntaxHighlighter from 'react-syntax-highlighter';

# Entity Attribute Option: SoftReference

#### Background

Entity attributes are specified using attribute definitions. An attributes persistence strategy is determined by based on their type.

Primitive types are persisted as properties within the vertex of their parent.

Non-primitive attributes get a vertex of their own and and edge is created between the parent the child to establish ownership.

Attribute with _isSoftReference_ option set to _true_, is non-primitive attribute that gets treatment of a primitive attribute.

#### Specification

Below is an example of using the new attribute option.

28
<SyntaxHighlighter wrapLines={true} language="json" style={theme.dark}>
29 30 31 32 33 34 35 36 37 38 39
  {`"attributeDefs": [
      {
        "name": "replicatedFrom",
        "typeName": "array<AtlasServer>",
        "cardinality": "SET",
        "isIndexable": false,
        "isOptional": true,
        "isUnique": false,
        "options": {
          "isSoftReference": "true"
        }
40
      },...]`}
41
</SyntaxHighlighter>