]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.charts/src/org/simantics/charts/query/SetProperty.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.charts / src / org / simantics / charts / query / SetProperty.java
diff --git a/bundles/org.simantics.charts/src/org/simantics/charts/query/SetProperty.java b/bundles/org.simantics.charts/src/org/simantics/charts/query/SetProperty.java
new file mode 100644 (file)
index 0000000..0d9b843
--- /dev/null
@@ -0,0 +1,31 @@
+package org.simantics.charts.query;\r
+\r
+import org.simantics.databoard.binding.Binding;\r
+import org.simantics.db.Resource;\r
+import org.simantics.db.WriteGraph;\r
+import org.simantics.db.common.request.WriteRequest;\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+/**\r
+ * @author Tuukka Lehtonen\r
+ */\r
+public class SetProperty extends WriteRequest {\r
+\r
+    private Resource entity;\r
+    private Resource property;\r
+    private Object value;\r
+    private Binding binding;\r
+\r
+    public SetProperty(Resource entity, Resource property, Object value, Binding binding) {\r
+        this.entity = entity;\r
+        this.property = property;\r
+        this.value = value;\r
+        this.binding = binding;\r
+    }\r
+\r
+    @Override\r
+    public void perform(WriteGraph graph) throws DatabaseException {\r
+        graph.claimLiteral(entity, property, value, binding);\r
+    }\r
+\r
+}\r