<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Using TableUtil</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>Recent changes to Using TableUtil</description><atom:link href="https://sourceforge.net/p/roth/wiki/Using%20TableUtil/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 25 Mar 2019 13:18:03 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/roth/wiki/Using%20TableUtil/feed" rel="self" type="application/rss+xml"/><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -19,10 +19,13 @@
 public class ExampleBean implements Serializable, StateBean {
     private static final long serialVersionUID = 1L;

-    private Long exampleId;  // (3)
-    
-    public Long getExampleId() { return exampleId; }
+    private Long exampleId;
+    // More fields implied
+    
+    public Long getExampleId() { return exampleId; }  // (3)
     public void setExampleId(Long exampleId) { this.exampleId = exampleId; }
+    
+    // More getters and setters implied

     @Override
     public boolean isNew() {  // (4)
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Mon, 25 Mar 2019 13:18:03 -0000</pubDate><guid>https://sourceforge.net86738875e8d551be04a6a0a0991d9266cc956cf2</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -199,7 +199,7 @@
 Examples:
 LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description");   // (1)
 LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description", "description");   // (2)
-String filter = applyParameters("cusotmer_cat_id = {1}", customerCadId);
+String filter = applyParameters("cusotmer_cat_id = {1}", customerCatId);
 LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description", "description", filter);   // (3)
 ~~~

&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Mon, 25 Mar 2019 13:15:58 -0000</pubDate><guid>https://sourceforge.net9f021788e187a628111930ad54709706fc90f807</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -188,7 +188,7 @@

 **getMap**

-The **getMap** method gets a LinkedHashMap&amp;lt;String,String&amp;gt; from a specified table.  This map is useful with the **select** tag in JSPs.
+The **getMap** method gets a LinkedHashMap&amp;lt;String,String&amp;gt; from a specified table.  This method is useful when used in conjunction with the **select** tag in JSPs.

 ~~~
 :::java
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Mon, 25 Mar 2019 13:15:26 -0000</pubDate><guid>https://sourceforge.nete81d9b88f3aa8bfe5e82a9e07e679202b33578a2</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -188,7 +188,7 @@

 **getMap**

-The **getMap** method gets a LinkedHashMap&amp;lt;string,string&amp;gt; from a specified table.  This map is useful with the **select** tag in JSPs.
+The **getMap** method gets a LinkedHashMap&amp;lt;String,String&amp;gt; from a specified table.  This map is useful with the **select** tag in JSPs.

 ~~~
 :::java
&amp;lt;/string,string&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Mon, 25 Mar 2019 13:14:35 -0000</pubDate><guid>https://sourceforge.net43a37e705ff64a7145406f08982fc0f6847177f8</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -185,3 +185,24 @@
 1. Delete a single row from the table defined in **ExampleBean**.
 2. Delete a batch of rows from tables defined by each of the objects in the array.  Since the array is of objects that implement the **StateBean** interface, it can contain records of different classes that will insert records in different tables.  The batch is committed in one transaction.  Note: the use of **StateBean** is not required here.  It was used as an example.
 3. Delete a batch of rows.  This is the same as example 2, but is supplied a List rather than an array.
+
+**getMap**
+
+The **getMap** method gets a LinkedHashMap&amp;lt;string,string&amp;gt; from a specified table.  This map is useful with the **select** tag in JSPs.
+
+~~~
+:::java
+public LinkedHashMap&amp;lt;string,string&amp;gt; getMap(String table, String key, String value) throws SQLException;
+public LinkedHashMap&amp;lt;string,string&amp;gt; getMap(String table, String key, String value, String order) throws SQLException;
+public LinkedHashMap&amp;lt;string,string&amp;gt; getMap(String table, String key, String value, String order, String where) throws SQLException;
+
+Examples:
+LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description");   // (1)
+LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description", "description");   // (2)
+String filter = applyParameters("cusotmer_cat_id = {1}", customerCadId);
+LinkedHashMap&amp;lt;string,string&amp;gt; options = getMap("customer_type", "customer_type_id", "description", "description", filter);   // (3)
+~~~
+
+1. Gets a list of all id/description pairs in the table, with no specific order.
+2. Gets a list of all id/description paris in the table, ordered by description.
+3. Gets a list of all id/description pairs in the table that qualify for the filter (by category), ordered by description.
&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&amp;lt;/string,string&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Mon, 25 Mar 2019 13:13:41 -0000</pubDate><guid>https://sourceforge.net8293d9e33dfa86ea26a8a102c95262700c363112</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -94,3 +94,94 @@
 4. Get all rows from the table that satisfy the templated filter, and order by `example_id`.
 5. Get all rows from the table, and order by `example_id`.

+**insert**
+
+The **insert** method inserts one or more rows into one or more tables.
+
+~~~
+:::java
+public int insert(Object bean) throws SQLException;
+public int[] insert(Object[] beans) throws SQLException;
+public int[] insert(Collection beans) throws SQLException;
+
+Examples:
+ExampleBean bean = ...;
+int rowsAffected = insert(bean);  // (1)
+StateBean[] beans = ...;
+int[] rowsAffected = insert(beans);  // (2)
+List&amp;lt;statebean&amp;gt; beans = ...;
+int[] rowsAffected = insert(beans);  // (3)
+~~~
+
+1. Insert a single row in the table defined in **ExampleBean**.
+2. Insert a batch of rows in tables defined by each of the objects in the array.  Since the array is of objects that implement the **StateBean** interface, it can contain records of different classes that will insert records in different tables.  The batch is committed in one transaction.  Note: the use of **StateBean** is not required here.  It was used as an example.
+3. Insert a batch of rows.  This is the same as example 2, but is supplied a List rather than an array.
+
+**update**
+
+The **update** method updates one or more rows in one or more tables.
+
+~~~
+:::java
+public int update(Object bean) throws SQLException;
+public int[] update(Object[] beans) throws SQLException;
+public int[] update(Collection beans) throws SQLException;
+
+Examples:
+ExampleBean bean = ...;
+int rowsAffected = update(bean);  // (1)
+StateBean[] beans = ...;
+int[] rowsAffected = update(beans);  // (2)
+List&amp;lt;statebean&amp;gt; beans = ...;
+int[] rowsAffected = update(beans);  // (3)
+~~~
+
+1. Update a single row in the table defined in **ExampleBean**.
+2. Update a batch of rows in tables defined by each of the objects in the array.  Since the array is of objects that implement the **StateBean** interface, it can contain records of different classes that will update records in different tables.  The batch is committed in one transaction.  Note: the use of **StateBean** is not required here.  It was used as an example.
+3. Update a batch of rows.  This is the same as example 2, but is supplied a List rather than an array.
+
+**save**
+
+The **save** method inserts or updates one or more rows in one or more tables.  Unlike the **insert** and **update** methods, the **save** method requires that the POJO implement the **StateBean** interface.  The **isNew** method is used to determine whether to insert or update.
+
+~~~
+:::java
+public int save(Object bean) throws SQLException;
+public int[] save(Object[] beans) throws SQLException;
+public int[] save(Collection beans) throws SQLException;
+
+Examples:
+ExampleBean bean = ...;
+int rowsAffected = save(bean);  // (1)
+StateBean[] beans = ...;
+int[] rowsAffected = save(beans);  // (2)
+List&amp;lt;statebean&amp;gt; beans = ...;
+int[] rowsAffected = save(beans);  // (3)
+~~~
+
+1. Insert or update a single row in the table defined in **ExampleBean**.
+2. Insert or update a batch of rows in tables defined by each of the objects in the array.  Since the array is of objects that implement the **StateBean** interface, it can contain records of different classes that will insert records in different tables.  The batch is committed in one transaction.
+3. Insert or update a batch of rows.  This is the same as example 2, but is supplied a List rather than an array.
+
+**delete**
+
+The **delete** method deletes one or more rows from one or more tables.
+
+~~~
+:::java
+public int delete(Object bean) throws SQLException;
+public int[] delete(Object[] beans) throws SQLException;
+public int[] delete(Collection beans) throws SQLException;
+
+Examples:
+ExampleBean bean = ...;
+int rowsAffected = delete(bean);  // (1)
+StateBean[] beans = ...;
+int[] rowsAffected = delete(beans);  // (2)
+List&amp;lt;statebean&amp;gt; beans = ...;
+int[] rowsAffected = delete(beans);  // (3)
+~~~
+
+1. Delete a single row from the table defined in **ExampleBean**.
+2. Delete a batch of rows from tables defined by each of the objects in the array.  Since the array is of objects that implement the **StateBean** interface, it can contain records of different classes that will insert records in different tables.  The batch is committed in one transaction.  Note: the use of **StateBean** is not required here.  It was used as an example.
+3. Delete a batch of rows.  This is the same as example 2, but is supplied a List rather than an array.
&amp;lt;/statebean&amp;gt;&amp;lt;/statebean&amp;gt;&amp;lt;/statebean&amp;gt;&amp;lt;/statebean&amp;gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Sat, 23 Mar 2019 23:23:27 -0000</pubDate><guid>https://sourceforge.net4b1f8abffaee897c4e1bdd7aa8ae332958cbb85e</guid></item><item><title>Using TableUtil modified by James M. Payne</title><link>https://sourceforge.net/p/roth/wiki/Using%2520TableUtil/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The &lt;strong&gt;TableUtil&lt;/strong&gt; class is a descendant of &lt;strong&gt;JdbcUtil&lt;/strong&gt;.  This class allows you to interact with database tables in a similar fashion to a persistence model such as JPA, however this is &lt;em&gt;not&lt;/em&gt; a persistence model.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;TableUtil&lt;/strong&gt; class (or its descendants) allow for the developer to manage rows in a table without writing SQL statements.  A model object (POJO) is created for each table; the only requirement to make it work is the presence of the &lt;strong&gt;@JdbcTable&lt;/strong&gt; annotation (described below).&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.example.model&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.io.Serializable&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.roth.jdbc.annotation.JdbcTable&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.roth.jdbc.annotation.PermissiveBinding&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;com.roth.jdbc.model.StateBean&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@JdbcTable&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"example"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// (1)&lt;/span&gt;
           &lt;span class="n"&gt;primaryKeyColumns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"example_id"&lt;/span&gt;&lt;span class="o"&gt;})&lt;/span&gt;  &lt;span class="c1"&gt;// (2)&lt;/span&gt;
&lt;span class="nd"&gt;@PermissiveBinding&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ExampleBean&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="n"&gt;Serializable&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;StateBean&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;serialVersionUID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1L&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="n"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;exampleId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// (3)&lt;/span&gt;

    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="n"&gt;Long&lt;/span&gt; &lt;span class="nf"&gt;getExampleId&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;exampleId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;setExampleId&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;exampleId&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;exampleId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;exampleId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="nd"&gt;@Override&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="nf"&gt;isNew&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  &lt;span class="c1"&gt;// (4)&lt;/span&gt;
        &lt;span class="kt"&gt;boolean&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;exampleId&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
        &lt;span class="c1"&gt;// Do whatever needs to be done every time here.&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// Do whatever needs to be done when the record is new here.&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;The &lt;strong&gt;@JdbcTable&lt;/strong&gt; annotation is required.  It is what tells the &lt;strong&gt;TableUtil&lt;/strong&gt; class what table in the database to work with.  There are three attributes: &lt;strong&gt;name&lt;/strong&gt; (the name of the table), &lt;strong&gt;schema&lt;/strong&gt; (the name of the schema the table belongs to), and &lt;strong&gt;primaryKeyColumns&lt;/strong&gt; (an array of Strings representing the column name or names that make up the primary key).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;@PermissiveBinding&lt;/strong&gt; annotation is optional.  If present, &lt;strong&gt;TableUtil&lt;/strong&gt; will not throw an exception if there are discrepencies between the POJO and the table structure, but will log warnings to indicate which fields in the table are not represented in the POJO.  Please note that the POJO can have things that are not represented in the table; &lt;strong&gt;TableUtil&lt;/strong&gt; will not care about these.&lt;/li&gt;
