New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some records are missing in result #580
Comments
Hi! Can you plese check 3.3.1? (just in case) |
The same behavior with 3.3.1. |
The problem is not only for discriminator. The issue occurs for following simple mapping also: <resultMap type="cz.pse.cp.dto.Invoice" id="invoice">
<result property="active" column="P0PLAT" typeHandler="cz.pse.commons.mybatis.handler.BooleanCZShort"/>
<result property="calculatedPrice" column="P0MTMV"/>
<association property="invoice" resultMap="cz.pse.dto.mapper.InvoiceDataMapper.invoiceData"/>
</resultMap> Resulting list contains only records, which are different on fields P0PLAT and P0MTMV!!!!! |
I'm not sure if it is not a bug for discriminator. Without discriminator I can avoid using association by using dot notation. But it is impossible with discriminator. Is there a way to obtain all records in this case? |
Hi, |
I should have mentioned that you can define 'id' elements without mapping it to the Java object. |
Hi @avackova , How is it ? |
I'll close. This is not a bug and there is a workaround. |
MyBatis version
3.3.0
Database vendor and version
DB2 for AS400
Test case or example project
Steps to reproduce
Result map:
Expected result
List of four items:
Actual result
List of three items.
After some debugging I realized, that it happens (probably) because 2 of the 4 rows have all data the same except tail values (method org.apache.ibatis.executor.resultset.DefaultResultSetHandler.handleRowValuesForNestedResultMap(ResultSetWrapper, ResultMap, ResultHandler, RowBounds, ResultMapping)):
Note marked (==> <==) text above: for the 2nd iteration proper rowValue is created, but it is not added to the result, because partialObject is not null.
The text was updated successfully, but these errors were encountered: