microsoft-azure-storage-samples/src/com/microsoft/azure/storage/samples/table/TableGettingStartedTask.java
public void BasicBatch() throws StorageException {
        // Note: the limitations on a batch operation are
        // - up to 100 operations
        // - all operations must share the same PartitionKey
        // - if a retrieve is used it can be the only operation in the batch
        // - the serialized batch payload must be 4 MB or less

        // Define a batch operation.
        TableBatchOperation batchOperation = new TableBatchOperation();

        // Create a customer entity to add to the table.
        CustomerEntity customer = new CustomerEntity("Smith", "Jeff");
        customer.setEmail("Jeff@contoso.com");
        customer.setPhoneNumber("425-555-0104");
        batchOperation.insert(customer);

        // Create another customer entity to add to the table.
        CustomerEntity customer2 = new CustomerEntity("Smith", "Ben");
        customer2.setEmail("Ben@contoso.com");
        customer2.setPhoneNumber("425-555-0102");
        batchOperation.insert(customer2);

        // Create a third customer entity to add to the table.
        CustomerEntity customer3 = new CustomerEntity("Smith", "Denise");
        customer3.setEmail("Denise@contoso.com");
        customer3.setPhoneNumber("425-555-0103");
        batchOperation.insert(customer3);

        // Execute the batch of operations on the "tablebasics" table.
        table.execute(batchOperation);
    }
public void BasicBatch() throws StorageException {
        // Note: the limitations on a batch operation are
        // - up to 100 operations
        // - all operations must share the same PartitionKey
        // - if a retrieve is used it can be the only operation in the batch
        // - the serialized batch payload must be 4 MB or less

        // Define a batch operation.
        TableBatchOperation batchOperation = new TableBatchOperation();

        // Create a customer entity to add to the table.
        CustomerEntity customer = new CustomerEntity("Smith", "Jeff");
        customer.setEmail("Jeff@contoso.com");
        customer.setPhoneNumber("425-555-0104");
        batchOperation.insert(customer);

        // Create another customer entity to add to the table.
        CustomerEntity customer2 = new CustomerEntity("Smith", "Ben");
        customer2.setEmail("Ben@contoso.com");
        customer2.setPhoneNumber("425-555-0102");
        batchOperation.insert(customer2);

        // Create a third customer entity to add to the table.
        CustomerEntity customer3 = new CustomerEntity("Smith", "Denise");
        customer3.setEmail("Denise@contoso.com");
        customer3.setPhoneNumber("425-555-0103");
        batchOperation.insert(customer3);

        // Execute the batch of operations on the "tablebasics" table.
        table.execute(batchOperation);
    }
public void BasicBatch ( ) throws StorageException { // Note: the limitations on a batch operation are // - up to 100 operations // - all operations must share the same PartitionKey // - if a retrieve is used it can be the only operation in the batch // - the serialized batch payload must be 4 MB or less // Define a batch operation. TableBatchOperation batchOperation = new TableBatchOperation ( ) ; // Create a customer entity to add to the table. CustomerEntity customer = new CustomerEntity ( "Smith" , "Jeff" ) ; customer . setEmail ( "Jeff@contoso.com" ) ; customer . setPhoneNumber ( "425-555-0104" ) ; batchOperation . insert ( customer ) ; // Create another customer entity to add to the table. CustomerEntity customer2 = new CustomerEntity ( "Smith" , "Ben" ) ; customer2 . setEmail ( "Ben@contoso.com" ) ; customer2 . setPhoneNumber ( "425-555-0102" ) ; batchOperation . insert ( customer2 ) ; // Create a third customer entity to add to the table. CustomerEntity customer3 = new CustomerEntity ( "Smith" , "Denise" ) ; customer3 . setEmail ( "Denise@contoso.com" ) ; customer3 . setPhoneNumber ( "425-555-0103" ) ; batchOperation . insert ( customer3 ) ; // Execute the batch of operations on the "tablebasics" table. table . execute ( batchOperation ) ; }
Illustrates how to form and execute a batch operation.

@throws StorageException
Illustrates how to form and execute a batch operation .