Skip to content

Commit 16c8f89

Browse files
authored
Merge pull request #15 from L1yp/fix-column-java-type
fix: 修复BaseMapper方法中未生成javaType属性导致无法携带字段类型实例化typeHandler。close #14
2 parents 00a0a7f + ebf95ee commit 16c8f89

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/io/mybatis/provider/EntityColumn.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,22 @@ public String variables() {
182182
public String variables(String prefix) {
183183
return "#{" + property(prefix)
184184
+ jdbcTypeVariables().orElse("")
185+
+ javaTypeVariables().orElse("")
185186
+ typeHandlerVariables().orElse("")
186187
+ numericScaleVariables().orElse("") + "}";
187188
}
188189

190+
/**
191+
* java类型 {, javaType=java.lang.String}
192+
*/
193+
public Optional<String> javaTypeVariables() {
194+
Class<?> javaType = this.javaType();
195+
if (javaType != null) {
196+
return Optional.of(", javaType=" + javaType.getName());
197+
}
198+
return Optional.empty();
199+
}
200+
189201
/**
190202
* 数据库类型 {, jdbcType=VARCHAR}
191203
*/

0 commit comments

Comments
 (0)