org.wicketopia.domdrides.model
Class LoadableDetachableEntityModel<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>
java.lang.Object
org.apache.wicket.model.LoadableDetachableModel<EntityType>
org.wicketopia.domdrides.model.LoadableDetachableEntityModel<EntityType,IdType>
- All Implemented Interfaces:
- Serializable, org.apache.wicket.model.IDetachable, org.apache.wicket.model.IModel<EntityType>, org.apache.wicket.util.io.IClusterable
public class LoadableDetachableEntityModel<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>
- extends org.apache.wicket.model.LoadableDetachableModel<EntityType>
An implementation of LoadableDetachableModel
which loads an entity from a Repository
.
- Since:
- 1.1
- See Also:
- Serialized Form
Method Summary |
protected EntityType |
load()
Loads the entity from the repository. |
Methods inherited from class org.apache.wicket.model.LoadableDetachableModel |
detach, getObject, isAttached, onAttach, onDetach, setObject, toString |
LoadableDetachableEntityModel
public LoadableDetachableEntityModel(org.domdrides.repository.Repository<EntityType,IdType> repository,
IdType id)
- Creates a model that lazily loads an entity by id from the specified repository.
- Parameters:
repository
- the repositoryid
- the id
LoadableDetachableEntityModel
public LoadableDetachableEntityModel(org.domdrides.repository.Repository<EntityType,IdType> repository,
EntityType entity)
- Creates a model pre-loaded with the specified entity.
- Parameters:
repository
- the repositoryentity
- the entity
load
protected EntityType load()
- Loads the entity from the repository.
- Specified by:
load
in class org.apache.wicket.model.LoadableDetachableModel<EntityType extends org.domdrides.entity.Entity<IdType>>
- Returns:
- the entity
Copyright © 2010-2013. All Rights Reserved.