scala - Lift: how make these relations polymorphic? -
i got entry should related 1 of 3 "lists" call them lista listb listc couldnt figure out how longmappedmapper. how this?
i wanted let list have multiple entries without having specify listx relation each kind of list. not:
class entry ...{ object lista extends longmappedmapper(this,lista) object listb extends longmappedmapper(this,listb) ... }
i want like:
class entry ...{ object list extends polylongmappedmapper(this,lista,listb,listc) //polylongmappedmapper example mapper want ... }
or:
class entry ...{ object list extends polylongmappedmapper(this,baselisttrait) //where baselisttrait trait shared list classes //polylongmappedmapper example mapper want ... }
is somewere in lift framework what want? comparable polylongmappedmapper? or there elegant way solve problem?
you can in such way:
class extends longkeyedmapper[a] idpk { object entry extends longmappedmapper(this, entry) ... class b extends longkeyedmapper[b] idpk { object entry extends longmappedmapper(this, entry) ... class c extends longkeyedmapper[c] idpk { object entry extends longmappedmapper(this, entry) ... class entry extends longkeyedmapper[entry] idpk { def alist = a.findall(by(a.entry, this)) def blist = b.findall(by(b.entry, this)) def clist = c.findall(by(c.entry, this)) ...
and lista are:
e.alist, e.blist, e.clist
when:
val e: entry
etam.
Comments
Post a Comment