-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathexistential_subquery.go
More file actions
66 lines (54 loc) · 1.35 KB
/
existential_subquery.go
File metadata and controls
66 lines (54 loc) · 1.35 KB
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
60
61
62
63
64
65
66
package cypher
type ExistentialSubquery struct {
ConditionContainer
fragment MatchPhrase
key string
notNil bool
err error
}
func ExistentialSubqueryCreate(fragment MatchPhrase) ExistentialSubquery {
if fragment.GetError() != nil {
return ExistentialSubqueryError(fragment.GetError())
}
e := ExistentialSubquery{
fragment: fragment,
notNil: true,
}
e.key = getAddress(&e)
e.ConditionContainer = ConditionWrap(e)
return e
}
func ExistentialSubqueryError(err error) ExistentialSubquery {
return ExistentialSubquery{
err: err,
}
}
func ExistentialSubqueryExists(fragment MatchPhrase) ExistentialSubquery {
return ExistentialSubqueryCreate(fragment)
}
func (e ExistentialSubquery) GetError() error {
return e.err
}
func (e ExistentialSubquery) accept(visitor *CypherRenderer) {
visitor.enter(e)
e.fragment.accept(visitor)
visitor.leave(e)
}
func (e ExistentialSubquery) enter(renderer *CypherRenderer) {
renderer.append("EXISTS {")
}
func (e ExistentialSubquery) leave(renderer *CypherRenderer) {
renderer.append("}")
}
func (e ExistentialSubquery) getKey() string {
return e.key
}
func (e ExistentialSubquery) isNotNil() bool {
return e.notNil
}
func (e ExistentialSubquery) GetExpressionType() ExpressionType {
panic("implement me")
}
func (e ExistentialSubquery) getConditionType() string {
return "ExistentialSubquery"
}