File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
engine/src/main/java/com/arcadedb/query/sql/executor Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 2222import com .arcadedb .database .MutableDocument ;
2323import com .arcadedb .database .Record ;
2424import com .arcadedb .exception .TimeoutException ;
25+ import com .arcadedb .graph .MutableVertex ;
26+ import com .arcadedb .graph .Vertex ;
2527import com .arcadedb .schema .DocumentType ;
2628
2729/**
@@ -59,7 +61,14 @@ public Result next() {
5961 if (toCopy .isElement ()) {
6062 final Record docToCopy = toCopy .getElement ().get ().getRecord ();
6163
62- if (docToCopy instanceof Document document ) {
64+ if (docToCopy instanceof Vertex vertex ) {
65+ if (targetType != null ) {
66+ resultDoc = getContext ().getDatabase ().newVertex (targetType );
67+ } else {
68+ resultDoc = getContext ().getDatabase ().newVertex (vertex .getTypeName ());
69+ }
70+ ((MutableVertex ) resultDoc ).set (vertex .toMap (false ));
71+ } else if (docToCopy instanceof Document document ) {
6372 if (targetType != null ) {
6473 resultDoc = getContext ().getDatabase ().newDocument (targetType );
6574 } else {
You can’t perform that action at this time.
0 commit comments