Note that if the IDataProvider implementation implements IDetachable interface, the detach() method will be called at the end of request.
Example:
class UsersProvider implements IDataProvider() { Iterator iterator(int first, int count) { ((MyApplication)Application.get()).getUserDao().iterator(first, count); } int size() { ((MyApplication)Application.get()).getUserDao().getCount(); } IModel model(Object object) { return new DetachableUserModel((User)object); } }
Note that if the IDataProvider implementation implements IDetachable interface, the detach() method will be called at the end of request.
Example:
class UsersProvider implements IDataProvider() { Iterator iterator(int first, int count) { ((MyApplication)Application.get()).getUserDao().iterator(first, count); } int size() { ((MyApplication)Application.get()).getUserDao().getCount(); } IModel model(Object object) { return new DetachableUserModel((User)object); } }