Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1828

SQLSelect - generics friendly fluent selecting sql query

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.M1
    • None
    • None

    Description

      Want to have something more usable than SQLTemplate... Its routing defaults, parameter bindings, etc. etc. are just not that user-friendly. So creating a simpler selecting version that will internally translate to SQLTemplate.

      Here are construction examples:

      SQLSelect<DataRow> q1 = SQLSelect.dataRowQuery("SELECT * FROM x");
      SQLSelect<Artist> q2 = SQLSelect.query(Artist.class, "SELECT * FROM x");

      List<DataRow> l1 = context.select(q1);

      Also use fluent API... some examples from unit tests:

      1. Complete fluent select:

      List<Artist> result = SQLSelect.query(Artist.class, "SELECT * FROM ARTIST WHERE ARTIST_NAME = #bind($a)")
      .bind("a", "artist3").select(context);

      2. Selecting a single object:

      Artist a = SQLSelect.query(Artist.class, "SELECT * FROM ARTIST WHERE ARTIST_NAME = #bind($a)")
      .bind("a", "artist3").selectOne(context);

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment