how it get return Optional> from mybatis

Hi im not an English speaker.

coz English is not fluent.

I wanna use Optional in Mapper

like this

public interface TestMapper {

@Transactional(readOnly = true)

Optional> selectDataOpt();

}



but mybatis print exception msg that

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 21

What can i do I do not know what I'm missing.

Thank you for reading

Lend your wisdom....

Read More »

By: StackOverFlow - Thursday, 12 April

Related Posts