public class ActivityAction extends CoreAction { private static final Logger log = Logger.getLogger(ActivityAction.class); @Autowired private ActivityMng activityMng;
@Service @Transactional public class ActivityMngImpl extends CoreManagerImpl<Activity> implements ActivityMng{ @Autowired public void setDao(ActivityDao dao) { super.setDao(dao); } public ActivityDao getDao() { return (ActivityDao) super.getDao(); } public Activity findByName(String name) { return getDao().findByName(name); }
import org.springframework.stereotype.Repository; import com.leadtone.ssh2.core.CoreDaoImpl; import com.wangzhongsoft.fanliwang.activity.activity.dao.ActivityDao; import com.wangzhongsoft.fanliwang.activity.activity.entity.Activity; @Repository public class ActivityDaoImpl extends CoreDaoImpl<Activity> implements ActivityDao { public Activity findByName(String name) { String hql="from Activity a where a.name like ‘%"+name+"%‘"; return (Activity) findUnique(hql); } }
时间: 2024-10-19 12:01:39