Привет. Я пытаюсь отобразить результаты следующего запроса выбора во вложенный класс дел.Я использую scalike 3.3, у меня пока есть следующий код, но он не работает:
val dashboardDetails: List[MainReportFields] =
SQL("select " +
"d.dashboard_id, " +
"d.dashboard_name, " +
"rpt.cube_id, " +
"rpt.report_id," +
"rpt.query_builder_json," +
"rpt.action," +
"g.column_id,g.sequence," +
"sc.selected_column_id," +
"sc.column_name," +
"sc.sequence," +
"fd.formatting_id," +
"fd.selected_column_id," +
"fd.format_id," +
"fd.type " +
"from ReportingMetabase.dashboard_details d " +
"inner join ReportingMetabase.report_details rpt " +
"on d.dashboard_id = rpt.dashboard_id " +
"inner join ReportingMetabase.group_by_details g " +
"on rpt.report_id = g.report_id " +
"inner join ReportingMetabase.selected_columns sc " +
"on rpt.report_id = sc.report_id " +
"inner join ReportingMetabase.formatting_details fd " +
"on sc.selected_column_id = fd.selected_column_id " +
"inner join ReportingMetabase.format_type_details ftd " +
"on fd.format_id = ftd.format_id")
.map(_.get[MainReportFields](1)).list() apply()
// read results into main case class
case case выглядит так:
case class ReportsFields(
reportid: Option[Long],
reportName: String,
selectedColumns: List[SelectedColumns],
queryBuilderString: String,
havingjson: String,
groupByFields: List[GroupByFields],
orderByFileds: List[OrderByFileds]
)
case class MainReportFields(
cubeid: Long,
dashboardId: Long,
dashboardName: String,
reports: List[ReportsFields]
)
Я также попробовал примеры здесь: http://scalikejdbc.org/documentation/one-to-x.html
Но это не работает с scalikejdbc 3.3