GitHub user lonvarscsak opened a pull request: https://github.com/apache/cayenne/pull/112
Ordering chaining Hey all, I've got a commit (that I plan on using) that I think is useful. I've added an Orderings class which is a subclass of ArrayList<Ordering>, and then added methods to allow chaining of multiple Ordering through Propertys. So for example: `Person.COMPANY_NAME.asc().then(Person.FIRST_NAME.desc()) ` Rather than typing: `Arrays.asList(Person.COMPANY_NAME.asc(), Person.FIRST_NAME.desc()) ` You can chain together Ordering (into an Orderings) or Orderings into other Orderings. `Person.COMPANY_NAME.asc().then(Person.LAST_NAME.asc()).then(Person.FIRST_NAME.asc()) ` I find it to be convenient and cleaner, but I'm used to this kind of thing in WOnder. :) Thoughts? You can merge this pull request into a Git repository by running: $ git pull https://github.com/smarthealth/cayenne orderings Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cayenne/pull/112.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #112 ---- commit 1f44bb3739d2c882253113d2f6b5020131bd66ea Author: Lon Varscsak <lon.varsc...@gmail.com> Date: 2016-07-07T16:55:06Z Changed insert/update/delete order. commit 2ce5747730e96a62f065352dbb25779aa9d98852 Author: Lon Varscsak <lon.varsc...@gmail.com> Date: 2016-09-26T23:00:41Z Merge remote-tracking branch 'upstream/master' commit fda0f6cf2c40e96f0b442c58542a8f3b895b6bee Author: Lon Varscsak <lon.varsc...@gmail.com> Date: 2016-09-29T00:36:08Z Added changes to support the concept of Orderings (List of Ordering) so that Orderings can be chained together. commit 392e8b5d9ac9b4d7dc213e11b3ab719468070633 Author: Lon Varscsak <lon.varsc...@gmail.com> Date: 2016-09-29T00:39:37Z Merge remote-tracking branch 'upstream/master' commit 0f6f30575bfd62d3f8b8cc41070853cc646e3c10 Author: Lon Varscsak <lon.varsc...@gmail.com> Date: 2016-09-29T00:52:14Z Removed changes I don't want in pull request ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---