【问题标题】:Using a case class with map and nested case class with gremlin scala使用带有 map 的案例类和带有 gremlin scala 的嵌套案例类
【发布时间】:2018-07-02 17:27:25
【问题描述】:

如何为下面的case classnew Marshallable

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

取自 MarshallableSpec 来自 gremlin-scala 库。 SeqOption 无需创建 new Marshallable 即可工作,如文档中所述。

在定义此类顶点的架构时,映射和嵌套类的基数和数据类型应该是什么。

【问题讨论】:

    标签: scala gremlin janusgraph


    【解决方案1】:

    不支持开箱即用的地图,因为它们在图表中没有基础表示。 Tinkerpop3 中只有Cardinality.[single|list|set]

    【讨论】:

    • 感谢您的回复。有没有办法将 Map 或嵌套案例类序列化为 JSON 字符串(使用 Circe 或任何 json 库)并使用 Marshallable.对于这样的持久化非原始类型,您有什么建议?
    猜你喜欢
    • 1970-01-01
    • 2019-10-31
    • 1970-01-01
    • 1970-01-01
    • 2016-03-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-26
    相关资源
    最近更新 更多