报错:Expected one result (or null) to be returned by selectOne(), but found: 6

See the title has been very clear:

Two cases:

1. Do you want a data query, but returned two data:

2. You want to query multiple data, but the front desk a restriction can only inquiry

(1) check your data sql statement written for no (sql on mybaties operating their own Baidu)

(2) See mybaties return value (or the resultType resultMap), can be returned list, map data such as

(3) dao layer interface for a return value and the received value must be consistent with mybaties

Example: Returns the map data


A plurality of pieces of data are returned Map, with a plurality of Map on List List <Map <String, String >> receive data back

Mybatis returned Map is a format: Map <field name, field value> 

A Map <field name, field values> represents a row of data objects 

 

 ---- Transfer blog Park Lei.Lei

Guess you like

Origin www.cnblogs.com/akic/p/11024993.html