I've looked this up. It looks as though the joins are done in the object layer.
Extrapolated from http://exploring.liftweb.net/master/index-8.html to your case:
// Accessing foreign objects
class Employee extends LongKeyedMapper[Employee] with IdPK {
...
object department extends MappedLongForeignKey(this, Department)
def departmentName =
Text("My department is " + (department.obj.map(_.name.is) openOr "Unknown"))
}
class Department ... {
...
def entries = Employee.findAll(By(Employee.department, this.id))
}
If you want to do many-to-many mappings you’ll need to provide your own
“join” class with foreign keys to both of your mapped entities.
// DepartmentId Entity
class DepartmentId extends LongKeyedMapper[DepartmentId] with IdPK {
def getSingleton = DepartmentId
object name extends MappedString(this,100)
}
object DepartmentId extends DepartmentId with LongKeyedMetaMapper[DepartmentId] {
override def fieldOrder = List(name)
}
Next, we define our join entity, as shown below.
It’s a LongKeyedMapper just like the rest of the entities,
but it only contains foreign key fields to the other entities.
// Join Entity
class DepartmentIdTag extends LongKeyedMapper[DepartmentIdTag] with IdPK {
def getSingleton = DepartmentIdTag
object departmentid extends MappedLongForeignKey(this,DepartmentId)
object Employee extends MappedLongForeignKey(this,Employee)
}
object DepartmentIdTag extends DepartmentIdTag with LongKeyedMetaMapper[DepartmentIdTag] {
def join (departmentid : DepartmentId, tx : Employee) =
this.create.departmentid(departmentid).Employee(tx).save
}
To use the join entity, you’ll need to create a new instance and set the
appropriate foreign keys to point to the associated instances. As you can see,
we’ve defined a convenience method on our Expense meta object to do just that.
To make the many-to-many accessible as a field on our entities, we can use the
HasManyThrough trait, as shown below
// HasManyThrough for Many-to-Many Relationships
class Employee ... {
object departmentids extends HasManyThrough(this, DepartmentId,
DepartmentIdTag, DepartmentIdTag.departmentid, DepartmentIdTag.Employee)
}