To relate the two tables, you will need to establish a ManyToMany relationship in your schema. Assuming you have defined your tables with the names tableOne and tableTwo in your schema, something like this probably what you want:
First create a class that joins the two tables:
class TableOneToTwo(
name:String = "",
idCode:String = "") extends KeyedEntity[CompositeKey2[String, String]] {
def id = compositeKey(name, idCode)
}
Then map the relation in your Schema
val tableOneToTwo = manyToManyRelation(tableOne, tableTwo).via[TableOneToTwo]((t1, t2, jt) => (t1.name === jt.name, t2.idCode === jt.idCode))
Then you would just need to create the corresponding table in your DB - which should have two fields - name
, id_code
(named according to your naming convention).
If you need a reference, this should point you in the right direction: http://squeryl.org/relations.html