Skip to content

Conversation

@jeffgbutler
Copy link
Member

Currently the insert and update "when present" mappings evaluate when the mappings are first added to a statement. This PR delays the evaluation so that it is done when the statement is rendered. This has a few benefits:

  1. It is more consistent with "when present" conditions in where clauses
  2. It eliminates a double call to getter functions in some cases
  3. It eliminates some pesky "if" statements

This PR also removes a few custom collector classes that caused unnecessary complexity.

@jeffgbutler jeffgbutler added this to the 1.1.5 milestone Jul 22, 2020
@jeffgbutler jeffgbutler merged commit ba7dc5d into mybatis:master Jul 22, 2020
@jeffgbutler jeffgbutler deleted the delay-when-present-calculations branch July 22, 2020 17:56
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b7ea53e on jeffgbutler:delay-when-present-calculations into e04c0a9 on mybatis:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants