移动数据库引擎Realm Java v2.0.0 发布

jopen 7年前
   <p style="text-align: center;"><img alt="" src="https://simg.open-open.com/show/0f3ae104c7167272412079964cb5969e.png" /></p>    <p> </p>    <p>Realm 是一个跨平台的移动数据库引擎,可运行于手机、平板和可穿戴设备之上。于 2014 年 7 月发布,准确来说,它是专门为移动应用所设计的数据持久化解决方案之一。 Realm 可以轻松地移植到您的项目当中,并且绝大部分常用的功能(比如说插入、查询等等)都可以用一行简单的代码轻松完成! Realm 并不是对 Core Data 的简单封装,相反地, Realm 并不是基于 Core Data ,也不是基于 SQLite 所构建的。它拥有自己的数据库存储引擎,可以高效且快速地完成数据库的构建操作。</p>    <p> </p>    <h2><strong>更新日志</strong></h2>    <h3>重大更改</h3>    <ul>     <li>Files written by Realm 2.0 cannot be read by 1.x or earlier versions. Old files can still be opened.</li>     <li>It is now required to call <code>Realm.init(Context)</code> before calling any other Realm API.</li>     <li>Removed <code>RealmConfiguration.Builder(Context)</code>, <code>RealmConfiguration.Builder(Context, File)</code> and<code>RealmConfiguration.Builder(File)</code> constructors.</li>     <li><code>isValid()</code> now always returns <code>true</code> instead of <code>false</code> for unmanaged <code>RealmObject</code> and <code>RealmList</code>. This puts it in line with the behaviour of the Cocoa and .NET API's (#3101).</li>     <li>armeabi is not supported anymore.</li>     <li>Added new <code>RealmFileException</code>.      <ul>       <li><code>IncompatibleLockFileException</code> has been removed and replaced by <code>RealmFileException</code> with kind<code>INCOMPATIBLE_LOCK_FILE</code>.</li>       <li><code>RealmIOExcpetion</code> has been removed and replaced by <code>RealmFileException</code>.</li>      </ul> </li>     <li><code>RealmConfiguration.Builder.assetFile(Context, String)</code> has been renamed to<code>RealmConfiguration.Builder.assetFile(String)</code>.</li>     <li>Object with primary key is now required to define it when the object is created. This means that<code>Realm.createObject(Class<E>)</code> and <code>DynamicRealm.createObject(String)</code> now throws <code>RealmException</code> if they are used to create an object with a primary key field. Use <code>Realm.createObject(Class<E>, Object)</code> or<code>DynamicRealm.createObject(String, Object)</code> instead.</li>     <li>Importing from JSON without the primary key field defined in the JSON object now throws <code>IllegalArgumentException</code>.</li>     <li>Now <code>Realm.beginTransaction()</code>, <code>Realm.executeTransaction()</code> and <code>Realm.waitForChange()</code> throw<code>RealmMigrationNeededException</code> if a remote process introduces incompatible schema changes (#3409).</li>     <li>The primary key value of an object can no longer be changed after the object was created. Instead a new object must be created and all fields copied over.</li>     <li>Now <code>Realm.createObject(Class)</code> and <code>Realm.createObject(Class,Object)</code> take the values from the model's fields and default constructor. Creating objects through the <code>DynamicRealm</code> does not use these values (#777).</li>     <li>When <code>Realm.create*FromJson()</code>s create a new <code>RealmObject</code>, now they take the default values defined by the field itself and its default constructor for those fields that are not defined in the JSON object.</li>    </ul>    <h3>增强功能</h3>    <ul>     <li>Added <code>realmObject.isManaged()</code>, <code>RealmObject.isManaged(obj)</code> and <code>RealmCollection.isManaged()</code> (#3101).</li>     <li>Added <code>RealmConfiguration.Builder.directory(File)</code>.</li>     <li><code>RealmLog</code> has been moved to the public API. It is now possible to control which events Realm emit to Logcat. See the<code>RealmLog</code> class for more details.</li>     <li>Typed <code>RealmObject</code>s can now continue to access their fields properly even though the schema was changed while the Realm was open (#3409).</li>     <li>A <code>RealmMigrationNeededException</code> will be thrown with a cause to show the detailed message when a migration is needed and the migration block is not in the <code>RealmConfiguration</code>.</li>    </ul>    <h3>Bug 修复</h3>    <ul>     <li>Fixed a lint error in proxy classes when the 'minSdkVersion' of user's project is smaller than 11 (#3356).</li>     <li>Fixed a potential crash when there were lots of async queries waiting in the queue.</li>     <li>Fixed a bug causing the Realm Transformer to not transform field access in the model's constructors (#3361).</li>     <li>Fixed a bug causing a build failure when the Realm Transformer adds accessors to a model class that was already transformed in other project (#3469).</li>     <li>Fixed a bug causing the <code>NullPointerException</code> when calling getters/setters in the model's constructors (#2536).</li>    </ul>    <h3>内部</h3>    <ul>     <li>Moved JNI build to CMake.</li>     <li>Updated Realm Core to 2.0.0.</li>     <li>Updated ReLinker to 1.2.2.</li>    </ul>    <p> </p>    <h2>下载</h2>    <ul>     <li><a href="/misc/goto?guid=4958994042151895249" rel="nofollow"><strong>Source code</strong> (zip)</a></li>     <li><a href="/misc/goto?guid=4958994042248309263" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li>    </ul>    <p> </p>    <p>本站原创,转载时保留以下信息:<br /> 本文转自:深度开源(open-open.com)<br /> 原文地址:<a href="http://www.open-open.com/news/view/c200ff2">http://www.open-open.com/news/view/c200ff2</a></p>