Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

ResultSet.toJson does not respect column labels defined in the SQL query  #184

@hyyan

Description

@hyyan
use com.basiscomponents.db.ResultSet
use com.basiscomponents.bc.SqlQueryBC

declare SqlQueryBC sbc!
declare ResultSet rs!

sbc! = new SqlQueryBC(BBjAPI().getJDBCConnection("CDStore"))
rs! = sbc!.retrieve("SELECT TOP 1 ARTIST as artist, TITLE as title FROM CDINVENTORY")

clipfromstr 1,rs!.toJson()

Take a look at the ColumnLabel in meta, it is ARTIST instead of artist and TITLE instead of title. For the
BBjGridExWidget this means extra work for the developer to fix the column labels so the text transformation is respected.
Can we do something about this?

[
  {
    "ARTIST": "John Hurt \u0026 The Ramblers",
    "TITLE": "Mississippi Blues",
    "meta": {
      "ARTIST": {
        "ReadOnly": "false",
        "ColumnType": "12",
        "Signed": "false",
        "AutoIncrement": "false",
        "Writable": "true",
        "ColumnLabel": "ARTIST",
        "Scale": "0",
        "StringFormat": "",
        "TableName": null,
        "ColumnClassName": "java.lang.String",
        "ColumnDisplaySize": "50",
        "Precision": "50",
        "Currency": "false",
        "CaseSensitive": "true",
        "CatalogName": null,
        "Searchable": "true",
        "DefinitelyWritable": "false",
        "SchemaName": null,
        "Nullable": "2",
        "EDITABLE": "0"
      },
      "TITLE": {
        "ReadOnly": "false",
        "ColumnType": "12",
        "Signed": "false",
        "AutoIncrement": "false",
        "Writable": "true",
        "ColumnLabel": "TITLE",
        "Scale": "0",
        "StringFormat": "",
        "TableName": null,
        "ColumnClassName": "java.lang.String",
        "ColumnDisplaySize": "50",
        "Precision": "50",
        "Currency": "false",
        "CaseSensitive": "true",
        "CatalogName": null,
        "Searchable": "true",
        "DefinitelyWritable": "false",
        "SchemaName": null,
        "Nullable": "2",
        "EDITABLE": "0"
      }
    }
  }
]

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions