简体   繁体   中英

Using a case class with map and nested case class with gremlin scala

How to write new Marshallable for the below case class .

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. Seq and Option works without creating new Marshallable as explained in the documentation.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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