org.appfuse.dao.ibatis.LookupDaoiBatis Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of appfuse-ibatis Show documentation
Show all versions of appfuse-ibatis Show documentation
AppFuse DAO backend implemented with iBATIS (http://ibatis.apache.org).
The newest version!
package org.appfuse.dao.ibatis;
import com.ibatis.sqlmap.client.SqlMapClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.appfuse.dao.LookupDao;
import org.appfuse.model.Role;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* iBatis implementation of LookupDao.
*
* @author Matt Raible
*/
@Repository
public class LookupDaoiBatis implements LookupDao {
private Log log = LogFactory.getLog(LookupDaoiBatis.class);
private SqlMapClientTemplate sqlMapClientTemplate = new SqlMapClientTemplate();
@Autowired
public final void setSqlMapClient(SqlMapClient sqlMapClient) {
this.sqlMapClientTemplate.setSqlMapClient(sqlMapClient);
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public List getRoles() {
log.debug("Retrieving all role names...");
return sqlMapClientTemplate.queryForList("getRoles", null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy