对于框架注解的理解



spring3.0 注解的访问顺序:

<context:component-scan base-package="com.mapbar" />

@Scope("prototype")
@Controller("userAction")
public class UserAction

@Resource(name = "userService")
setUserService


             @Service("userService")
---->>>>>    public class UserService

@Resource(name = "userDao")
setUserDao


            @Repository("userDao")
---->>>>    public interface IUserDao

    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.mapbar.dao" />
    </bean>

mybatis 浏览包下面的 接口自动生成实例spring3.0 注解的访问顺序:

<context:component-scan base-package="com.mapbar" />

@Scope("prototype")
@Controller("userAction")
public class UserAction

@Resource(name = "userService")
setUserService


             @Service("userService")
---->>>>>    public class UserService

@Resource(name = "userDao")
setUserDao


            @Repository("userDao")
---->>>>    public interface IUserDao

    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <property name="basePackage" value="com.mapbar.dao" />
    </bean>

mybatis 浏览包下面的 接口自动生成实例




你可能感兴趣的:(框架)