@@ -104,11 +104,7 @@ func jdbcSet(t ktType, idx int, name string) string {
104
104
if t .IsUUID () {
105
105
return fmt .Sprintf ("stmt.setObject(%d, %s)" , idx , name )
106
106
}
107
- if t .IsNull && t .PrimitiveType != "" {
108
- return fmt .Sprintf ("if (%[3]s != null) stmt.set%[1]s(%[2]d, %[3]s) else stmt.setNull(%[2]d, Types.%[4]s)" , t .Name , idx , name , t .PrimitiveType )
109
- } else {
110
- return fmt .Sprintf ("stmt.set%s(%d, %s)" , t .Name , idx , name )
111
- }
107
+ return fmt .Sprintf ("stmt.set%s(%d, %s)" , t .Name , idx , name )
112
108
}
113
109
114
110
type Params struct {
@@ -336,13 +332,12 @@ func BuildDataClasses(conf Config, req *plugin.GenerateRequest) []Struct {
336
332
}
337
333
338
334
type ktType struct {
339
- Name string
340
- IsEnum bool
341
- IsArray bool
342
- IsNull bool
343
- PrimitiveType string
344
- DataType string
345
- Engine string
335
+ Name string
336
+ IsEnum bool
337
+ IsArray bool
338
+ IsNull bool
339
+ DataType string
340
+ Engine string
346
341
}
347
342
348
343
func (t ktType ) String () string {
@@ -391,13 +386,12 @@ func (t ktType) IsBigDecimal() bool {
391
386
func makeType (req * plugin.GenerateRequest , col * plugin.Column ) ktType {
392
387
typ , isEnum := ktInnerType (req , col )
393
388
return ktType {
394
- Name : typ ,
395
- IsEnum : isEnum ,
396
- IsArray : col .IsArray ,
397
- IsNull : ! col .NotNull ,
398
- PrimitiveType : ktPrimitiveType (typ ),
399
- DataType : sdk .DataType (col .Type ),
400
- Engine : req .Settings .Engine ,
389
+ Name : typ ,
390
+ IsEnum : isEnum ,
391
+ IsArray : col .IsArray ,
392
+ IsNull : ! col .NotNull ,
393
+ DataType : sdk .DataType (col .Type ),
394
+ Engine : req .Settings .Engine ,
401
395
}
402
396
}
403
397
@@ -413,25 +407,6 @@ func ktInnerType(req *plugin.GenerateRequest, col *plugin.Column) (string, bool)
413
407
}
414
408
}
415
409
416
- func ktPrimitiveType (t string ) string {
417
- switch t {
418
- case "Int" :
419
- return "INTEGER"
420
- case "Double" :
421
- return "DOUBLE"
422
- case "Long" :
423
- return "BIGINT"
424
- case "Short" :
425
- return "SMALLINT"
426
- case "Float" :
427
- return "REAL"
428
- case "Boolean" :
429
- return "BOOLEAN"
430
- default :
431
- return ""
432
- }
433
- }
434
-
435
410
type goColumn struct {
436
411
id int
437
412
* plugin.Column
0 commit comments