Is case class mapping (like in gremlin-scala) supported / on the roadmap?
The API looks like it's possible, but during compile the following error occures:
Error:(19, 19) not found: value <none>
val v = graph + example
The following test reproduces the behavior (more or less c&p from gremlin-scala readme):
import gremlin.scala._
import org.apache.tinkerpop.gremlin.orientdb.OrientGraphFactory
import org.scalatest.{FlatSpec, Matchers}
class CaseClassSpec extends FlatSpec with Matchers {
"OrientDb-Gremlin" should "be able to Marshall case-classes" in {
case class Example(id: Option[Int],
longValue: Long,
stringValue: Option[String])
val graph = new OrientGraphFactory("memory:test").getNoTx.asScala
val example = Example(None, Long.MaxValue, Some("optional value"))
val v = graph + example
v.toCC[Example] // equal to `example`, but with id set
// find all vertices with the label of the case class `Example`
graph.V.hasLabel[Example]
// modify the vertex like a case class
v.updateAs[Example](_.copy(longValue = 0L))
}
}
Is case class mapping (like in gremlin-scala) supported / on the roadmap?
The API looks like it's possible, but during compile the following error occures:
The following test reproduces the behavior (more or less c&p from gremlin-scala readme):