UpdateableDataContext interface is a sub-interface of DataContext, and represents any DataContext that is capable of making changes/updates to the data.
The single method for doing updates is executeUpdate(UpdateScript). The UpdateScript argument describes the sequence of updates that you want to perform.
There are a number of built-in implementations of UpdateScript which provide out-of-the-box single/atomic updates:
Custom update script
You can also bundle together updates into a single update script. This will typically mean that transactional attributes are improved and resources remain open during the update, a bit depending on the datastore / DataContext implementation.
Notice also that the UpdateScript interface is a single-method-interface (SAM). This means that from Java 8 and forward, you should be able to provide a closure here instead of an anonymous inner class.
You may be interested in:
- Schema and table semantics - to see what it means to "create a table" in different implementations.