zoukankan      html  css  js  c++  java
  • @Param注解的使用

    在SSM框架中,@Param主要是用来注解dao类中方法的参数,便于在对应的dao.xml文件中引用,如:在userDAO类中有这么一个函数:

    public User selectByNameAndPwd(@Param("userName") String name,@Param("Password") String )

    在其对应的dao.xml文件中的查询语句则为:

    select  username,password from user where username=${userName} and  password=${Password}

    注:在不使用@Param注解的时候,函数的参数只能为一个,并且在查询语句取值时只能用#{},且其所属的类必须为Javabean,而使用@Param注解则可以使用多个参数,在查询语句中使用时可以使用#{}或者${}



    参考:@Param注解的使用

  • 相关阅读:
    Bundle Adjustment
    BFL ekf imu and odom
    RNN
    深度学习的数学(笔记)
    BP 神经网络
    PCA
    SVM
    KNN
    Kmeans
    决策树
  • 原文地址:https://www.cnblogs.com/aspirant/p/12155221.html
Copyright © 2011-2022 走看看