forked from codingfinest/neo4j-go-ogm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerics.go
59 lines (52 loc) · 1.86 KB
/
generics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package gogm
//VersionParts represents the part of a version string that is affected by a given change.
//
//Based on format: 1.0.0
type VersionParts int //@name VersionParts
//Enum represents the part of a version string that is affected by a given change.
const (
Major VersionParts = 0
Minor VersionParts = 1
Patch VersionParts = 2
)
//DataOperationType represents the type of data operation neo4j should perform.
//
type DataOperationType int //@name VersionParts
//Enum represents the part of a version string that is affected by a given change.
const (
Upsert DataOperationType = 0
Delete DataOperationType = 1
Unknown DataOperationType = 3
)
type LocateTarget string
const (
StartNode LocateTarget = `startNode`
EndNode LocateTarget = `endNode`
Entity LocateTarget = `entity`
)
//LookupValueSource represents the origin of a lookup value.
type LookupValueSource string
const (
From = `from` //Represents a value that was provided by the From (start) node on a relationship.
To = `to` //Represents a value that was provided by the To (end) node on a relationship.
Unique = `unique` //Represents a value that should be referenced as a standalone value. Either for individual entities or rich relationships
)
//Interface definition allowing for conversion between entities and unified reference behavior
//for all implementers.
type Member interface {
GetAndTrySetInnerRef(any) any
CopyDataToMember(data map[string]any) Member
TransitionMemberState(*[]Member)
GetLookupValue() (int, map[LookupValueSource][]string)
GetLookupKey() *string
Persist(session *SessionImpl) error
GetDescriptor() *string
IsDirty() bool
SetIsDirty(value bool)
Clean()
GetDataOperationType() DataOperationType
RequiredVersionUpdate() *VersionParts
GetID() *int64
Locate(key string, value string, targetComponent LocateTarget) string
GetSuppressedVersionUpdates() bool
}