Groups
Sign in
Groups
Lift
Conversations
About
Send feedback
Help
How to fix "No implicit view available ..." error triggered by By.apply(field,value)(implicit ev) in MetaMapper.scala
31 views
Skip to first unread message
Baskaran S
unread,
Oct 16, 2021, 9:20:38 AM
10/16/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
As a beginner, I am trying out examples from Lift In Action written for 2.x using Lift 3.5.0.
Resolved few deprecation errors and then ended up with a compilation error. Can you help me
fix this error?
[error] .../example/travel/model/Auction.scala:81:28:
No implicit view available from Auction.this.id.type => Long.
[error] def bids = Bid.findAll(
By(Bid.auction,
this.id
)
, OrderBy(Bid.id, Descending))
[error] ^
[error] one error found
MetaMapper.scala, object By, from
github url
.
object
By
{
...
def apply[O <: Mapper[O], T, U](field: MappedField[T, O], value: U)
(implicit ev: U => T)
= Cmp[O,T](field, Eql, Full(value), Empty, Empty)
...
}
Thanks in advance
- Baskaran
Baskaran S
unread,
Oct 16, 2021, 10:00:40 AM
10/16/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lift
Replaced:
def bids
= Bid.findAll(
By
(Bid.auction
, this
.id)
,
OrderBy
(Bid.id
,
Descending))
with:
def bids
= Bid.findAll(
By
(Bid.auction
, this
.id)
(_.get)
,
OrderBy
(Bid.id
,
Descending))
It compiles, but i
s it correct?
- Baskaran
Reply all
Reply to author
Forward
0 new messages