I want to use the @Repository Spring Annotation to avoid adding bean to reference.xml. Iibatis uses integration, so my repository class looks like this
@Repository ("userDao") public class UserDaoMybatis applies SqlMapClientDaoSupport UserDao {// ...}
SqlMapClientDaoSupport (Spring Library category) is the last method to install the required assets, which @Autowired or @Resourse
SqlMapClient Bean is defined in the spring reference. Xml if user Dao Bean is defined in XML then it works fine, but when I put the Repository annotation and delete the Bean Declaration then I get the following exception
java A methodology might be to add a new method such as @ etvoir injax SQLManClient (SQLMail client SQLMapclient) .lang.IllegalArgumentException: Property 'sqlMapClient' / Code>
{Set Asc Ulmatic Client (SQL Mapplet); }
But it looks ugly
Can someone inject property without defining any other way?
Public class AutowingsSqlMapClientDaoSupport SqlMapClientDaoSupport Expanded {@Autowired injectSqlMapClient (SqlMapClient sqlMapClient) {setSqlMapClient (sqlMapClient); }}
and then
@Repository ("userDao") applies the public class UserDaoMybatis AutoringSqlMapClientDaoSupport UserDao {// ...} SqlMapClientDaoSupport
, and if you are desperate to avoid injection hook in the DAO class, then I do not Think Better Can Do It
Comments
Post a Comment