Results found:
How to create Composite-key for a Model in lift's mapper?
https://stackoverflow.com/questions/8047176
Full question
Solution
This is one example:
class FooBar extends LongKeyedMapper[FooBar] {
def getSingleton = FooBar
def primaryKeyField = id
object id extends MappedLongIndex(this)
object foo extends MappedLongForeignKey(this, Foo)
object bar extends MappedLongForeignKey(this, Bar)
}
object FooBar extends FooBar with LogKeyedMetaMapper[FooBar] {
override def dbIndexes = Index(foo, bar) :: super.dbIndexes
}
Example taken from the Lift mailing list
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow