How springboot in mybatis comment settlement entity class name and attribute data mysql table column names are different mapping relationships

Write 1

Defining the properties of entity class, using @column annotation is mapped to the column name of the database table.

    @Column(name = "release_status")
    private Boolean status;

 

Second reading

Set property to the property name of the entity class by Results in, column to column names of the database table mapping.

    @Results({
            @Result(property = "status", column = "release_status")
    })
    @Select({"select * from xxx"})
    List<BookBoard> findAll();

Guess you like

Origin www.cnblogs.com/mydesky2012/p/12667937.html