org.wicketopia.domdrides.model
Class LoadableDetachableEntityModel<EntityType extends org.domdrides.entity.Entity<IdType>,IdType extends Serializable>

java.lang.Object
  extended by org.apache.wicket.model.LoadableDetachableModel<EntityType>
      extended by 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

Constructor Summary
LoadableDetachableEntityModel(org.domdrides.repository.Repository<EntityType,IdType> repository, EntityType entity)
          Creates a model pre-loaded with the specified entity.
LoadableDetachableEntityModel(org.domdrides.repository.Repository<EntityType,IdType> repository, IdType id)
          Creates a model that lazily loads an entity by id from the specified repository.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 repository
id - 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 repository
entity - the entity
Method Detail

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.