Hi,


I have a situation where I use a domain object as the source for a dataprovider. So to get the list of items for the data provider I am actually querying the domain object like:

    manager.getArtists();

Since the manager is a persistent object, I need to refresh it from the database. In my application I have worked around it by providing a Detachable<T> interface that allows transparent retrieval of the object:

public interface Detachable<T> extends Serializable {
   
    /**
     * Detaches the object.
     */
    void detach();
   
    /**
     * Gets the object, attaching it if needed.
     * @return
     */
    T get();

}

Now, I have two implementations of this:
1. an inmemory version that doest not detach (it is inmemory)
2. a hibernate version that always fetches the object using   Session.load(). Effectively using the hibernate cache.

In both cases, I am not depending on wicket calling attach or detach. When I looked at how to use the wicket functionality, I found that IDataProvider does not have attach() and detach(). Shouldn't there be an IDetachableDataProvider interface as well with attach() and detach() so that I can also use this wicket attach/detach functionality in a data provider?

Cheers
  Erik
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to