blob: a1824c7f25daf5181402f99a9bf8ba049441ecd6 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: ObjectType</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: ObjectType</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>ObjectType</h2>
<div class="class-description"><p>Base class representing a type of Ignite object.</p>
<p>The class has no public constructor. Only subclasses may be instantiated.</p>
<p>There are two groups of Ignite object types:</p>
<ul>
<li><p>Primitive (simple) types. To fully describe such a type it is enough to specify
Ignite type code <a href="ObjectType.html#.PRIMITIVE_TYPE">ObjectType.PRIMITIVE_TYPE</a> only.</p>
</li>
<li><p>Non-primitive (composite) types. To fully describe such a type
Ignite type code <a href="ObjectType.html#.COMPOSITE_TYPE">ObjectType.COMPOSITE_TYPE</a> with additional information should be specified.
Eg. a kind of map or a kind of collection.</p>
</li>
</ul>
<p>This class helps the Ignite client to make a mapping between JavaScript types
and types used by Ignite.</p>
<p>In many methods the Ignite client does not require to directly specify a type of Ignite object.
In this case the Ignite client tries to make automatic mapping between JavaScript types
and Ignite object types according to the following mapping tables:</p>
<hr>
<p>DEFAULT MAPPING FROM JavaScript type TO Ignite type code.</p>
<p>This mapping is used when an application does not explicitly specify an Ignite type
for a field and is writing data to that field.</p>
<pre>
| JavaScript type | Ignite type code |
| ------------------------- | ----------------------|
| number | DOUBLE |
| boolean | BOOLEAN |
| string | STRING |
| Date | DATE |
| Timestamp* | TIMESTAMP |
| EnumItem* | ENUM |
| Decimal** | DECIMAL |
| BinaryObject* | COMPLEX_OBJECT |
| Array of number | DOUBLE_ARRAY |
| Array of boolean | BOOLEAN_ARRAY |
| Array of string | STRING_ARRAY |
| Array of Date | DATE_ARRAY |
| Array of Timestamp* | TIMESTAMP_ARRAY |
| Array of EnumItem* | ENUM_ARRAY |
| Array of Decimal** | DECIMAL_ARRAY |
| Array of BinaryObject* | OBJECT_ARRAY |
| Array of any other Object | OBJECT_ARRAY |
| Set | COLLECTION (HASH_SET) |
| Map | MAP (HASH_MAP) |
| any other Object | COMPLEX_OBJECT |
</pre>
<p>Type of an array content is determined by the type of the first element of the array.
Empty array has no default mapping.</p>
<p>All other JavaScript types have no default mapping.</p>
<hr>
<p>DEFAULT MAPPING FROM Ignite type code TO JavaScript type.</p>
<p>This mapping is used when an application does not explicitly specify an Ignite type
for a field and is reading data from that field.</p>
<pre>
| Ignite type code | JavaScript type |
| ---------------------------- | --------------------------------------|
| BYTE | number |
| SHORT | number |
| INTEGER | number |
| LONG | number |
| FLOAT | number |
| DOUBLE | number |
| DECIMAL | Decimal** |
| BOOLEAN | boolean |
| STRING | string |
| CHAR | string (one character) |
| UUID | Array of number (16 numbers) |
| DATE | Date |
| TIME | Date |
| TIMESTAMP | Timestamp* |
| ENUM | EnumItem* |
| COMPLEX_OBJECT | BinaryObject* |
| BYTE_ARRAY | Array of number |
| SHORT_ARRAY | Array of number |
| INTEGER_ARRAY | Array of number |
| LONG_ARRAY | Array of number |
| FLOAT_ARRAY | Array of number |
| DOUBLE_ARRAY | Array of number |
| DECIMAL_ARRAY | Array of Decimal** |
| BOOLEAN_ARRAY | Array of boolean |
| STRING_ARRAY | Array of string |
| CHAR_ARRAY | Array of string (one character) |
| UUID_ARRAY | Array of Array of number (16 numbers) |
| DATE_ARRAY | Array of Date |
| TIME_ARRAY | Array of Date |
| TIMESTAMP_ARRAY | Array of Timestamp* |
| ENUM_ARRAY | Array of EnumItem* |
| OBJECT_ARRAY | Array |
| COLLECTION (USER_COL) | Array |
| COLLECTION (ARR_LIST) | Array |
| COLLECTION (LINKED_LIST) | Array |
| COLLECTION (SINGLETON_LIST) | Array |
| COLLECTION (HASH_SET) | Set |
| COLLECTION (LINKED_HASH_SET) | Set |
| COLLECTION (USER_SET) | Set |
| MAP (HASH_MAP) | Map |
| MAP (LINKED_HASH_MAP) | Map |
| NULL | null |
</pre>
<hr>
<p>RETURNED JavaScript types WHEN READING DATA OF THE SPECIFIED Ignite type code.</p>
<p>When an application explicitly specifies an Ignite type for a field
and is reading data from that field - the following JavaScript types
are returned for every concrete Ignite type code -</p>
<p>SEE THE PREVIOUS TABLE with the following additional comments:</p>
<ul>
<li><p>for COMPLEX_OBJECT the Ignite Client returns a JavaScript Object
which is defined by the specified <a href="ComplexObjectType.html">ComplexObjectType</a>.</p>
</li>
<li><p>the returned Map for MAP is defined by the specified <a href="MapObjectType.html">MapObjectType</a>.</p>
</li>
<li><p>the returned Set or Array for COLLECTION is defined by the specified <a href="CollectionObjectType.html">CollectionObjectType</a>.</p>
</li>
<li><p>the returned Array for OBJECT_ARRAY is defined by the specified <a href="ObjectArrayType.html">ObjectArrayType</a>.</p>
</li>
<li><p>NULL cannot be specified as a type of a field but JavaScript null may be returned
as a value of a field.</p>
</li>
</ul>
<hr>
<p>ALLOWED JavaScript types WHEN WRITING DATA OF THE SPECIFIED Ignite type code.</p>
<p>When an application explicitly specifies an Ignite type for a field
and is writing data to that field - the following JavaScript types
are allowed for every concrete Ignite type code -</p>
<p>SEE THE PREVIOUS TABLE with the following additional comments:</p>
<ul>
<li><p>for COMPLEX_OBJECT the Ignite Client allows a JavaScript Object
which is defined by the specified <a href="ComplexObjectType.html">ComplexObjectType</a>.</p>
</li>
<li><p>the allowed Map for MAP is defined by the specified <a href="MapObjectType.html">MapObjectType</a>.</p>
</li>
<li><p>the allowed Set or Array for COLLECTION is defined by the specified <a href="CollectionObjectType.html">CollectionObjectType</a>.</p>
</li>
<li><p>the allowed Array for OBJECT_ARRAY is defined by the specified <a href="ObjectArrayType.html">ObjectArrayType</a>.</p>
</li>
<li><p>NULL cannot be specified as a type of a field but JavaScript null is allowed
as value of a field (but not as a key/value in a cache) or as a value of Array/Set/Map element
for all Ignite types, except BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, CHAR, BOOLEAN.</p>
</li>
<li><p>for all *_ARRAY Ignite types an empty JavaScript Array is allowed.</p>
</li>
</ul>
<hr>
<p>COMMENTS TO ALL TABLES</p>
<p>JavaScript type - is a JavaScript primitive or a JavaScript Object
(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures</a>)</p>
<p>(*) Timestamp, EnumItem and BinaryObject - are JavaScript Objects introduced by the Ignite client.</p>
<p>(**) Decimal - is an external JavaScript Object exported into the Ignite client
(<a href="https://github.com/MikeMcl/decimal.js">https://github.com/MikeMcl/decimal.js</a>)</p>
<p>Ignite type code - is the type code of an Ignite primitive type (<a href="ObjectType.html#.PRIMITIVE_TYPE">ObjectType.PRIMITIVE_TYPE</a>)
or an Ignite composite type (<a href="ObjectType.html#.COMPOSITE_TYPE">ObjectType.COMPOSITE_TYPE</a>).</p>
<hr></div>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line291">line 291</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id=".COMPOSITE_TYPE"><span class="type-signature">(static, readonly) </span>COMPOSITE_TYPE<span class="type-signature"></span></h4>
<div class="description">
<p>Supported Ignite type codes for non-primitive (composite) types.</p>
</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>OBJECT_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>23</p></td>
</tr>
<tr>
<td class="name"><code>COLLECTION</code></td>
<td class="type">
</td>
<td class="description last"><p>24</p></td>
</tr>
<tr>
<td class="name"><code>MAP</code></td>
<td class="type">
</td>
<td class="description last"><p>25</p></td>
</tr>
<tr>
<td class="name"><code>NULL</code></td>
<td class="type">
</td>
<td class="description last"><p>101</p></td>
</tr>
<tr>
<td class="name"><code>COMPLEX_OBJECT</code></td>
<td class="type">
</td>
<td class="description last"><p>103</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".PRIMITIVE_TYPE"><span class="type-signature">(static, readonly) </span>PRIMITIVE_TYPE<span class="type-signature"></span></h4>
<div class="description">
<p>Supported Ignite type codes for primitive (simple) types.</p>
</div>
<h5 class="subsection-title">Properties:</h5>
<table class="props">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>BYTE</code></td>
<td class="type">
</td>
<td class="description last"><p>1</p></td>
</tr>
<tr>
<td class="name"><code>SHORT</code></td>
<td class="type">
</td>
<td class="description last"><p>2</p></td>
</tr>
<tr>
<td class="name"><code>INTEGER</code></td>
<td class="type">
</td>
<td class="description last"><p>3</p></td>
</tr>
<tr>
<td class="name"><code>LONG</code></td>
<td class="type">
</td>
<td class="description last"><p>4</p></td>
</tr>
<tr>
<td class="name"><code>FLOAT</code></td>
<td class="type">
</td>
<td class="description last"><p>5</p></td>
</tr>
<tr>
<td class="name"><code>DOUBLE</code></td>
<td class="type">
</td>
<td class="description last"><p>6</p></td>
</tr>
<tr>
<td class="name"><code>CHAR</code></td>
<td class="type">
</td>
<td class="description last"><p>7</p></td>
</tr>
<tr>
<td class="name"><code>BOOLEAN</code></td>
<td class="type">
</td>
<td class="description last"><p>8</p></td>
</tr>
<tr>
<td class="name"><code>STRING</code></td>
<td class="type">
</td>
<td class="description last"><p>9</p></td>
</tr>
<tr>
<td class="name"><code>UUID</code></td>
<td class="type">
</td>
<td class="description last"><p>10</p></td>
</tr>
<tr>
<td class="name"><code>DATE</code></td>
<td class="type">
</td>
<td class="description last"><p>11</p></td>
</tr>
<tr>
<td class="name"><code>BYTE_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>12</p></td>
</tr>
<tr>
<td class="name"><code>SHORT_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>13</p></td>
</tr>
<tr>
<td class="name"><code>INTEGER_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>14</p></td>
</tr>
<tr>
<td class="name"><code>LONG_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>15</p></td>
</tr>
<tr>
<td class="name"><code>FLOAT_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>16</p></td>
</tr>
<tr>
<td class="name"><code>DOUBLE_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>17</p></td>
</tr>
<tr>
<td class="name"><code>CHAR_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>18</p></td>
</tr>
<tr>
<td class="name"><code>BOOLEAN_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>19</p></td>
</tr>
<tr>
<td class="name"><code>STRING_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>20</p></td>
</tr>
<tr>
<td class="name"><code>UUID_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>21</p></td>
</tr>
<tr>
<td class="name"><code>DATE_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>22</p></td>
</tr>
<tr>
<td class="name"><code>ENUM</code></td>
<td class="type">
</td>
<td class="description last"><p>28</p></td>
</tr>
<tr>
<td class="name"><code>ENUM_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>29</p></td>
</tr>
<tr>
<td class="name"><code>DECIMAL</code></td>
<td class="type">
</td>
<td class="description last"><p>30</p></td>
</tr>
<tr>
<td class="name"><code>DECIMAL_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>31</p></td>
</tr>
<tr>
<td class="name"><code>TIMESTAMP</code></td>
<td class="type">
</td>
<td class="description last"><p>33</p></td>
</tr>
<tr>
<td class="name"><code>TIMESTAMP_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>34</p></td>
</tr>
<tr>
<td class="name"><code>TIME</code></td>
<td class="type">
</td>
<td class="description last"><p>36</p></td>
</tr>
<tr>
<td class="name"><code>TIME_ARRAY</code></td>
<td class="type">
</td>
<td class="description last"><p>37</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ObjectType.js.html">ObjectType.js</a>, <a href="ObjectType.js.html#line24">line 24</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BinaryObject.html">BinaryObject</a></li><li><a href="CacheClient.html">CacheClient</a></li><li><a href="CacheConfiguration.html">CacheConfiguration</a></li><li><a href="CacheEntry.html">CacheEntry</a></li><li><a href="CacheKeyConfiguration.html">CacheKeyConfiguration</a></li><li><a href="CollectionObjectType.html">CollectionObjectType</a></li><li><a href="ComplexObjectType.html">ComplexObjectType</a></li><li><a href="CompositeType.html">CompositeType</a></li><li><a href="Cursor.html">Cursor</a></li><li><a href="EnumItem.html">EnumItem</a></li><li><a href="IgniteClient.html">IgniteClient</a></li><li><a href="IgniteClientConfiguration.html">IgniteClientConfiguration</a></li><li><a href="IgniteClientError.html">IgniteClientError</a></li><li><a href="IllegalStateError.html">IllegalStateError</a></li><li><a href="LostConnectionError.html">LostConnectionError</a></li><li><a href="MapObjectType.html">MapObjectType</a></li><li><a href="ObjectArrayType.html">ObjectArrayType</a></li><li><a href="ObjectType.html">ObjectType</a></li><li><a href="OperationError.html">OperationError</a></li><li><a href="Query.html">Query</a></li><li><a href="QueryEntity.html">QueryEntity</a></li><li><a href="QueryField.html">QueryField</a></li><li><a href="QueryIndex.html">QueryIndex</a></li><li><a href="ScanQuery.html">ScanQuery</a></li><li><a href="SqlFieldsCursor.html">SqlFieldsCursor</a></li><li><a href="SqlFieldsQuery.html">SqlFieldsQuery</a></li><li><a href="SqlQuery.html">SqlQuery</a></li><li><a href="Timestamp.html">Timestamp</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue May 22 2018 12:08:49 GMT+0300 (Russia TZ 2 Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>