scala - SLICK: How to use query result in another query? -


I want to do something like the following:

I want to return a list by users first Sorted, the user who is "the following", second by some extra point score. I wrote what I wrote under the following code, but does not work because the funder is type of salt type removed and therefore it is never found in the list.

  // The following are just for the query for the fund, we are following following folders: list [user] = {{funder <- all_funders f & lt} ; - If f.followeeId === All the current user followers on the funder receive, then f.followerId === id // complies. Id} generated funder) .list val all_funders_sorted = {funder & lt; - all_funders Sort the _funder = following_funders funder} yield (funder, following_funder) / funders whether they are following the funder and then only funders (i.e. remove boolean) all_funders_sorted.sortBy (_._ 2.desc) .sortBy (_._ 1.score.desc) .map (x = & gt; x._1)   

Appreciate all help!

You have to work with ID (primary key) in Cunning. Similarly, on the DB side the object is uniquely identified. You do not need to execute the first query. You can use it in by operator:

  // without first executing it as a component of your second. The following query can be used only by those fonders We offer the following Val following_funders_ID = ({funder & lt; - all_funders f & lt; - if f.followerId === id // receive all current user follower items, then for this ; f.followeeId === funder.id} funder.id generated all all_funders_sorted = Funder & l T; - all_funders the following _ funders_ids} in the following _funder = funder.id, sort the yield (funder, following_funder) / funders whether or not they are following the funder and then only funders (i.e. remove boolean) All_funders_sorted.sortBy ( _._ 1.impactPoints.desc) .sortby (_._ 2.desc) .map (x = & gt; x._1)   

Keep in mind that your order order was incorrect If you want to sort by first on the basis of the following, then slake translation from .sortby (_. A) .sortBy (_. B) to ORDER BY B, A Because this is how Scala Storage Car A:

  Scala> List ((1, "B"), (2, "A")). STBY (_._ 1). STBY (_._ 2) res0: list [(int, string)] = list ((2, a), (1, b))    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -