Skip to content

fetchType = FetchType.EAGER,存在时候报错 #3

Open
@NaughtyChild

Description

@NaughtyChild

/**

  • UserDAO继承基类
    */
    @repository
    public interface UserDAO extends MyBatisBaseDao<User, Long> {
    @select("select * from user")
    @results({
    @Result(id = true, column = "id", property = "id"),
    @Result(column = "username", property = "username"),
    @Result(column = "password", property = "password"),
    @Result(column = "id", property = "roles", many = @many(
    select = "com.example.demo.dao.RoleDAO.listByUserid",fetchType = FetchType.EAGER
    ))
    })
    List listUserDto();
    }

这个样子会报错,把"fetchType = FetchType.EAGER"去掉才正常,这是为啥呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions