It is tricky for us because the primary key is not...
# exposed
w
It is tricky for us because the primary key is not an int. It is a compound key which consists of the CustomerID and the BoatID. It looks like this in our code:
Copy code
object Rents : Table("T_Rents") {
    val customerId = reference("Customer_Id", Customers.id)
    val boatId = reference("Boat_Id", Boats.id)
    val dateOfRent = datetime("Date_of_rent")
    val dateOfReturn = datetime("Date_of_return")

    override val primaryKey = PrimaryKey(customerId, boatId, name = "CustomerAndBoatID")
}
How would we create an entity in this table?
a
When faced with a similar issue, I opted to use the table DSL directly. There may be a workaround to make it work with an entity, but I don't know it.
1
w
Thank you! It worked.
p
Yes by using the table DSL its easy to create all kind of relations, the DAO is limited in some cases.