Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/core/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func (t ktType) IsUUID() bool {
}

func (t ktType) IsBigDecimal() bool {
return t.Name == "java.math.BigDecimal"
return t.Name == "BigDecimal"
}

func makeType(req *plugin.GenerateRequest, col *plugin.Column) ktType {
Expand Down
6 changes: 6 additions & 0 deletions internal/core/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func (i *Importer) modelImports() [][]string {
if i.usesType("UUID") {
std["java.util.UUID"] = struct{}{}
}
if i.usesType("BigDecimal") {
std["java.math.BigDecimal"] = struct{}{}
}

stds := make([]string, 0, len(std))
for s := range std {
Expand Down Expand Up @@ -120,6 +123,9 @@ func stdImports(uses func(name string) bool) map[string]struct{} {
if uses("UUID") {
std["java.util.UUID"] = struct{}{}
}
if uses("BigDecimal") {
std["java.math.BigDecimal"] = struct{}{}
}

return std
}
Expand Down
2 changes: 1 addition & 1 deletion internal/core/postgresql_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func postgresType(req *plugin.GenerateRequest, col *plugin.Column) (string, bool
return "Float", false

case "pg_catalog.numeric":
return "java.math.BigDecimal", false
return "BigDecimal", false

case "bool", "pg_catalog.bool":
return "Boolean", false
Expand Down