realm

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed after extending RealmObject class

隐身守侯 提交于 2019-12-24 07:15:25
问题 I'm trying to learn Realm for Android and followed the installation instructions at https://realm.io/docs/java/latest/#installation. Project build.gradle file buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.2.2' classpath "io.realm:realm-gradle-plugin:2.1.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type:

RealmSwift : required public init() error

不羁的心 提交于 2019-12-24 07:14:26
问题 import RealmSwift import Realm public class Card : Object { dynamic var username: String = "" dynamic var firstName: String = "" dynamic var lastName: String = "" convenience init?(dictionary: [String:Any]?) { guard let dictionary = dictionary , let username = dictionary["username"] as? String else { return else} self.init() self.username = username self.firstName = firstName self.lastName = lastName } required public init() { fatalError("init() has not been implemented") } required public

带你揭秘Shiro(一)

扶醉桌前 提交于 2019-12-24 07:01:35
提到Shiro,不得不先介绍RBAC介绍 RBAC介绍:   RBAC是基于角色的访问控制(Role-Based Access Control )在 RBAC 中,权限与角色相关联,用户通过成为适当角色的成员而得到这些角色的权限。这就极大地简化了权限的管理。这样管理都是层级相互依赖的,权限赋予给角色,而把角色又赋予用户,这样的权限设计很清楚,管理起来很方便。 在RBAC模型里面,有3个基础组成部分,分别是:用户、角色和权限。 RBAC通过定义角色的权限,并对用户授予某个角色从而来控制用户的权限,实现了用户和权限的逻辑分离,极大地方便了权限的管理,在讲解之前,先介绍一些名词: User(用户):每个用户都有唯一的UID识别,并被授予不同的角色 Role(角色):不同角色具有不同的权限 Permission(权限):访问权限 用户-角色映射:用户和角色之间的映射关系 角色-权限映射:角色和权限之间的映射 权限管理:(包含两部分:用户认证,用户授权)   只要有用户参与的管理系统一般都有权限管理,权限管理实现对用户访问系统的控制,按照安全规则实现用户可以访问自己被授权的资源。 用户认证: 关键对象: subject:主体,理解为用户,可能是程序,都要去访问系统的资源,系统需要对subject进行身份认证。 principal:身份信息,通常是唯一的,一个主体还有多个身份信息

How can I properly copy objects from one Realm object to another object

社会主义新天地 提交于 2019-12-24 06:29:34
问题 Based on the following code I would like to be able to create a new ItemList from an existing one. In other words I have an ItemList called First List and I want to create a new ItemList , call it Second List and fill it with the Item s from First List . The way I have it right now is that it creates the Second List as expected, the Item s from the First List show in Second List but what doesn't work is when I want to delete only the Item s from First List , it deletes Item s from both lists.

realm null object reference

折月煮酒 提交于 2019-12-24 06:28:47
问题 when i start my app with out network and call my data in my database app crash and this is my code public void getAllMovies() { findData = realm.where(MovieDb.class).findAll(); movieArrayList = new ArrayList(findData); movieMethod(); } and i make my conflagration in here public class myApplication extends Application { @Override public void onCreate() { super.onCreate(); RealmConfiguration configuration = new RealmConfiguration .Builder(this).name("Movie_database.realm").build(); Realm

Merge multiple RealmList´s and sort resulting List?

半腔热情 提交于 2019-12-24 06:00:35
问题 I just started using Realm in my current android app and so far it is great. Unfortunately I´ve encountered a problem: In my app the user can add different kind of entries (What did he eat this day? What drinks did he have?, etc.) into his diary. One DiaryEntry object represents the sum off all entries for a given day (e.g. 21.05.2017, etc.). public class DiaryEntry extends RealmObject { // ID of the day this diary entry represents @PrimaryKey private Integer dateId; private RealmList

Shiro-菜鸟初试篇

孤街浪徒 提交于 2019-12-24 05:21:33
Shiro 框架介绍 Subject(主体) shiro中是一个接口,接口中定义了很多认证授权相关的方法 通过安全管理器进行认证和授权。 SecuritManager(安全管理器) 它是shiro的核心 负责对所有的subject进行安全管理。 通过SecuritManager可以完成subject的认证、授权等操作。 SecurityManager通过Authenticator进行认证,通过Autuhrizer进行授权,通过SessionManager进行会话管理。 SecuritManager是一个接口,继承了Authenticator、Authorizer、SessionManager这三个接口。 Authenticator(认证器) 对主体进行认证 Autuhrizer(授权器) 用户通过认证器认证通过,在访问功能时通过授权器判断用户是否有此功能的操作权限。 Realm SecuritManager进行安全认证需要通过Realm获取用户权限数据 Realm也是一个接口,有多种实现: 1 、将用户的权限信息写到配置文件 2 、将用户的权限信息存储到数据库 Realm 从配置文件或者数据库等读取用户的权限信息 SessionManager(会话管理器) shiro框架定义了一套会话管理,它不依赖web容器的session 所以shiro可以使用在非web应用上

unknown execution context when import realm in react-native

时光毁灭记忆、已成空白 提交于 2019-12-24 04:54:13
问题 Im really new to react-native and Im trying to use Realm. I already done the react-native link realm and rnpm link realm . But i get the error unknown execution context when I try to import Realm, heres my index.android.js import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, } from 'react-native'; import { TabViewAnimated, TabBar } from 'react-native-tab-view'; import Today from './app/Today' import Realm from 'realm' import _ from 'lodash' const styles =

Android test in kotlin of realm

六月ゝ 毕业季﹏ 提交于 2019-12-24 04:24:06
问题 How can be done a simple test of a realm database in Android implementing the test in Kotlin? I attempted to adapt a fragment from java realm test on github to kotlin and got the next code: import io.realm.Realm import io.realm.log.RealmLog import org.hamcrest.CoreMatchers import org.junit.Assert import org.junit.Test import org.junit.Before import org.junit.Rule import org.mockito.Mockito.`when` import org.powermock.api.mockito.PowerMockito import org.powermock.modules.junit4.rule

How do I get my pre-populated Default.realm file onto a device?

孤者浪人 提交于 2019-12-24 04:23:25
问题 I have a realm file that is already populated with data that needs to be there when the app is loaded on a device. What can I do to get the realm file onto my device for testing and what do I need to do to make sure it is already there when someone downloads the app from the app store? I am using Swift. 回答1: Add your database file to the Xcode project, i.e. "preloaded.realm" Make sure you select the add to targets, when first dropping in your file Then (taking from the migration example) you