简体   繁体   English

在地图上使用案例类,在格雷姆斯卡拉使用嵌套案例类

[英]Using a case class with map and nested case class with gremlin scala

How to write new Marshallable for the below case class . 如何为以下案例类编写new Marshallable

case class CCWithLabelAndId(
  s: String,
  @id id: Int,
  l: Long,
  o: Option[String],
  seq: Seq[String],
  map: Map[String, String],
  nested: NestedClass)

Taken from MarshallableSpec from gremlin-scala library. 取自gremlin-scala库的MarshallableSpec Seq and Option works without creating new Marshallable as explained in the documentation. SeqOption无需创建new Marshallable如文档中所述。

Also what should be cardinality and datatype for map and nested classes when defining the schema of such vertexes. 定义此类顶点的架构时,映射和嵌套类的基数和数据类型也应该是什么。

Maps are not supported out of the box, because they don't have an underlying representation in the graph. 开箱即用不支持地图,因为它们在图形中没有基础表示。 There's only Cardinality.[single|list|set] in Tinkerpop3. Tinkerpop3中只有Cardinality.[single|list|set]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM