So generate a detach() methods that looks up all the fields and do what on those? I guess if that is a detachable call it through and annotate other fields that should be set to null?
so i we have this class @detachable MyModel { private IModel innerModel; private @detach Object myVar; private Object id; } that is the same as class MyModel { private IModel innerModel; private myVar; private Object id; void detach() { innerModel.detach(); myVar= null; } } but then somewhere you have to make sure that the id is set On Tue, Dec 1, 2009 at 11:41, Martijn Dashorst <martijn.dasho...@gmail.com>wrote: > Not sure if it will fly, but couldn't we utilize the same tech as > project lombok [1] uses to automatically generate detach code for > IDetachables? > > Note that I have no idea if it will work, but considering they are > able to generate try/finally blocks, we might be able to do something > similar. > > Martijn > > [1] http://projectlombok.org >