Skip to content

Confusing error message when reading a non-existing Field from a Record containing accidentally nested row types #15085

@lukaseder

Description

@lukaseder

Since jOOQ 3.17, users may be accidentally nesting records in their queries:

An example:

ctx.select(CONFIGURATION)
   .from(CONFIGURATION)
   .where(CONFIGURATION.DEVICE_ID.eq(id))
   .fetch();

When trying to read a CONFIGURATION column from the resulting nested record, this error message appears:

Exception in thread "" java.lang.IllegalArgumentException: Field ("public"."configuration"."minimum_temperature_threshold") is not contained in Row (row (
  "public"."configuration"."configuration_id",
  "public"."configuration"."minimum_temperature_threshold",
  "public"."configuration"."maximum_temperature_threshold",
  "public"."configuration"."ideal_temperature",
  "public"."configuration"."minimum_ph_threshold",
  "public"."configuration"."maximum_ph_threshold",
  "public"."configuration"."ideal_ph",
  "public"."configuration"."light_on_time",
  "public"."configuration"."light_off_time",
  "public"."configuration"."update_time",
  "public"."configuration"."device_id"
))

The fact that Row (row ( means the row is nested is too subtle to debug this. It appears that the requested column is right there!

Probably, the error message can be improved to help users here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions