trait GenericShare[ShareT <: GenericShare[ShareT]] extends MongoRecord[ShareT] with ObjectIdPk[ShareT] {
self: ShareT =>
def shareId: StringField[ShareT] // deferred, to be implemented in subtype
def entity: EnumField[ShareT, Share.type] // object Share extends Enumeration { type Share = Value; ... }
object date extends DateField(self) // not deferred to subtype (type annotation not necessary since self is of type BsonRecord[_] via MongoRecord[_]
// ...
// ...
}
trait ShareA[AT <: ShareA[AT]] extends GenericShare[AT] {
self: AT =>
object shareId extends StringField(self, 20) // implemented here (again type annotation not necessary)
def meta ... // the usual MongoMetaRecord etc.
// ...
}
Is this what you are looking for?
- Indrajit
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code