O'Reilly logo

Java™ Data Objects by Robin M. Roos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.6. InstanceCallbacks

The above discussion about the required and optional states and state transitions should have given you a good feel for the way an application invokes the PersistenceManager in order to manipulate instances. We will look at this in more detail in Chapter 6. The final topic for this chapter illustrates how instances can be made aware of specific lifecycle events occurring to them, so that the application developer can invoke an appropriate action if required.

InstanceCallbacks is itself an interface containing four method signatures. Classes implementing the interface must provide implementations of the callback methods explicitly – the enhancer will not undertake this task. The JDO implementation will then invoke the callback ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required