コード例 #1
0
        public short Run()
        {
            CommandPayload payload = new CommandPayload();

            payload.Type             = CommandPayloadType.Sql;
            payload.Text             = ToString();
            payload.NonTextLimit     = -1;
            payload.FetchPlan        = "";
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();

            operation.OperationMode  = OperationMode.Synchronous;
            operation.ClassType      = CommandClassType.NonIdempotent;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            var clusterId = short.Parse(result.ToDocument().GetField <string>("Content"));

            _connection.Database.AddCluster(_className, clusterId);

            if (_autoProperties)
            {
                CreateAutoProperties();
            }

            return(clusterId);
        }
コード例 #2
0
        public string Run()
        {
            OCluster cluster;
            var      defaultClusterId = _connection.Database.GetClusterIdFor(_className);

            if (defaultClusterId == -1)
            {
                CommandPayloadCommand payload = new CommandPayloadCommand();
                payload.Text = ToString();

                Command operation = new Command(_connection.Database);
                operation.OperationMode  = OperationMode.Synchronous;
                operation.CommandPayload = payload;
                var            doc    = _connection.ExecuteOperation(operation);
                OCommandResult result = new OCommandResult(doc);
//                var clusterId = short.Parse(result.ToDocument().GetField<string>("Content"));

                cluster = _connection.Database.AddCluster(new OCluster {
                    Name = _className
                });
            }
            else
            {
                cluster = _connection.Database.GetClusters().FirstOrDefault(c => c.Name == _className);
            }

            if (_autoProperties)
            {
                CreateAutoProperties();
            }

            return(cluster.Name);
        }
コード例 #3
0
        public short Run()
        {
            if (string.IsNullOrEmpty(_class))
            {
                throw new OException(OExceptionType.Query, "Class is empty");
            }

            CommandPayload payload = new CommandPayload();

            payload.Type             = CommandPayloadType.Sql;
            payload.Text             = ToString();
            payload.NonTextLimit     = -1;
            payload.FetchPlan        = "";
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();

            operation.OperationMode  = OperationMode.Synchronous;
            operation.ClassType      = CommandClassType.NonIdempotent;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return(short.Parse(result.ToDocument().GetField <string>("Content")));
        }
コード例 #4
0
        public ODocument Run()
        {
            CommandPayloadCommand payload = new CommandPayloadCommand();

            payload.Text = ToString();

            Command operation = new Command(_connection.Database);

            operation.OperationMode  = OperationMode.Synchronous;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return(result.ToSingle());
        }
コード例 #5
0
        public int Run()
        {
            CommandPayloadCommand payload = new CommandPayloadCommand();

            payload.Text = ToString();

            Command operation = new Command(_connection.Database);

            operation.OperationMode  = OperationMode.Synchronous;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return(int.Parse(result.ToDocument().GetField <string>("Content")));
        }
コード例 #6
0
        public short Run()
        {
            if (string.IsNullOrEmpty(_class))
                throw new OException(OExceptionType.Query, "Class is empty");

            CommandPayloadCommand payload = new CommandPayloadCommand();
            payload.Text = ToString();

            Command operation = new Command(_connection.Database);
            operation.OperationMode = OperationMode.Synchronous;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return short.Parse(result.ToDocument().GetField<string>("Content"));
        }
コード例 #7
0
        public List <ODocument> ToList(string fetchPlan)
        {
            CommandPayloadQuery payload = new CommandPayloadQuery();

            payload.Text         = ToString();
            payload.NonTextLimit = -1;
            payload.FetchPlan    = fetchPlan;
            //payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command(_connection.Database);

            operation.OperationMode  = OperationMode.Asynchronous;
            operation.CommandPayload = payload;

            OCommandResult commandResult = new OCommandResult(_connection.ExecuteOperation(operation));

            return(commandResult.ToList());
        }
コード例 #8
0
        public int Run()
        {
            CommandPayload payload = new CommandPayload();

            payload.Type             = CommandPayloadType.Sql;
            payload.Text             = ToString();
            payload.NonTextLimit     = -1;
            payload.FetchPlan        = "";
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();

            operation.OperationMode  = OperationMode.Synchronous;
            operation.ClassType      = CommandClassType.NonIdempotent;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation <Command>(operation));

            return(int.Parse(result.ToDocument().GetField <string>("Content")));
        }
コード例 #9
0
        public OVertex Run()
        {
            CommandPayload payload = new CommandPayload();

            payload.Type             = CommandPayloadType.Sql;
            payload.Text             = ToString();
            payload.NonTextLimit     = -1;
            payload.FetchPlan        = "";
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();

            operation.OperationMode  = OperationMode.Synchronous;
            operation.ClassType      = CommandClassType.NonIdempotent;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return(result.ToSingle().To <OVertex>());
        }
コード例 #10
0
        public List <ODocument> ToList(string fetchPlan)
        {
            CommandPayload payload = new CommandPayload();

            payload.Type             = CommandPayloadType.Sql;
            payload.Text             = ToString();
            payload.NonTextLimit     = -1;
            payload.FetchPlan        = fetchPlan;
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();

            operation.OperationMode  = OperationMode.Asynchronous;
            operation.ClassType      = CommandClassType.Idempotent;
            operation.CommandPayload = payload;

            OCommandResult commandResult = new OCommandResult(_connection.ExecuteOperation <Command>(operation));

            return(commandResult.ToList());
        }
コード例 #11
0
        public short Run()
        {
            if (string.IsNullOrEmpty(_class))
            {
                throw new OException(OExceptionType.Query, "Class is empty");
            }

            CommandPayloadCommand payload = new CommandPayloadCommand();

            payload.Text = ToString();

            Command operation = new Command(_connection.Database);

            operation.OperationMode  = OperationMode.Synchronous;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return(short.Parse(result.ToDocument().GetField <string>("Content")));
        }
コード例 #12
0
        public short Run()
        {
            if (string.IsNullOrEmpty(_class))
                throw new OException(OExceptionType.Query, "Class is empty");

            CommandPayload payload = new CommandPayload();
            payload.Type = CommandPayloadType.Sql;
            payload.Text = ToString();
            payload.NonTextLimit = -1;
            payload.FetchPlan = "";
            payload.SerializedParams = new byte[] { 0 };

            Command operation = new Command();
            operation.OperationMode = OperationMode.Synchronous;
            operation.ClassType = CommandClassType.NonIdempotent;
            operation.CommandPayload = payload;

            OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation));

            return short.Parse(result.ToDocument().GetField<string>("Content"));
        }