Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The interface is meant for you to implement on your own in order to define the series of changes (script) that you wish to commit to the underlying database. You do this in a manner like this:  

...

Code Block
languagejava
dataContext.executeUpdate(new UpdateScript() {

...

	public void run(UpdateCallback callback) {

...

		// Perform updates here by calling methods on 'callback'.

...

	}

...

});

You can optionally choose to use the BatchUpdateCallback class the BatchUpdateCallback class which may be beneficial in certain situations. See for example JdbcDataContext for example JdbcDataContext for details about JDBC batch updates.  

In addition there are a few single-update implementations available for you to use:  

  • InsertInto
     
  • Update
     
  • DeleteFrom
     
  • CreateTable
     
  • DropTable
      

These classes all implement UpdateScript with implement UpdateScript with the intent of doing a single atomic change only.