blob: 717ceec69c1f16feeb368ec28d21269a81a1aa70 [file] [log] [blame]
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- No caching headers -->
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="expires" content="-1"/>
<meta name="keywords" content="JDO, Apache, Java, Data, Objects"/>
<meta name="description" content="Apache JDO - Java Data Objects"/>
<title>JDOQL : Methods</title>
<link rel="icon" type="image/png" href="images/JDOx150.png"/>
<!--
Apache JDO Documentation Template
==================================
This template derived various aspects from Apache Deltaspike template, the Apache ISIS template and the Datanucleus template.
This template uses
* Bootstrap v3.3.7 (https://getbootstrap.com/) for navbar.
* Asciidoctor "foundation" CSS
* Bootswatch "cosmo" theme for Bootstrap (https://bootswatch.com/cosmo).
* Bootstrap TOC plugin v0.4.1 (https://afeld.github.io/bootstrap-toc/) for the table of contents.
* jQuery (necessary for Bootstrap's JavaScript plugins)
* Font-Awesome for some icons used by Asciidoctor
NOTE: tried using Font-Awesome CSS hosted locally but then fails to work!
-->
<link href="css/bootswatch/3.3.7/bootstrap-cosmo.css" rel="stylesheet"/>
<link href="css/bootstrap-toc/0.4.1/bootstrap-toc.min.css" rel="stylesheet"/>
<link href="css/asciidoctor/foundation.css" rel="stylesheet"/>
<link href="css/datanucleus_theme.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap/3.3.7/bootstrap.min.js"></script>
<script src="js/bootstrap-toc/0.4.1/bootstrap-toc.min.js"></script>
<!-- Coderay syntax formatter -->
<style type="text/css">
/* Stylesheet for CodeRay to match GitHub theme | MIT License | http://foundation.zurb.com */
pre.CodeRay{background:#f7f7f8}
.CodeRay .line-numbers{border-right:1px solid currentColor;opacity:.35;padding:0 .5em 0 0}
.CodeRay span.line-numbers{display:inline-block;margin-right:.75em}
.CodeRay .line-numbers strong{color:#000}
table.CodeRay{border-collapse:separate;border:0;margin-bottom:0;background:none}
table.CodeRay td{vertical-align:top;line-height:inherit}
table.CodeRay td.line-numbers{text-align:right}
table.CodeRay td.code{padding:0 0 0 .75em}
.CodeRay .debug{color:#fff !important;background:#000080 !important}
.CodeRay .annotation{color:#007}
.CodeRay .attribute-name{color:#000080}
.CodeRay .attribute-value{color:#700}
.CodeRay .binary{color:#509}
.CodeRay .comment{color:#998;font-style:italic}
.CodeRay .char{color:#04d}
.CodeRay .char .content{color:#04d}
.CodeRay .char .delimiter{color:#039}
.CodeRay .class{color:#458;font-weight:bold}
.CodeRay .complex{color:#a08}
.CodeRay .constant,.CodeRay .predefined-constant{color:#008080}
.CodeRay .color{color:#099}
.CodeRay .class-variable{color:#369}
.CodeRay .decorator{color:#b0b}
.CodeRay .definition{color:#099}
.CodeRay .delimiter{color:#000}
.CodeRay .doc{color:#970}
.CodeRay .doctype{color:#34b}
.CodeRay .doc-string{color:#d42}
.CodeRay .escape{color:#666}
.CodeRay .entity{color:#800}
.CodeRay .error{color:#808}
.CodeRay .exception{color:inherit}
.CodeRay .filename{color:#099}
.CodeRay .function{color:#900;font-weight:bold}
.CodeRay .global-variable{color:#008080}
.CodeRay .hex{color:#058}
.CodeRay .integer,.CodeRay .float{color:#099}
.CodeRay .include{color:#555}
.CodeRay .inline{color:#000}
.CodeRay .inline .inline{background:#ccc}
.CodeRay .inline .inline .inline{background:#bbb}
.CodeRay .inline .inline-delimiter{color:#d14}
.CodeRay .inline-delimiter{color:#d14}
.CodeRay .important{color:#555;font-weight:bold}
.CodeRay .interpreted{color:#b2b}
.CodeRay .instance-variable{color:#008080}
.CodeRay .label{color:#970}
.CodeRay .local-variable{color:#963}
.CodeRay .octal{color:#40e}
.CodeRay .predefined{color:#369}
.CodeRay .preprocessor{color:#579}
.CodeRay .pseudo-class{color:#555}
.CodeRay .directive{font-weight:bold}
.CodeRay .type{font-weight:bold}
.CodeRay .predefined-type{color:inherit}
.CodeRay .reserved,.CodeRay .keyword {color:#000;font-weight:bold}
.CodeRay .key{color:#808}
.CodeRay .key .delimiter{color:#606}
.CodeRay .key .char{color:#80f}
.CodeRay .value{color:#088}
.CodeRay .regexp .delimiter{color:#808}
.CodeRay .regexp .content{color:#808}
.CodeRay .regexp .modifier{color:#808}
.CodeRay .regexp .char{color:#d14}
.CodeRay .regexp .function{color:#404;font-weight:bold}
.CodeRay .string{color:#d20}
.CodeRay .string .string .string{background:#ffd0d0}
.CodeRay .string .content{color:#d14}
.CodeRay .string .char{color:#d14}
.CodeRay .string .delimiter{color:#d14}
.CodeRay .shell{color:#d14}
.CodeRay .shell .delimiter{color:#d14}
.CodeRay .symbol{color:#990073}
.CodeRay .symbol .content{color:#a60}
.CodeRay .symbol .delimiter{color:#630}
.CodeRay .tag{color:#008080}
.CodeRay .tag-special{color:#d70}
.CodeRay .variable{color:#036}
.CodeRay .insert{background:#afa}
.CodeRay .delete{background:#faa}
.CodeRay .change{color:#aaf;background:#007}
.CodeRay .head{color:#f8f;background:#505}
.CodeRay .insert .insert{color:#080}
.CodeRay .delete .delete{color:#800}
.CodeRay .change .change{color:#66f}
.CodeRay .head .head{color:#f4f}
</style>
</head>
<body data-spy="scroll" data-target="#toc">
<!-- Navbar -->
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
<div class="navbar-header">
<!-- Three line menu button for use on mobile screens -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- 'style' added to align image with navbar. FIX THIS -->
<a class="navbar-brand" href="https://db.apache.org/jdo/">
<img style="margin-top: -12px;" alt="Brand" width="45.5" height="45.5" src="images/JDOx150.png"/>
</a>
<!-- TODO Any way to abstract the version from Maven? -->
<a class="navbar-brand" href="index.html">Apache JDO</a>
</div>
<!-- Navbar that will collapse on mobile screens -->
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<!-- menu item General -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">General<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="why_jdo.html">Why JDO?</a></li>
<li><a href="getting-started.html">Getting Started</a></li>
<li><a href="specifications.html">Specifications</a></li>
<li><a href="tck.html">TCK</a></li>
<li><a href="javadoc.html">API Javadoc</a></li>
<li role="separator" class="divider"></li>
<li><a href="jdo_v_jpa.html">JDO v JPA</a></li>
<li><a href="jdo_v_jpa_api.html">JDO v JPA : API</a></li>
<li><a href="jdo_v_jpa_orm.html">JDO v JPA : ORM</a></li>
<li role="separator" class="divider"></li>
<li><a href="license.html">License</a></li>
<li><a href="impls.html">Implementations</a></li>
<li><a href="jdo_3_0_overview.html">JDO 3.0 Overview</a></li>
<li><a href="references.html">References</a></li>
<li><a href="glossary.html">Glossary</a></li>
</ul>
</li>
<!-- menu item API Usage -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">API Usage<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="pmf.html">PersistenceManagerFactory</a></li>
<li><a href="pm.html">PersistenceManager</a></li>
<li><a href="transactions.html">Transactions</a></li>
<li><a href="attach_detach.html">Attach-Detach</a></li>
<li><a href="fetchgroups.html">Fetch Plan/Groups</a></li>
<li><a href="state_transition.html">Object States</a></li>
<li><a href="object_retrieval.html">Object Retrieval</a></li>
<li><a href="exceptions.html">Exceptions</a></li>
<li><a href="jdohelper.html">JDO Helper</a></li>
<li role="separator" class="divider"></li>
<li><a href="guides-replication.html">Data Replication</a></li>
</ul>
</li>
<!-- menu item Types & Metadata -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Types &amp; Metadata<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="class_types.html">Types of Classes</a></li>
<li><a href="field_types.html">Types of Fields</a></li>
<li role="separator" class="divider"></li>
<!-- <li class="dropdown-header">Metadata</li> -->
<li><a href="metadata.html">MetaData</a></li>
<li><a href="annotations.html">Annotations</a></li>
<li><a href="jdo_dtd.html">jdo DTD/XSD</a></li>
<li><a href="orm_dtd.html">orm DTD/XSD</a></li>
<li><a href="jdoquery_dtd.html">jdoquery DTD/XSD</a></li>
<li><a href="jdoconfig_dtd.html">jdoconfig DTD/XSD</a></li>
<li role="separator" class="divider"></li>
<li><a href="enhancement.html">Bytecode Enhancement</a></li>
</ul>
</li>
<!-- menu item Query -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="background-color:#2385c6">Query<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="query_api.html">Query API</a></li>
<li role="separator" class="divider"></li>
<li><a href="jdoql.html">JDOQL</a></li>
<li><a href="jdoql_methods.html">Methods</a></li>
<li><a href="jdoql_result.html">Result</a></li>
<li><a href="jdoql_quickref.pdf">Quick Ref PDF</a></li>
<li><a href="jdoql_typed.html">JDOQL Typed API</a></li>
<li role="separator" class="divider"></li>
<li><a href="query_sql.html">SQL</a></li>
</ul>
</li>
<!-- menu item Community -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Community<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="get-involved.html">Get Involved</a></li>
<li><a href="team-list.html">Project Team</a></li>
<li><a href="mail-lists.html">Mailing Lists</a></li>
<li><a href="faq.html">FAQ</a></li>
</ul>
</li>
<!-- menu item Development -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Development<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="roadmap.html">RoadMap / TODO</a></li>
<li><a href="downloads.html">Downloads</a></li>
<li><a href="source-code.html">Source Code</a></li>
<li><a href="coding-standards.html">Coding Standards</a></li>
<li><a href="issuetracking.html">Issue Tracking</a></li>
</ul>
</li>
</ul>
<!-- 'style' added to fix height of input box. FIX THIS -->
<form class="navbar-form navbar-left" role="search" id="search-form" action="https://www.google.com/search" method="get" style="padding: 1px 15px;">
<div class="form-group">
<input name="sitesearch" value="db.apache.org/jdo" type="hidden">
<input name="q" type="text" class="form-control" placeholder="Search" style="margin-top: 7px; padding: 1px; border-radius: 5px; height: 30px; vertical-align: middle;">
</div>
</form>
</div>
</div>
</nav>
<div class="container">
<div class="row-fluid">
<div class="col-sm-9">
<!-- <div class="page-title">
<h3>JDOQL : Methods</h3>
</div>
-->
<div id="doc-content">
<div class="sect1">
<h2 id="JDOQL_:_Methods">JDOQL : Methods</h2>
<div class="sectionbody">
<div class="paragraph">
<p>When writing the "filter" for a JDOQL Query you can make use of some
methods on the various Java types. The range of methods included as
standard in JDOQL is not as flexible as with the true Java types, but
the ones that are available are typically of much use.</p>
</div>
<div class="paragraph">
<p><br></p>
</div>
<div class="sect2">
<h3 id="String_Methods">String Methods</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">startsWith(String)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns if the string starts with the passed string</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">startsWith(String, int)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns if the string starts with the passed string, after the specified position</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">endsWith(String)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns if the string ends with the passed string</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">indexOf(String)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the first position of the passed string</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">indexOf(String, int)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the position of the passed string, after the passed position</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">substring(int)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the substring starting from the passed position</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">substring(int, int)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the substring between the passed positions</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">toLowerCase()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the string in lowercase</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">toUpperCase()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the string in UPPERCASE</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">matches(String pattern)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether string matches the passed expression. The pattern argument follows the rules of java.lang.String.matches method.</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">trim()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the string with leading/trailing spaces trimmed</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">length()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the length of the string</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">charAt(int)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the character at the specified position of the string</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Here&#8217;s an example using a Product class, looking for objects whose
abbreviation is the beginning of a trade name. The trade name is provided
as parameter.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Declarative JDOQL :
Query query = pm.newQuery(mydomain.Product.class);
query.setFilter(":tradeName.startsWith(this.abbreviation)");
List results = (List)query.execute("Workbook Advanced");
Single-String JDOQL :
Query query = pm.newQuery(
"SELECT FROM mydomain.Product " +
"WHERE :tradeName.startsWith(this.abbreviation)");
List results = (List)query.execute("Workbook Advanced");</pre>
</div>
</div>
<div class="paragraph">
<p><br></p>
</div>
<div class="paragraph">
<p>Here&#8217;s another example, demonstrating the "matches" method. Consult the
javadocs for Java regular expressions for the syntax of the matches
input.</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Declarative JDOQL :
Query query = pm.newQuery(mydomain.Product.class);
query.setFilter("this.abbreviation.matches(\"a*b\")");
List results = (List)query.execute();
Single-String JDOQL :
Query query = pm.newQuery(
"SELECT FROM mydomain.Product " +
"WHERE this.abbreviation.matches(\"a*b\")");
List results = (List)query.execute();</pre>
</div>
</div>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Collection_Methods">Collection Methods</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">isEmpty()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether the collection is empty</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">contains(value)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether the collection contains the passed element</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">size()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the number of elements in the collection</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Here&#8217;s an example demonstrating use of contains(). We have an Inventory
class that has a Collection of Product objects, and we want to find the
Inventory objects with 2 particular Products in it. Here we make use of
a variable (<em>prd</em> to represent the Product being contained</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Declarative JDOQL :
Query query = pm.newQuery(mydomain.Inventory.class);
query.setFilter("products.contains(prd) &amp;&amp; (prd.name==\"product 1\" || prd.name==\"product 2\")");
List results = (List)query.execute();
Single-String JDOQL:
Query query = pm.newQuery(
"SELECT FROM mydomain.Inventory EXCLUDE SUBCLASSES " +
"WHERE products.contains(prd) &amp;&amp; (prd.name==\"product 1\" || prd.name==\"product 2\")");
List results = (List)query.execute();</pre>
</div>
</div>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="List_Methods">List Methods</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">get(position)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the element at that position in the List (JDO3.1)</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Map_Methods">Map Methods</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">isEmpty()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether the map is empty</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">containsKey(key)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether the map contains the passed key</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">containsValue(value)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns whether the map contains the passed value</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">get(key)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the value from the map with the passed key</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">size()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the number of entries in the map</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Here&#8217;s an example using a Product class as a value in a Map. Our example
represents an organisation that has several Inventories of products.
Each Inventory of products is stored using a Map, keyed by the Product
name. The query searches for all Inventories that contain a product with
the name "product 1".</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Declarative JDOQL :
Query query = pm.newQuery(mydomain.Inventory.class, "products.containsKey(\"product 1\")");
List results = (List)query.execute();
Single-String JDOQL :
Query query = pm.newQuery(
"SELECT FROM mydomain.Inventory EXCLUDE SUBCLASSES " +
"WHERE products.containsKey(\"product 1\")");
List results = (List)query.execute();</pre>
</div>
</div>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Temporal_Methods">Temporal Methods</h3>
<div class="paragraph">
<p>The following methods apply to fields of temporal types.</p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Class</th>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getDate()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the day of the month</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMonth()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the month of the year</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getYear()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the year</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getHour()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the hour</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMinute()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the minute</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.util.Date</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getSecond()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the second</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getDayOfMonth()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the day (of the month) for the date (1-31) in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMonthValue()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the month for the date (1-12) in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDate</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getYear()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the year for the date in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getDayOfMonth()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the day (of the month) for the date in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMonthValue()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the month for the date (1-12) in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getYear()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the year for the date in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getHour()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the hour for the time in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMinute()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the minute for the time in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalDateTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getSecond()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the second for the time in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getHour()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the hour for the time in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getMinute()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the minute for the time in the timezone it was stored</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">java.time.LocalTime</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">getSecond()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the second for the time in the timezone it was stored</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Enum_Methods">Enum Methods</h3>
<div class="paragraph">
<p>The following methods apply to fields of type <em>Enum</em></p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">ordinal()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the ordinal of the enum</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">toString()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the string form of the enum</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Optional_Methods">Optional Methods</h3>
<div class="paragraph">
<p>The following methods apply to fields of type <em>Optional</em></p>
</div>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">get()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the value of the field</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">isPresent()</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns TRUE if the field is not null, and FALSE otherwise</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">orElse(subst)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the value of the object if present, otherwise the "subst"</p></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p><br></p>
</div>
</div>
<div class="sect2">
<h3 id="Other_Methods">Other Methods</h3>
<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Method</th>
<th class="tableblock halign-left valign-top">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.abs(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the absolute value of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.sqrt(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the square root of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.cos(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the cosine of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.sin(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the sine of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.tan(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the tangent of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.acos(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the arc cosine of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.asin(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the arc sine of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.atan(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the arc tangent of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.ceil(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the ceiling of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.floor(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the floor of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.log(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the natural log of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">Math.exp(number)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the exponent of the passed number</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">JDOHelper.getObjectId(object)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the object identity of the passed persistent object</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">JDOHelper.getVersion(object)</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">Returns the version of the passed persistent object</p></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-3">
<nav id="toc" data-spy="affix" data-toggle="toc"></nav>
</div>
</div>
</div>
<footer style="color:#fff; background-color:#222222; padding: 5px;">
<div class="container">
<div class="row" style="margin-top:25px">
<div class="col-sm" align="center">
<a href="https://www.facebook.com/JavaDataObjects" class="externalLink" title="Facebook">Facebook</a>
|
<a href="https://twitter.com/JavaDataObjects" class="externalLink" title="Twitter">Twitter</a>
|
<a href="http://wiki.apache.org/jdo" class="externalLink" title="Wiki">Wiki</a>
|
<a href="http://issues.apache.org/jira/secure/BrowseProject.jspa?id=10630" class="externalLink" title="Issue Tracker">Issue Tracker</a>
|
<a href="mail-lists.html" title="Mailing Lists">Mailing Lists</a>
|
<a href="api31/apidocs/index.html" title="Latest Javadocs">Latest Javadocs</a>
|
<a href="https://privacy.apache.org/policies/privacy-policy-public.html" title="Privacy Policy">Privacy Policy</a>
</div>
</div>
<p class="text-center" style="margin-top:16px">&copy; 2005-2022 Apache Software Foundation. All Rights Reserved.</p>
</div>
</footer>
</body>
</html>