&lt;li&gt;Each column in the table should be represented by a getter and setter that correspond to the column name.  Unlike persistence models, &lt;strong&gt;TableUtil&lt;/strong&gt; does not referernce the POJO's member values directly; it references only getters and setters.  See note below about the naming convention.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;StateBean&lt;/strong&gt; interface implements the &lt;strong&gt;isNew&lt;/strong&gt; method.  This is used by &lt;strong&gt;TableUtil&lt;/strong&gt; to determine whether to insert or update when the &lt;strong&gt;save&lt;/strong&gt; method is called.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 id="naming-convention"&gt;Naming Convention&lt;/h1&gt;
&lt;p&gt;Column names from the table are referenced in lower case.  This makes the interaction uniform across different DBMSs.  The Java equivalent of a column name is the same string, but with underscores removed, and all characters that followed underscores up-cased.  When looking for the getter or setter, the first character is up-cased, and the word "get" or "set" is prepended.&lt;/p&gt;
&lt;p&gt;Example:&lt;br/&gt;
&lt;code&gt;example_id&lt;/code&gt; translates to &lt;code&gt;getExampleId&lt;/code&gt; and &lt;code&gt;setExampleId&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;customer_type_desc&lt;/code&gt; translates to &lt;code&gt;getCustomerTypeDesc&lt;/code&gt; and &lt;code&gt;setCustomerTypeDesc&lt;/code&gt;&lt;br/&gt;
&lt;code&gt;address_line_1&lt;/code&gt; translates to &lt;code&gt;getAddressLine1&lt;/code&gt; and &lt;code&gt;setAddressLine1&lt;/code&gt;&lt;/p&gt;
&lt;h1 id="methods"&gt;Methods&lt;/h1&gt;
&lt;p&gt;The methods that &lt;strong&gt;TableUtil&lt;/strong&gt; provides (aside from those inherited from &lt;strong&gt;JdbcUtil&lt;/strong&gt;) are:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;get&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;get&lt;/strong&gt; method retrieves a singular POJO for the requested record.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;bean&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Examples:&lt;/span&gt;
&lt;span class="n"&gt;ExampelBean&lt;/span&gt; &lt;span class="n"&gt;bean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id = 1"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (1)&lt;/span&gt;
&lt;span class="n"&gt;ExampelBean&lt;/span&gt; &lt;span class="n"&gt;bean&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id = {exampleId}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;searchBean&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (2)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Use a pre-defined filter to get the row.&lt;/li&gt;
&lt;li&gt;Use a template filter and a POJO to fill in the parameter.  In this example, &lt;strong&gt;TableUtil&lt;/strong&gt; will look for &lt;strong&gt;getExampleId&lt;/strong&gt; in the POJO.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;getList&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;getList&lt;/strong&gt; method retrieves multiple POJOs in a List for the requested records.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;bean&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;T&lt;/span&gt; &lt;span class="nf"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Class&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;?&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beanClass&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;where&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;String&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Object&lt;/span&gt; &lt;span class="n"&gt;bean&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="n"&gt;SQLException&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Examples:&lt;/span&gt;
&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ExampelBean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (1)&lt;/span&gt;
&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ExampelBean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id &amp;lt;= 10"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (2)&lt;/span&gt;
&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ExampelBean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id = {exampleId}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;searchBean&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (3)&lt;/span&gt;
&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ExampelBean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"color = {color}"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;searchBean&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (4)&lt;/span&gt;
&lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;ExampelBean&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;beans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;getList&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ExampleBean&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"example_id"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// (5)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Get all rows in the table.&lt;/li&gt;
&lt;li&gt;Get all rows from the table that satisfy the filter.&lt;/li&gt;
&lt;li&gt;Get all rows from the table that satisfy the templated filter.&lt;/li&gt;
&lt;li&gt;Get all rows from the table that satisfy the templated filter, and order by &lt;code&gt;example_id&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Get all rows from the table, and order by &lt;code&gt;example_id&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James M. Payne</dc:creator><pubDate>Sat, 23 Mar 2019 15:59:12 -0000</pubDate><guid>https://sourceforge.net62377427f9ef534a71a0c1ddf5892ac3484507f9</guid></item></channel></rss>