Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
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);