UNPKG

@harishreddym/baqend

Version:

Baqend JavaScript SDK

3,329 lines (933 loc) 62.1 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Baqend JavaScript SDK 2.14.1 - Class: Metamodel</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 rel="shortcut icon" type="image/x-icon" href="img/favicon.ico"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/bootstrap-baqend.min.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> <link type="text/css" rel="stylesheet" href="styles/font-awesome-4.7.0.css"> </head> <body> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="navbar-inner container"> <!-- Collapsed navigation --> <div class="navbar-header"> <!-- Expander button --> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <!-- Main title --> <a class="navbar-brand" href="/"><img src="img/logo.png"></a> </div> <!-- Expanded navigation --> <div id="nav" class="navbar-collapse collapse"> <!-- Search --> <form class="navbar-right form-inline search-form"> <div class="form-group search-form-group"> <input type="search" class="form-control search-input" id="search-query" placeholder="Search Guide" name="q" autocomplete="off"> <div id="search-results" class="search-results"> <p class="search-no-results">Please enter a search query ...</p> </div> <i class="search-icon fa fa-search"></i> </div> </form> <!-- Main navigation --> <ul class="nav navbar-nav"> <li> <a href="https://dashboard.baqend.com/">Dashboard</a> </li> <!-- Guide Navigation --> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Guide <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="https://www.baqend.com/guide/">Home</a></li> <li><a href="https://www.baqend.com/guide/#speed-kit">Speed Kit</a></li> <li><a href="https://www.baqend.com/guide/#platform">Platform</a></li> <li><a href="https://www.baqend.com/guide/roadmap/">Roadmap</a></li> <li><a href="https://www.baqend.com/guide/topics/faq/">FAQ</a></li> </ul> </li> <!-- Starter Kits --> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Starter Kits <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="https://www.baqend.com/guide/starter-kits/">Starter Kits Overview</a></li> <li><a href="https://www.baqend.com/guide/starter-kits/angular2/">Angular 2 Starter Kit</a></li> <li><a href="https://www.baqend.com/guide/starter-kits/react/">React and Redux Starter Kit</a></li> <li><a href="https://www.baqend.com/guide/starter-kits/bootstrap/">Bootstrap Starter Kit</a></li> <li><a href="https://www.baqend.com/guide/starter-kits/ionic2/">Ionic 2 Starter Kit</a></li> <li><a href="https://www.baqend.com/guide/starter-kits/ionic/">Ionic Starter Kit</a></li> </ul> </li> <li class="active"> <a href="baqend.html">JS API</a> </li> <li> <a href="https://www.baqend.com/tutorial.html">Tutorial</a> </li> </ul> </div> </div> </nav> <div class="box gray pt-32 pb-32"> <div class="container"> <div class="row"> <!-- <div class="col-md-3"></div> --> <div class="bs-sidebar hidden-print fixed affix" role="complementary"> <input class="filter form-control input-sm" type="text" placeholder="FILTER"/> <ul class="nav bs-sidenav"> <li class=""><a href="Acl.html" class="nav-name">Acl</a></li> <li class=""><a href="EntityManager.html" class="nav-name">EntityManager</a></li> <li class=""><a href="EntityManagerFactory.html" class="nav-name">EntityManagerFactory</a></li> <li class=""><a href="GeoPoint.html" class="nav-name">GeoPoint</a></li> <li class=""><a href="RealtimeEvent.html" class="nav-name">RealtimeEvent</a></li> <li class=""><a href="baqend.html" class="nav-name">baqend</a></li> <li class=""> <a href="binding.html" class="nav-name">binding</a> <ul class="nav"> <li class=""><a href="binding.Accessor.html" class="nav-name">Accessor</a></li> <li class=""><a href="binding.DeviceFactory.html" class="nav-name">DeviceFactory</a></li> <li class=""><a href="binding.Enhancer.html" class="nav-name">Enhancer</a></li> <li class=""><a href="binding.Entity.html" class="nav-name">Entity</a></li> <li class=""><a href="binding.EntityFactory.html" class="nav-name">EntityFactory</a></li> <li class=""><a href="binding.Factory.html" class="nav-name">Factory</a></li> <li class=""><a href="binding.File.html" class="nav-name">File</a></li> <li class=""><a href="binding.FileFactory.html" class="nav-name">FileFactory</a></li> <li class=""><a href="binding.Managed.html" class="nav-name">Managed</a></li> <li class=""><a href="binding.ManagedFactory.html" class="nav-name">ManagedFactory</a></li> <li class=""><a href="binding.Role.html" class="nav-name">Role</a></li> <li class=""><a href="binding.User.html" class="nav-name">User</a></li> <li class=""><a href="binding.UserFactory.html" class="nav-name">UserFactory</a></li> </ul> </li> <li class=""> <a href="caching.html" class="nav-name">caching</a> <ul class="nav"> <li class=""><a href="caching.BloomFilter.html" class="nav-name">BloomFilter</a></li> </ul> </li> <li class=""> <a href="connector.html" class="nav-name">connector</a> <ul class="nav"> <li class=""><a href="connector.Connector.html" class="nav-name">Connector</a></li> <li class=""><a href="connector.FetchConnector.html" class="nav-name">FetchConnector</a></li> <li class=""><a href="connector.IFrameConnector.html" class="nav-name">IFrameConnector</a></li> <li class=""><a href="connector.Message.html" class="nav-name">Message</a></li> <li class=""><a href="connector.NodeConnector.html" class="nav-name">NodeConnector</a></li> <li class=""><a href="connector.ObservableStream.html" class="nav-name">ObservableStream</a></li> <li class=""><a href="connector.WebSocketConnector.html" class="nav-name">WebSocketConnector</a></li> <li class=""><a href="connector.XMLHttpConnector.html" class="nav-name">XMLHttpConnector</a></li> <li class=""><a href="connector.ChannelMessage.html" class="nav-name">ChannelMessage</a></li> </ul> </li> <li class=""> <a href="error.html" class="nav-name">error</a> <ul class="nav"> <li class=""><a href="error.CommunicationError.html" class="nav-name">CommunicationError</a></li> <li class=""><a href="error.EntityExistsError.html" class="nav-name">EntityExistsError</a></li> <li class=""><a href="error.IllegalEntityError.html" class="nav-name">IllegalEntityError</a></li> <li class=""><a href="error.PersistentError.html" class="nav-name">PersistentError</a></li> <li class=""><a href="error.RollbackError.html" class="nav-name">RollbackError</a></li> </ul> </li> <li class="active"> <a href="metamodel.html" class="nav-name">metamodel</a> <ul class="nav"> <li class=""><a href="metamodel.Attribute.html" class="nav-name">Attribute</a></li> <li class=""><a href="metamodel.BasicType.html" class="nav-name">BasicType</a></li> <li class=""><a href="metamodel.CollectionAttribute.html" class="nav-name">CollectionAttribute</a></li> <li class=""><a href="metamodel.DbIndex.html" class="nav-name">DbIndex</a></li> <li class=""><a href="metamodel.EmbeddableType.html" class="nav-name">EmbeddableType</a></li> <li class=""><a href="metamodel.EntityType.html" class="nav-name">EntityType</a></li> <li class=""><a href="metamodel.ListAttribute.html" class="nav-name">ListAttribute</a></li> <li class=""><a href="metamodel.ManagedType.html" class="nav-name">ManagedType</a></li> <li class=""><a href="metamodel.MapAttribute.html" class="nav-name">MapAttribute</a></li> <li class="active"><a href="metamodel.Metamodel.html" class="nav-name">Metamodel</a></li> <li class=""><a href="metamodel.ModelBuilder.html" class="nav-name">ModelBuilder</a></li> <li class=""><a href="metamodel.PluralAttribute.html" class="nav-name">PluralAttribute</a></li> <li class=""><a href="metamodel.SetAttribute.html" class="nav-name">SetAttribute</a></li> <li class=""><a href="metamodel.SingularAttribute.html" class="nav-name">SingularAttribute</a></li> <li class=""><a href="metamodel.Type.html" class="nav-name">Type</a></li> </ul> </li> <li class=""> <a href="model.html" class="nav-name">model</a> <ul class="nav"> <li class=""><a href="model.Device.html" class="nav-name">Device</a></li> <li class=""><a href="model.Role.html" class="nav-name">Role</a></li> <li class=""><a href="model.User.html" class="nav-name">User</a></li> </ul> </li> <li class=""> <a href="partialupdate.html" class="nav-name">partialupdate</a> <ul class="nav"> <li class=""><a href="partialupdate.EntityPartialUpdateBuilder.html" class="nav-name">EntityPartialUpdateBuilder</a></li> <li class=""><a href="partialupdate.PartialUpdateBuilder.html" class="nav-name">PartialUpdateBuilder</a></li> <li class=""><a href="partialupdate.UpdateOperation.html" class="nav-name">UpdateOperation</a></li> </ul> </li> <li class=""> <a href="query.html" class="nav-name">query</a> <ul class="nav"> <li class=""><a href="query.Builder.html" class="nav-name">Builder</a></li> <li class=""><a href="query.Filter.html" class="nav-name">Filter</a></li> <li class=""><a href="query.Node.html" class="nav-name">Node</a></li> <li class=""><a href="query.Operator.html" class="nav-name">Operator</a></li> <li class=""><a href="query.Query.html" class="nav-name">Query</a></li> <li class=""><a href="query.Stream.html" class="nav-name">Stream</a></li> <li class=""><a href="query.Condition.html" class="nav-name">Condition</a></li> </ul> </li> <li class=""> <a href="util.html" class="nav-name">util</a> <ul class="nav"> <li class=""><a href="util.Code.html" class="nav-name">Code</a></li> <li class=""><a href="util.Lockable.html" class="nav-name">Lockable</a></li> <li class=""><a href="util.Logger.html" class="nav-name">Logger</a></li> <li class=""><a href="util.Metadata.html" class="nav-name">Metadata</a></li> <li class=""><a href="util.Modules.html" class="nav-name">Modules</a></li> <li class=""><a href="util.Permission.html" class="nav-name">Permission</a></li> <li class=""><a href="util.PushMessage.html" class="nav-name">PushMessage</a></li> <li class=""><a href="util.TokenStorage.html" class="nav-name">TokenStorage</a></li> <li class=""><a href="util.ValidationResult.html" class="nav-name">ValidationResult</a></li> <li class=""><a href="util.Validator.html" class="nav-name">Validator</a></li> <li class=""><a href="util.TokenStorageFactory.html" class="nav-name">TokenStorageFactory</a></li> </ul> </li> </ul> </div> <div class="col-md-12" id="main"> <div class="content"> <h1 class="page-title">Class: Metamodel</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span> <span class="ancestors"><a href="metamodel.html">metamodel</a>.</span>Metamodel<span class="signature">(entityManagerFactory<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Metamodel"><span class="type-signature"></span>new Metamodel<span class="signature">(entityManagerFactory<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4> <div class="description"> <p>Constructs a new metamodel instance which represents the complete schema of one baqend app</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>entityManagerFactory</code></td> <td class="type"> <span class="param-type"><a href="EntityManagerFactory.html">EntityManagerFactory</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line18">line 18</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Extends</h3> <ul> <li><a href="util.Lockable.html">util.Lockable</a></li> </ul> <h3 class="subsection-title">Members</h3> <h4 class="name" id="baseTypes"><span class="type-signature"></span>baseTypes<span class="type-signature"> :Object.&lt;string, metamodel.BasicType></span></h4> <h5>Type:</h5> <ul> <li> <span class="param-type">Object.&lt;string, metamodel.BasicType></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line50">line 50</a> </li></ul></dd> </dl> <h4 class="name" id="embeddables"><span class="type-signature"></span>embeddables<span class="type-signature"> :Object.&lt;string, metamodel.EmbeddableType></span></h4> <h5>Type:</h5> <ul> <li> <span class="param-type">Object.&lt;string, metamodel.EmbeddableType></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line45">line 45</a> </li></ul></dd> </dl> <h4 class="name" id="enhancer"><span class="type-signature"></span>enhancer<span class="type-signature"> :<a href="binding.Enhancer.html">binding.Enhancer</a></span></h4> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="binding.Enhancer.html">binding.Enhancer</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line55">line 55</a> </li></ul></dd> </dl> <h4 class="name" id="entities"><span class="type-signature"></span>entities<span class="type-signature"> :Object.&lt;string, metamodel.EntityType></span></h4> <h5>Type:</h5> <ul> <li> <span class="param-type">Object.&lt;string, metamodel.EntityType></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line40">line 40</a> </li></ul></dd> </dl> <h4 class="name" id="entityManagerFactory"><span class="type-signature"></span>entityManagerFactory<span class="type-signature"> :<a href="EntityManagerFactory.html">EntityManagerFactory</a></span></h4> <h5>Type:</h5> <ul> <li> <span class="param-type"><a href="EntityManagerFactory.html">EntityManagerFactory</a></span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line35">line 35</a> </li></ul></dd> </dl> <h4 class="name" id="isInitialized"><span class="type-signature"></span>isInitialized<span class="type-signature"> :boolean</span></h4> <div class="description"> <p>Defines if the Metamodel has been finalized</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">boolean</span> </li> </ul> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line30">line 30</a> </li></ul></dd> </dl> <h4 class="name" id="isReady"><span class="type-signature"></span>isReady<span class="type-signature"> :boolean</span></h4> <div class="description"> <p>Indicates if there is currently no exclusive operation executed<br><code>true</code> If no exclusive lock is hold</p> </div> <h5>Type:</h5> <ul> <li> <span class="param-type">boolean</span> </li> </ul> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="util.Lockable.html#isReady">util.Lockable#isReady</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_util_Lockable.js.html">lib/util/Lockable.js</a>, <a href="lib_util_Lockable.js.html#line34">line 34</a> </li></ul></dd> </dl> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="addType"><span class="type-signature"></span>addType<span class="signature">(type)</span><span class="type-signature"> &rarr; {<a href="metamodel.Type.html">metamodel.Type</a>}</span></h4> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>type</code></td> <td class="type"> <span class="param-type"><a href="metamodel.Type.html">metamodel.Type</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line150">line 150</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>the added type</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="metamodel.Type.html">metamodel.Type</a></span> </dd> </dl> <h4 class="name" id="baseType"><span class="type-signature"></span>baseType<span class="signature">(typeConstructor)</span><span class="type-signature"> &rarr; {<a href="metamodel.BasicType.html">metamodel.BasicType</a>}</span></h4> <div class="description"> <p>Return the metamodel basic type representing the native class.</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>typeConstructor</code></td> <td class="type"> <span class="param-type">Class.&lt;*></span> | <span class="param-type">string</span> </td> <td class="description last"><p>the type of the represented native class</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line107">line 107</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>the metamodel basic type</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="metamodel.BasicType.html">metamodel.BasicType</a></span> </dd> </dl> <h4 class="name" id="createIndex"><span class="type-signature"></span>createIndex<span class="signature">(bucket, index)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4> <div class="description"> <p>Creates an index</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bucket</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>Name of the Bucket</p></td> </tr> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type"><a href="metamodel.DbIndex.html">metamodel.DbIndex</a></span> </td> <td class="description last"><p>Will be applied for the given bucket</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line274">line 274</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;*></span> </dd> </dl> <h4 class="name" id="dropAllIndexes"><span class="type-signature"></span>dropAllIndexes<span class="signature">(bucket)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4> <div class="description"> <p>Drops all indexes</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bucket</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>Indexes will be dropped for the given bucket</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line299">line 299</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;*></span> </dd> </dl> <h4 class="name" id="dropIndex"><span class="type-signature"></span>dropIndex<span class="signature">(bucket, index)</span><span class="type-signature"> &rarr; {Promise.&lt;*>}</span></h4> <div class="description"> <p>Drops an index</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bucket</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>Name of the Bucket</p></td> </tr> <tr> <td class="name"><code>index</code></td> <td class="type"> <span class="param-type"><a href="metamodel.DbIndex.html">metamodel.DbIndex</a></span> </td> <td class="description last"><p>Will be dropped for the given bucket</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line287">line 287</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;*></span> </dd> </dl> <h4 class="name" id="embeddable"><span class="type-signature"></span>embeddable<span class="signature">(typeConstructor)</span><span class="type-signature"> &rarr; {<a href="metamodel.EmbeddableType.html">metamodel.EmbeddableType</a>}</span></h4> <div class="description"> <p>Return the metamodel embeddable type representing the embeddable class.</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>typeConstructor</code></td> <td class="type"> <span class="param-type">Class.&lt;binding.Managed></span> | <span class="param-type">string</span> </td> <td class="description last"><p>the type of the represented embeddable class</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line131">line 131</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>the metamodel embeddable type</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="metamodel.EmbeddableType.html">metamodel.EmbeddableType</a></span> </dd> </dl> <h4 class="name" id="entity"><span class="type-signature"></span>entity<span class="signature">(typeConstructor)</span><span class="type-signature"> &rarr; {<a href="metamodel.EntityType.html">metamodel.EntityType</a>}</span></h4> <div class="description"> <p>Return the metamodel entity type representing the entity.</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>typeConstructor</code></td> <td class="type"> <span class="param-type">Class.&lt;binding.Entity></span> | <span class="param-type">string</span> </td> <td class="description last"><p>the type of the represented entity</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line97">line 97</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>the metamodel entity type</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="metamodel.EntityType.html">metamodel.EntityType</a></span> </dd> </dl> <h4 class="name" id="fromJSON"><span class="type-signature"></span>fromJSON<span class="signature">(json)</span><span class="type-signature"> &rarr; {void}</span></h4> <div class="description"> <p>Replace the current schema by the provided one in json</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>json</code></td> <td class="type"> <span class="param-type">json</span> </td> <td class="description last"><p>The json schema data</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line256">line 256</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">void</span> </dd> </dl> <h4 class="name" id="getIndexes"><span class="type-signature"></span>getIndexes<span class="signature">(bucket)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;metamodel.DbIndex>>}</span></h4> <div class="description"> <p>Loads all indexes for the given bucket</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bucket</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>Current indexes will be loaded for the given bucket</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line310">line 310</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Array.&lt;metamodel.DbIndex>></span> </dd> </dl> <h4 class="name" id="getRef"><span class="type-signature"></span>getRef<span class="signature">(arg)</span><span class="type-signature"> &rarr; {string}</span></h4> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>arg</code></td> <td class="type"> <span class="param-type">Class.&lt;binding.Managed></span> | <span class="param-type">string</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line76">line 76</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="init"><span class="type-signature"></span>init<span class="signature">(jsonMetamodel<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {void}</span></h4> <div class="description"> <p>Prepare the Metamodel for custom schema creation</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>jsonMetamodel</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>initialize the metamodel with the serialized json schema</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line63">line 63</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">void</span> </dd> </dl> <h4 class="name" id="load"><span class="type-signature"></span>load<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;metamodel.Metamodel>}</span></h4> <div class="description"> <p>Load all schema data from the server</p> </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line179">line 179</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;metamodel.Metamodel></span> </dd> </dl> <h4 class="name" id="managedType"><span class="type-signature"></span>managedType<span class="signature">(typeConstructor)</span><span class="type-signature"> &rarr; {<a href="metamodel.Type.html">metamodel.Type</a>}</span></h4> <div class="description"> <p>Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>typeConstructor</code></td> <td class="type"> <span class="param-type">Class.&lt;binding.Managed></span> | <span class="param-type">string</span> </td> <td class="description last"><p>the type of the represented managed class</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_metamodel_Metamodel.js.html">lib/metamodel/Metamodel.js</a>, <a href="lib_metamodel_Metamodel.js.html#line142">line 142</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>the metamodel managed type</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type"><a href="metamodel.Type.html">metamodel.Type</a></span> </dd> </dl> <h4 class="name" id="ready"><span class="type-signature"></span>ready<span class="signature">(doneCallback<span class="signature-attributes">opt</span>, failCallback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;this>}</span></h4> <div class="description"> <p>Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled</p> </div> <h5>Parameters:</h5> <table class="params table"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>doneCallback</code></td> <td class="type"> <span class="param-type"><a href="util.Lockable.html#~doneCallback">util.Lockable~doneCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>The callback which will be invoked when the previously<br>operations on this object is completed.</p></td> </tr> <tr> <td class="name"><code>failCallback</code></td> <td class="type"> <span class="param-type"><a href="util.Lockable.html#~failCallback">util.Lockable~failCallback</a></span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="description last"><p>When the lock can't be released caused by a none<br>recoverable error</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a href="util.Lockable.html#ready">util.Lockable#ready</a> </li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="lib_util_Lockable.js.html">lib/util/Lockable.js</a>, <a href="lib_util_Lockable.js.html#line47">line 47</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>A promise which completes successfully, when the previously requested<br>operation completes</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;this></span> </dd> </dl> <h4 class="name" id="save"><span class="type-signature"></span>save<span class="signature">(managedType<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise.&lt;metamodel.Metamodel>}</span></h4> <div class="description"> <p>Store all local schema data on the server, or