private static SelectConditionStep<Record1<Integer>> countLayerData(Field<Integer> datasetId) {
   return DSL.selectCount()
       .from(LAYER)
       .join(DATA)
       .on(LAYER.DATA.eq(DATA.ID)) // layer -> data
       .where(DATA.DATASET_ID.eq(datasetId))
       .and(isIncludedAndNotHidden(DATA));
 }
 private static SelectConditionStep<Record1<Integer>> countSensorData(Field<Integer> datasetId) {
   return DSL.selectCount()
       .from(SENSORED_DATA)
       .join(DATA)
       .on(SENSORED_DATA.DATA.eq(DATA.ID)) // sensored_data -> data
       .where(DATA.DATASET_ID.eq(datasetId))
       .and(isIncludedAndNotHidden(DATA));
 }
 private static SelectConditionStep<Record1<Integer>> countDataOfType(
     Field<Integer> datasetId, String type) {
   return DSL.selectCount()
       .from(DATA)
       .where(DATA.DATASET_ID.eq(datasetId))
       .and(isIncludedAndNotHidden(DATA))
       .and(DATA.TYPE.eq(type));
 }