Skip to content

Commit 138c7cb

Browse files
committed
Further VertexDsl and GraphDsl improvements
* get property from vertex (optional) * get mandatory property from vertex (nullable) * get existing vertex type (optional) * renamed DSL types * refactored wrappers * updated readme / examples * scaladoc improvements
1 parent cd6a9dc commit 138c7cb

File tree

13 files changed

+133
-2379
lines changed

13 files changed

+133
-2379
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ val g = new OrientGraphFactory("memory:orientDbScalaDslTest").getNoTx
8484
// add vertex
8585
g.dsl addVertex "Person" withProperty "name" -> "Frank"
8686
g.dsl addVertex "Customer" withProperty "name" -> "ACME" and "active" -> true
87+
g.dsl addVertex "Customer" withProperty "name" -> Some("ACME") and "active" -> None // only "name" is persisted
88+
g.dsl addVertex "Customer" withProperty "name" -> null // ugly, but no exception - don't work with null in Scala ;)
8789

8890
// find & filter
8991
g.dsl findVertices "City" single()
@@ -94,6 +96,12 @@ g.dsl findVertices "City" filter "name" -> "Zurich" list() take 3 // Iterable[Ve
9496
// edit existing
9597
val existing = g.dsl findVertices "Customer" single()
9698
existing foreach(_ withProperty "name" -> "ACME Software Solutions" and "year" -> 2017)
99+
100+
// get property
101+
val name: Option[String] = existing.flatMap(v => v.property[String]("name"))
102+
103+
// get mandatory property (nullable) - only use this with schema
104+
val name2: String = existing.map(v => v.mandatoryProperty[String]("name")).orNull
97105
```
98106

99107
Get Involved

docs/api/2.11/ch/acmesoftware/orientDbScalaDsl/OrientGraphDsl.html

Lines changed: 0 additions & 593 deletions
This file was deleted.

docs/api/2.11/ch/acmesoftware/orientDbScalaDsl/OrientVertexTypeDsl$.html

Lines changed: 0 additions & 504 deletions
This file was deleted.

docs/api/2.11/ch/acmesoftware/orientDbScalaDsl/OrientVertexTypeDsl.html

Lines changed: 0 additions & 556 deletions
This file was deleted.

docs/api/2.11/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<div class="ui-west-center">
2626
<div id="filter">
2727
<div id="textfilter"></div>
28-
<div id="letters"><span>#</span><a target="template" href="index/index-a.html">A</a><span>B</span><a target="template" href="index/index-c.html">C</a><a target="template" href="index/index-d.html">D</a><span>E</span><a target="template" href="index/index-f.html">F</a><span>G</span><span>H</span><span>I</span><span>J</span><span>K</span><a target="template" href="index/index-l.html">L</a><span>M</span><span>N</span><a target="template" href="index/index-o.html">O</a><a target="template" href="index/index-p.html">P</a><span>Q</span><span>R</span><a target="template" href="index/index-s.html">S</a><span>T</span><a target="template" href="index/index-u.html">U</a><a target="template" href="index/index-v.html">V</a><a target="template" href="index/index-w.html">W</a><span>X</span><span>Y</span><span>Z</span><span>deprecated</span></div>
28+
<div id="letters"><span>#</span><a target="template" href="index/index-a.html">A</a><span>B</span><a target="template" href="index/index-c.html">C</a><a target="template" href="index/index-d.html">D</a><span>E</span><a target="template" href="index/index-f.html">F</a><a target="template" href="index/index-g.html">G</a><span>H</span><span>I</span><span>J</span><span>K</span><a target="template" href="index/index-l.html">L</a><a target="template" href="index/index-m.html">M</a><span>N</span><a target="template" href="index/index-o.html">O</a><a target="template" href="index/index-p.html">P</a><span>Q</span><span>R</span><a target="template" href="index/index-s.html">S</a><span>T</span><a target="template" href="index/index-u.html">U</a><a target="template" href="index/index-v.html">V</a><a target="template" href="index/index-w.html">W</a><span>X</span><span>Y</span><span>Z</span><span>deprecated</span></div>
2929
</div>
3030
<div class="pack" id="tpl">
3131

@@ -38,7 +38,7 @@
3838
<ol class="templates"></ol>
3939
<ol class="packages"> <li class="pack" title="ch.acmesoftware.orientDbScalaDsl">
4040
<a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package.html" target="template">ch.acmesoftware.orientDbScalaDsl</a>
41-
<ol class="templates"><li title="ch.acmesoftware.orientDbScalaDsl.OrientGraphDsl"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/OrientGraphDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientGraphDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientGraphNoTxWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$OrientGraphNoTxWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientGraphNoTxWrapper</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientGraphWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$OrientGraphWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientGraphWrapper</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientVertexTypeDsl"><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/OrientVertexTypeDsl$.html" target="template"><span class="object">(object)</span></a><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/OrientVertexTypeDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientVertexTypeDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientVertexTypeWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$OrientVertexTypeWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientVertexTypeWrapper</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.VertexDsl"><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexDsl$.html" target="template"><span class="object">(object)</span></a><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">VertexDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.VertexWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$VertexWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">VertexWrapper</span></a></li></ol>
41+
<ol class="templates"><li title="ch.acmesoftware.orientDbScalaDsl.GraphDsl"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/GraphDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">GraphDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientGraphWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$OrientGraphWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientGraphWrapper</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.OrientVertexTypeWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$OrientVertexTypeWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">OrientVertexTypeWrapper</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.VertexDsl"><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexDsl$.html" target="template"><span class="object">(object)</span></a><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">VertexDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.VertexTypeDsl"><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexTypeDsl$.html" target="template"><span class="object">(object)</span></a><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/VertexTypeDsl.html" target="template"><span class="class">(class)</span><span class="tplLink">VertexTypeDsl</span></a></li><li title="ch.acmesoftware.orientDbScalaDsl.VertexWrapper"><div class="placeholder"></div><a class="tplshow" href="ch/acmesoftware/orientDbScalaDsl/package$$VertexWrapper.html" target="template"><span class="class">(class)</span><span class="tplLink">VertexWrapper</span></a></li></ol>
4242
<ol class="packages"> </ol>
4343
</li></ol>
4444
</li></ol>

0 commit comments

Comments
 (0)