You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[IllegalStateException: Property addition is not supported]] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:251) at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:178) at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:363) at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:361) at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:413) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) Caused by: java.lang.IllegalStateException: Property addition is not supported at org.apache.tinkerpop.gremlin.structure.Element$Exceptions.propertyAdditionNotSupported(Element.java:133) at org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex.property(DetachedVertex.java:91) at org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex.property(DetachedVertex.java:50) at gremlin.scala.ScalaElement.$anonfun$updateWith$2(ScalaElement.scala:76) at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:231) at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:462) at gremlin.scala.ScalaElement.updateWith(ScalaElement.scala:76) at gremlin.scala.ScalaElement.updateWith$(ScalaElement.scala:70) at gremlin.scala.ScalaVertex.updateWith(ScalaVertex.scala:8) at gremlin.scala.ScalaElement.updateAs(ScalaElement.scala:82)
Here are my models and the way I have defined it.
import java.util. UUID
import gremlin.scala.{Element, Marshallable, Vertex, id, label, underlying}
@label("trip")
case class TripModel(tripId: Option[String] = None,
name: String,
createdDate: java.time.Instant = java.time.Instant.now(),
startDate: java.time.Instant,
duration: Int,
totalAdults: Int,
totalChildrens: Int,
@underlying vertex: Option[Vertex] = None
)
object TripModel {
implicit val marshaller = new Marshallable[TripModel] {
def toCC(element: Element): TripModel = {
val tripId = Some(element.value[UUID]("tripId").toString)
val tripName = element.value[String]("name")
val duration = element.value[Int]("duration")
val totalAdults = element.value[Short]("totalAdults")
val totalChildren =element.value[Short]("totalChildrens")
val date = element.value[java.time.Instant]("createdDate")
val startDate = element.value[java.time.Instant]("startDate")
models.TripModel(tripId = tripId, name = tripName,
startDate = startDate, duration = duration,
totalAdults = totalAdults, totalChildrens = totalChildren, createdDate = date)
}
override def fromCC(cc: TripModel): FromCC = {
val values = Map("name" -> cc.name,
"createdDate" -> cc.createdDate,
"startDate" -> cc.startDate,
"duration"-> cc.duration,
"totalAdults" -> cc.totalAdults,
"totalChildrens" -> cc.totalChildrens,
"tripId" -> UUID.fromString(cc.tripId.get).toString)
FromCC(None, "trip", values)
}
}
}
And here is how I update a certain field.
def updateTripDetails(id:String, tripUpdate: UpdateTripRequest) = {
implicit val g = db.g
val item = db.g.V().has(KeyValue(tripId, id)).head
item.updateAs[TripModel](cc => cc.copy(name = tripUpdate.tripName.getOrElse(cc.name)))
}
What I am trying to do is to update a certain vertex property, however I always received the aforementioned error. is there any workaround for this?
The text was updated successfully, but these errors were encountered:
kyeljmd
changed the title
Updating a Property results into Property Addition Not Supported
Error when updating a vertex
Nov 29, 2018
Here is the error that I am encountering.
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[IllegalStateException: Property addition is not supported]] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:251) at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:178) at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:363) at play.core.server.AkkaHttpServer$$anonfun$1.applyOrElse(AkkaHttpServer.scala:361) at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:413) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12) Caused by: java.lang.IllegalStateException: Property addition is not supported at org.apache.tinkerpop.gremlin.structure.Element$Exceptions.propertyAdditionNotSupported(Element.java:133) at org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex.property(DetachedVertex.java:91) at org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex.property(DetachedVertex.java:50) at gremlin.scala.ScalaElement.$anonfun$updateWith$2(ScalaElement.scala:76) at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:231) at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:462) at gremlin.scala.ScalaElement.updateWith(ScalaElement.scala:76) at gremlin.scala.ScalaElement.updateWith$(ScalaElement.scala:70) at gremlin.scala.ScalaVertex.updateWith(ScalaVertex.scala:8) at gremlin.scala.ScalaElement.updateAs(ScalaElement.scala:82)
Here are my models and the way I have defined it.
And here is how I update a certain field.
What I am trying to do is to update a certain vertex property, however I always received the aforementioned error. is there any workaround for this?
The text was updated successfully, but these errors were encountered: