MappedStatement封装select等CRUD标签的信息,包括CRUD标签的ID,参数类型class,返回值类型class,CRUD标签类型,封装sql等。

    1. package com.example.aninbatis.config;
    2. import com.example.aninbatis.sqlsource.SqlSource;
    3. /**
    4. * 封装select等CRUD标签的信息
    5. */
    6. public class MappedStatement {
    7. /**
    8. * CRUD标签的ID
    9. */
    10. private String statementId;
    11. /**
    12. * 参数类型class
    13. */
    14. private Class<?> parameterTypeClass;
    15. /**
    16. * 返回值类型class
    17. */
    18. private Class<?> resultTypeClass;
    19. /**
    20. * CRUD标签类型
    21. */
    22. private String statementType;
    23. /**
    24. * 封装sql
    25. */
    26. private SqlSource sqlSource;
    27. public MappedStatement(String statementId, Class<?> parameterTypeClass, Class<?> resultTypeClass,
    28. String statementType, SqlSource sqlSource) {
    29. this.statementId = statementId;
    30. this.parameterTypeClass = parameterTypeClass;
    31. this.resultTypeClass = resultTypeClass;
    32. this.statementType = statementType;
    33. this.sqlSource = sqlSource;
    34. }
    35. public String getStatementId() {
    36. return statementId;
    37. }
    38. public void setStatementId(String statementId) {
    39. this.statementId = statementId;
    40. }
    41. public Class<?> getParameterTypeClass() {
    42. return parameterTypeClass;
    43. }
    44. public void setParameterTypeClass(Class<?> parameterTypeClass) {
    45. this.parameterTypeClass = parameterTypeClass;
    46. }
    47. public Class<?> getResultTypeClass() {
    48. return resultTypeClass;
    49. }
    50. public void setResultTypeClass(Class<?> resultTypeClass) {
    51. this.resultTypeClass = resultTypeClass;
    52. }
    53. public String getStatementType() {
    54. return statementType;
    55. }
    56. public void setStatementType(String statementType) {
    57. this.statementType = statementType;
    58. }
    59. public SqlSource getSqlSource() {
    60. return sqlSource;
    61. }
    62. public void setSqlSource(SqlSource sqlSource) {
    63. this.sqlSource = sqlSource;
    64. }
    65. }