| 1 24 package org.riotfamily.components.dao; 25 26 import java.util.Collection ; 27 28 import org.riotfamily.components.ComponentList; 29 import org.riotfamily.riot.dao.ListParams; 30 import org.riotfamily.riot.dao.support.RiotDaoAdapter; 31 import org.springframework.beans.factory.InitializingBean; 32 import org.springframework.dao.DataAccessException; 33 import org.springframework.util.Assert; 34 35 39 public class DirtyComponentListDao extends RiotDaoAdapter 40 implements InitializingBean { 41 42 private ComponentDao componentDao; 43 44 public DirtyComponentListDao() { 45 } 46 47 public void setComponentDao(ComponentDao componentDao) { 48 this.componentDao = componentDao; 49 } 50 51 public void afterPropertiesSet() throws Exception { 52 Assert.notNull(componentDao, "A ComponentDao must be set"); 53 } 54 55 public Collection list(Object parent, ListParams params) 56 throws DataAccessException { 57 58 return componentDao.findDirtyComponentLists(); 59 } 60 61 public String getObjectId(Object entity) { 62 return ((ComponentList) entity).getId().toString(); 63 } 64 65 public Object load(String id) throws DataAccessException { 66 return componentDao.loadComponentList(new Long (id)); 67 } 68 } 69 | Popular Tags |