typo
typo copied to clipboard
Foreign keys in DSL
these are generated in Fields
objects so othey are accessible in DSL:
generated boilerplate:
def fkEmployee: ForeignKey[EmployeeFields, EmployeeRow] =
ForeignKey[EmployeeFields, EmployeeRow]("humanresources.FK_JobCandidate_Employee_BusinessEntityID", Nil)
.withColumnPair(businessentityid, _.businessentityid)
usage:
val query0 = productRepo.select
.joinFk(_.fkProductmodel)(projectModelRepo.select)
.joinFk(_._1.fkProductsubcategory)(productsubcategoryRepo.select)
.joinFk(_._2.fkProductcategory)(productcategoryRepo.select)
query0.toList.foreach(println)