Mybatis mapper using @SessionScope error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Mybatis mapper using @SessionScope error

I have a SpringBoot application and run with mybatis

here is the mapper 

    public interface AccountMapper {
        @Insert("insert into dc_account(identification,nickname,username,password) values (#{identification},#{nickname},#{username},#{password})")
        public int insert(Account account);
        @Update("update dc_account set identification=#{identification},nickname=#{nickname},username=#{username},password=#{password}")
        public int update(Account account);

        @Select("select * from dc_account where username=#{username} and password=#{password}")
            id = "account",
            value = {
                @Result(property = "identification", column = "identification"),
                @Result(property = "nickname", column = "nickname"),
                @Result(property = "username", column = "username"),
                @Result(property = "password", column = "password")   
        Account select(Account account);


Account class

@SessionScope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class Account{
    int identification;
    String nickname;
    String username;
    String password;
//getter and setter


AccountMapper accountMapper;
Account account;
    Account login(
        @RequestParam("username")String username,
        @RequestParam("password")String password){
            return account;

and when i enter localhost:8080/login?username=1&password=1

it report error message of 
enter image description here

But if i remove the @SessionScope annotation of Account class, everything works fine.

Why is causing this problem?Can anyone give me some advice?

You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit