Description
The JOOQ-generated Dataset.java class has a constructor with non-deterministic parameter ordering. This can cause issues when manually creating Dataset instances using the constructor, as the parameter order may change between JOOQ code generations.
Problem
In DatasetResource.scala, we were manually constructing a new Dataset object by passing parameters to the constructor:
new Dataset(
createdDataset.getDid,
createdDataset.getOwnerUid,
createdDataset.getName,
createdDataset.getRepositoryName,
createdDataset.getIsPublic,
createdDataset.getIsDownloadable,
createdDataset.getDescription,
createdDataset.getCreationTime
)
However, the constructor parameter order in the generated class is non-deterministic and may not match this order.
Solution
Use JOOQ's built-in into() method to convert from DatasetRecord to Dataset POJO:
createdDataset.into(classOf[Dataset])
This avoids relying on constructor parameter ordering entirely.