On May 29, 2008, at 8:51 PM, James Carman wrote:

I don't think the proxy stuff is your problem.  Is your DAO class
interface-based (it should be).  Meaning, do you have a DAO interface
that your implementation class implements (this part is key)?


Yes, the classes are interface-based. Eg.,

public class ProtocolDAO extends JpaDaoSupport implements IProtocolDAO

I think it's down to fiuring out what I've done wrong in my Panel. I get a classcastexception at the "(Protocol) item.getModelObject();" line. Listed below is both my Panel and the appropriate signature from ProtocolDAO.findAll().

public class ShowProtocolsPanel extends Panel {
    @SpringBean(name="ProtocolDAO")
    private ProtocolDAO dao;

    public ShowProtocolsPanel(String id) {
        super(id);

        IModel protocolModel = new LoadableDetachableModel() {
            protected Object load() {
                return dao.findAll();
            }
        };

        add(new ListView("eachItem", protocolModel) {
            @Override protected void populateItem(ListItem item) {
final Protocol protocol = (Protocol) item.getModelObject();

                item.add(new Label("keyword", protocol.getKeyword()));
item.add(new Label("description", protocol.getDescription()));
            }
        });
    }
}


public class ProtocolDAO extends JpaDaoSupport implements IProtocolDAO {
...
   @Transactional(readOnly = true)
    @SuppressWarnings("unchecked")
    @Override
    public List<Protocol> findAll(final int... rowStartIdxAndCount) {
         ...
     }
     ...
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to