Bill Farner created AURORA-1142:
-----------------------------------
Summary: Clarify behavior of association properties in mybatis
mappers
Key: AURORA-1142
URL: https://issues.apache.org/jira/browse/AURORA-1142
Project: Aurora
Issue Type: Task
Components: Scheduler
Reporter: Bill Farner
Priority: Trivial
Mybatis has some behavior that caught me by surprise w.r.t. handling
associations. See note in this mapper snippet:
{code}
<resultMap id="jobUpdateSummaryMap"
type="org.apache.aurora.gen.JobUpdateSummary">
<id column="update_id" property="updateId"/>
<result column="update_id" property="key.id" javaType="String"/>
<!-- myBatis breaks here if an association is used to map the job key into
both the old
and new job key fields. The observed behavior is that only the first
declared association
will result in a field being set, and the other will be null.
Expanding the association
allows for the desired result of populating both JobKey fields.
-->
<result column="jk_role" property="jobKey.role" javaType="String"/>
<result column="jk_environment" property="jobKey.environment"
javaType="String"/>
<result column="jk_name" property="jobKey.name" javaType="String"/>
<association property="key.job"
resultMap="org.apache.aurora.scheduler.storage.db.JobKeyMapper.jobKeyMap"
columnPrefix="jk_"/>
{code}
I would like to understand whether his is intentional behavior in mybatis or it
is a bug.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)