Skip to content

Commit 74c68d4

Browse files
committed
Restore automapping inherited behaviour
1 parent 6caf31b commit 74c68d4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mybatis-scala-core/src/main/scala/org/mybatis/scala/config/ConfigurationSpace.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class ConfigurationSpace(configuration : MBConfig, val spaceName : String = "_DE
148148
if (rm.parent != null) rm.parent.fqi.id else null,
149149
discriminator,
150150
resultMappings,
151-
rm.autoMapping
151+
rm.autoMapping.value
152152
)
153153

154154
}

mybatis-scala-core/src/main/scala/org/mybatis/scala/mapping/ResultMap.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ package org.mybatis.scala.mapping
1818

1919
import scala.collection.mutable.ListBuffer
2020

21+
sealed trait AutoMappingBehaviour {
22+
val value : java.lang.Boolean
23+
}
24+
25+
object AutoMappingEnabled extends AutoMappingBehaviour { val value = java.lang.Boolean.TRUE }
26+
object AutoMappingDisabled extends AutoMappingBehaviour { val value = java.lang.Boolean.FALSE }
27+
object AutoMappingInherited extends AutoMappingBehaviour { val value = null }
28+
2129
/** Defines a mapping between JDBC Results and Java/Scala Classes.
2230
* @tparam ResultType type of the resulting object
2331
* @param parent if defined, this resultmap will inherit mappings from parent.
@@ -29,7 +37,7 @@ class ResultMap[ResultType : Manifest](val parent : ResultMap[_] = null) {
2937
private[scala] var discr : (String, T[_], JdbcType, T[_ <: TypeHandler[_]], Seq[Case]) = null
3038

3139
var fqi : FQI = null
32-
var autoMapping : Boolean = false
40+
var autoMapping : AutoMappingBehaviour = AutoMappingInherited
3341

3442
def resultTypeClass = manifest[ResultType].runtimeClass
3543

0 commit comments

Comments
 (0)