Examples of NdbOperation


Examples of com.mysql.cluster.ndbj.NdbOperation

                       boolean setAttrs, boolean batch)
        throws NdbApiException {
        beginTransaction();
        for (int i = from; i <= to; i++) {
            // get an insert operation for the table
            final NdbOperation op = tx.getInsertOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // set other attributes
            if (setAttrs) {
                op.setInt(model.name_cint, -i);
                op.setLong(model.name_clong, -i);
                op.setFloat(model.name_cfloat, -i);
                op.setDouble(model.name_cdouble, -i);
            }

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

                           boolean batch)
        throws NdbApiException {
        beginTransaction();
        for (int i = from; i <= to; i++) {
            // get a delete operation for the table
            final NdbOperation op = tx.getDeleteOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

                           boolean batch)
        throws NdbApiException {
        beginTransaction();
        for (int i = from; i <= to; i++) {
            // get an insert operation for the table
            final NdbOperation op = tx.getUpdateOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // set other attributes
            op.setInt(model.name_cint, i);
            op.setLong(model.name_clong, i);
            op.setFloat(model.name_cfloat, i);
            op.setDouble(model.name_cdouble, i);

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

    protected void testBrokenGetValueByIndex()
        throws NdbApiException {
        assert tx == null;
        tx = ndb.startTransaction();
        assert tx != null;
        NdbOperation op = tx.getSelectOperation(model.table_A);
        assert op != null;
        final int int_val = 1;
        op.equalInt("id", int_val);
        op.getValue("id"); // XXX error with index instead of "id"
        final NdbResultSet rs = op.resultData();
        tx.execute(ExecType.Commit, AbortOption.AbortOnError, true);
        while (rs.next()) {
            int id = rs.getInt("id"); // XXX error with index instead of "id"
            assert id == int_val;
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

        final NdbResultSet[] rss = new NdbResultSet[count];

        beginTransaction();
        for (int i = 0, j = from; i < count; i++, j++) {
            // get a read operation for the table
            NdbOperation op = tx.getSelectOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, j);

            // define fetched attributes
            op.getValue(model.name_id);
            fetchCommonAttributes(op);

            // get attributes (not readable until after commit)
            rss[i] = op.resultData();

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

                                boolean batch, byte[] bytes)
        throws NdbApiException {
        beginTransaction();
        for (int i = from; i <= to; i++) {
            // get an update operation for the table
            final NdbOperation op = tx.getUpdateOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // set varbinary
            op.setBytes(model.name_B0_cvarbinary_def, bytes);

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

                              boolean batch, String string)
        throws NdbApiException {
        beginTransaction();
        for (int i = from; i <= to; i++) {
            // get an update operation for the table
            final NdbOperation op = tx.getUpdateOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // set varchar
            op.setString(model.name_B0_cvarchar_def, string);

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

        final NdbResultSet[] rss = new NdbResultSet[count];

        beginTransaction();
        for (int i = 0, j = from; i < count; i++, j++) {
            // get a read operation for the table
            NdbOperation op = tx.getSelectOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, j);

            // define fetched attributes
            op.getValue(model.name_B0_cvarbinary_def);

            // get attributes (not readable until after commit)
            rss[i] = op.resultData();

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

        final NdbResultSet[] rss = new NdbResultSet[count];

        beginTransaction();
        for (int i = 0, j = from; i < count; i++, j++) {
            // get a read operation for the table
            NdbOperation op = tx.getSelectOperation(table);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, j);

            // define fetched attributes
            op.getValue(model.name_B0_cvarchar_def);

            // get attributes (not readable until after commit)
            rss[i] = op.resultData();

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here

Examples of com.mysql.cluster.ndbj.NdbOperation

                            boolean batch)
        throws NdbApiException {
        beginTransaction();
        for (int i = 1; i <= nOps; i++) {
            // get an update operation for the table
            final NdbOperation op = tx.getUpdateOperation(model.table_B0);
            assert op != null;

            // set key attribute
            op.equalInt(model.name_id, i);

            // set a_id attribute
            int a_id = ((i - 1) % nOps) + 1;
            op.setInt(model.name_B0_a_id, a_id);

            // execute the operation now if in non-batching mode
            if (!batch)
                executeOperations();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.