Skip to content

GremlinScala.hasLabel[CC <: Product: ru.WeakTypeTag]() Fails when label annotation is not a literal #252

@jeremysears

Description

@jeremysears

We have some case classes defined like so:

object VertexLabel {
  MyCCLabel = "com.example.domain.MyCC"
  // other vertex labels...
}
@label(VertexLabel.MyCCLabel)
case class MyCC(val foo: String) extends DomainRoot

Queries like this fail:
graph.V().hasLabel[MyCC]

The GremlinScala.hasLabel[CC <: Product: ru.WeakTypeTag]() implementation assumes that a literal string will be passed to the @label annotation (e.g. @Label("my.domain.Class")). It parses the annotation tree looking for a begin quote. In our case, we are instead passing a reference to a constant value.

I'll push up a PR with a fix.

@mpollmeier, Thank you again for your great work on this lib!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions