Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def addLocation(map: Map[String, Any]): Future[mutable.Map[String, AnyRef]] = {
- assert(map.contains("id"), "an id is required")
- futurePool{
- val g = OrientDatabase.graph
- try {
- val vertex: Vertex = g.addVertex("Class:Location", null)
- map.foreach{
- case (key, value) =>
- vertex.setProperty(key, value)
- case _ =>
- logger.debug("wat!")
- }
- g.commit()
- vertexPropertyMapping(vertex.asInstanceOf[OrientVertex])
- } catch {
- case t: Throwable =>
- g.rollback()
- throw t
- } finally {
- g.shutdown()
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement