Skip to content

Commit d3900db

Browse files
authored
Handling of the decimal column in the build query (#17)
1 parent 180335e commit d3900db

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: internal/core/gen.go

+7
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ func jdbcGet(t ktType, idx int) string {
173173
}
174174
return fmt.Sprintf(`results.getObject(%d) as%s %s`, idx, nullCast, t.Name)
175175
}
176+
if t.IsBigDecimal() {
177+
return fmt.Sprintf(`results.getBigDecimal(%d)`, idx)
178+
}
176179
return fmt.Sprintf(`results.get%s(%d)`, t.Name, idx)
177180
}
178181

@@ -364,6 +367,10 @@ func (t ktType) IsUUID() bool {
364367
return t.Name == "UUID"
365368
}
366369

370+
func (t ktType) IsBigDecimal() bool {
371+
return t.Name == "java.math.BigDecimal"
372+
}
373+
367374
func makeType(req *plugin.GenerateRequest, col *plugin.Column) ktType {
368375
typ, isEnum := ktInnerType(req, col)
369376
return ktType{

0 commit comments

Comments
 (0)