Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Database 如何在Slick'中定义主键和外键;什么是直接嵌入?_Database_Scala_Foreign Keys_Slick - Fatal编程技术网

Database 如何在Slick'中定义主键和外键;什么是直接嵌入?

Database 如何在Slick'中定义主键和外键;什么是直接嵌入?,database,scala,foreign-keys,slick,Database,Scala,Foreign Keys,Slick,我正在使用Slick,希望用几个表构建一个示例应用程序。当然,这些表格在某些方面相互关联。我查阅了文档,但没有找到任何相关信息: 考虑下表: case class Coffee( name: String, price: Double, producerId: ??? ) case class Producers( name: String, coffeeIds: ??? ) case class Customers( name: String, orderIds

我正在使用Slick,希望用几个表构建一个示例应用程序。当然,这些表格在某些方面相互关联。我查阅了文档,但没有找到任何相关信息:

考虑下表:

case class Coffee(
  name: String,
  price: Double,
  producerId: ???
)

case class Producers(
  name: String,
  coffeeIds: ???
)

case class Customers(
  name: String,
  orderIds: ???
)

case class Orders(
  coffeeId: ???,
  amount: Int
)

我用目前不支持的

标记了我想表达的外键关系。目前,直接嵌入在冰上有利于稳定和记录