[3.0.0-beta1] Specifying multiple columns in the .orderBy
Previously I'd do something like this:
.orderBy("first_name, last_name")
but now with 3.0.0-beta1 I can't seem to find a way to handle multiple columns (or maybe the documentation needs adding to)
would I do
.orderBy(Model_Table.first_name) .orderBy(Model_Table.last_name)
instead?
Another issue potentially, is how do you cast an item in the order by. I'm wanting to cast a value into an integer and used to be able to use the "cast" function in sqlite but I'm not sure how to do that now.
There is a new function that has been added:
orderByAll(List
I didn't have the chance to test it yet but looking at its definition, it seems pretty clear that it's the new way of handling multiple columns.
Thanks, that sound good, but I can't think how to call it. The Class OrderBy is private when trying to create a new OrderBy object
Mutli orderbies also seems to work
.orderBy(1) .orderBy(2)
looking at the generated query
@andrewpmoore I had problems trying that in previous versions. The order of the order Bies was randomly changing. I don't think it was intended to respect the order of function calls.
@andrewpmoore You can instantiate a new OrderBy object using these static functions: OrderBy.fromProperty or OrderBy.fromNameAlias.
Thanks Eric On 30 Dec 2015 3:06 p.m., "Eric Boissonneault" [email protected] wrote:
@andrewpmoore https://github.com/andrewpmoore You can instantiate a new OrderBy object using these static functions: OrderBy.fromProperty or OrderBy.fromNameAlias.
— Reply to this email directly or view it on GitHub https://github.com/Raizlabs/DBFlow/issues/518#issuecomment-168016378.