| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (version 1.7.0_121) on Fri Jan 06 19:36:28 UTC 2017 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>BooleanRepresentation (OpenJPA Parent POM 2.4.2 API)</title> |
| <meta name="date" content="2017-01-06"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="BooleanRepresentation (OpenJPA Parent POM 2.4.2 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar_top"> |
| <!-- --> |
| </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BooleanRepresentation.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/openjpa/jdbc/sql/AccessDictionary.html" title="class in org.apache.openjpa.jdbc.sql"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.html" title="class in org.apache.openjpa.jdbc.sql"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/openjpa/jdbc/sql/BooleanRepresentation.html" target="_top">Frames</a></li> |
| <li><a href="BooleanRepresentation.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.openjpa.jdbc.sql</div> |
| <h2 title="Interface BooleanRepresentation" class="title">Interface BooleanRepresentation<REPRESENTATION_TYPE></h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>REPRESENTATION_TYPE</code> - the java type which is used to store the Boolean in the database, |
| e.g. <code>String</code> or <code>Integer</code></dd></dl> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.BooleanBooleanRepresentation.html" title="class in org.apache.openjpa.jdbc.sql">BooleanRepresentationFactory.BooleanBooleanRepresentation</a>, <a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.Int10BooleanRepresentation.html" title="class in org.apache.openjpa.jdbc.sql">BooleanRepresentationFactory.Int10BooleanRepresentation</a>, <a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.StringBooleanRepresentation.html" title="class in org.apache.openjpa.jdbc.sql">BooleanRepresentationFactory.StringBooleanRepresentation</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="strong">BooleanRepresentation<REPRESENTATION_TYPE></span></pre> |
| <div class="block"><p>Defines how a <code>Boolean</code> or <code>boolean</code> value |
| gets stored in the database by default.</p> |
| |
| <p>The <a href="../../../../../org/apache/openjpa/jdbc/sql/DBDictionary.html" title="class in org.apache.openjpa.jdbc.sql"><code>DBDictionary</code></a> defines a default representation for <code>Boolean</code> |
| and <code>boolean</code> fields in JPA entities. The <a href="../../../../../org/apache/openjpa/jdbc/sql/OracleDictionary.html" title="class in org.apache.openjpa.jdbc.sql"><code>OracleDictionary</code></a> |
| for example uses a <code>NUMBER(1)</code> with the values <code>(int) 1</code> and <code>(int) 0</code> by default. |
| However, sometimes you like to use a different default representation for Boolean values in your database. |
| If your application likes to store boolean values in a <code>CHAR(1)</code> field with <code>"T"</code> and |
| <code>"F"</code> values then you might configure the <a href="../../../../../org/apache/openjpa/jdbc/sql/DBDictionary.html" title="class in org.apache.openjpa.jdbc.sql"><code>DBDictionary</code></a> |
| to use the <code>"STRING_TF"</code> BooleanRepresentation: |
| <pre> |
| <property name="openjpa.jdbc.DBDictionary" |
| value="(BitTypeName=CHAR(1),BooleanTypeName=CHAR(1),BooleanRepresentation=STRING_10)"/> |
| </pre> |
| |
| Please note that you still need to adopt the mapping separately by setting the |
| <code>BitTypeName</code> and/or <code>BooleanTypeName</code> (depending on your database) to |
| the desired type in the database. |
| </p> |
| |
| <p>The following <code>BooleanRepresentation</code> configuration options are possible: |
| <ul> |
| <li>One of the values of |
| <a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.html#BUILTIN_BOOLEAN_REPRESENTATIONS"><code>BooleanRepresentationFactory.BUILTIN_BOOLEAN_REPRESENTATIONS</code></a> |
| , e.g.: |
| <pre> |
| <property name="openjpa.jdbc.DBDictionary" value="(BooleanRepresentation=STRING_YN)"/> |
| </pre> |
| </li> |
| <li> |
| Two slash (<code>'/'</code>) separated true/false value strings: |
| <pre> |
| <property name="openjpa.jdbc.DBDictionary" value="(BooleanRepresentation=oui/non)"/> |
| </pre> |
| </li> |
| <li> |
| A fully qualified class name of your own <a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html" title="interface in org.apache.openjpa.jdbc.sql"><code>BooleanRepresentation</code></a> |
| implementation, e.g.: |
| <pre> |
| <property name="openjpa.jdbc.DBDictionary" |
| value="(BooleanRepresentation=com.mycompany.MyOwnBoolRepresentation)"/> |
| </pre> |
| </li> |
| </ul> |
| |
| </p> |
| |
| <p>If a single column uses a different representation then they |
| still can tweak this for those columns with the |
| <code>org.apache.openjpa.persistence.ExternalValues</code> annotation.</p></div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span>Methods</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html#getBoolean(java.sql.ResultSet,%20int)">getBoolean</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/sql/ResultSet.html?is-external=true" title="class or interface in java.sql">ResultSet</a> rs, |
| int columnIndex)</code> |
| <div class="block">Read the boolean from the given ResultSet</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html" title="type parameter in BooleanRepresentation">REPRESENTATION_TYPE</a></code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html#getRepresentation(boolean)">getRepresentation</a></strong>(boolean bool)</code> </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><strong><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html#setBoolean(java.sql.PreparedStatement,%20int,%20boolean)">setBoolean</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html?is-external=true" title="class or interface in java.sql">PreparedStatement</a> stmnt, |
| int columnIndex, |
| boolean val)</code> |
| <div class="block">Set the boolean value into the statement</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method_detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="setBoolean(java.sql.PreparedStatement, int, boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setBoolean</h4> |
| <pre>void setBoolean(<a href="http://download.oracle.com/javase/6/docs/api/java/sql/PreparedStatement.html?is-external=true" title="class or interface in java.sql">PreparedStatement</a> stmnt, |
| int columnIndex, |
| boolean val) |
| throws <a href="http://download.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></pre> |
| <div class="block">Set the boolean value into the statement</div> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></code></dd></dl> |
| </li> |
| </ul> |
| <a name="getBoolean(java.sql.ResultSet, int)"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBoolean</h4> |
| <pre>boolean getBoolean(<a href="http://download.oracle.com/javase/6/docs/api/java/sql/ResultSet.html?is-external=true" title="class or interface in java.sql">ResultSet</a> rs, |
| int columnIndex) |
| throws <a href="http://download.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></pre> |
| <div class="block">Read the boolean from the given ResultSet</div> |
| <dl><dt><span class="strong">Throws:</span></dt> |
| <dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</a></code></dd></dl> |
| </li> |
| </ul> |
| <a name="getRepresentation(boolean)"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getRepresentation</h4> |
| <pre><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentation.html" title="type parameter in BooleanRepresentation">REPRESENTATION_TYPE</a> getRepresentation(boolean bool)</pre> |
| <dl><dt><span class="strong">Returns:</span></dt><dd>return the representation for <code>true</code> and <code>false</code></dd></dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar_bottom"> |
| <!-- --> |
| </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BooleanRepresentation.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../../org/apache/openjpa/jdbc/sql/AccessDictionary.html" title="class in org.apache.openjpa.jdbc.sql"><span class="strong">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/openjpa/jdbc/sql/BooleanRepresentationFactory.html" title="class in org.apache.openjpa.jdbc.sql"><span class="strong">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/openjpa/jdbc/sql/BooleanRepresentation.html" target="_top">Frames</a></li> |
| <li><a href="BooleanRepresentation.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip-navbar_bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2006–2017 <a href="http://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |