Questions tagged [greendao3]

27 questions
9
votes
1 answer

Android Unable to encrypt database using sqlcipher using greendao

I am using greendao ORM. I am trying to encrypt my database using SQLCipher. Greendao automativally supports sqlcipher. So I wrote the following code for encryption. DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenHelper(context,…
6
votes
2 answers

Using more than 1 Database in Greendao with 2 different Schemas - Android

I have 2 databases in the project, one of them created when I open the app, the other is provided with the assets. When DaoSession is generated the DaoSession is created for all models. also the Schema in the gradle file is used for both databases…
MBH
  • 16,271
  • 19
  • 99
  • 149
5
votes
0 answers

How to make many-to-many relation query in GreenDAO with source property other than primary key?

Let's assume we have following entities: Item: class Item { ... @Index(unique=true) private String guid; ... @ToMany @JoinEntity(entity = JoinItemsWithTags.class, sourceProperty = "itemGuid", targetProperty = "tagName") private…
Bringoff
  • 1,093
  • 1
  • 10
  • 24
3
votes
0 answers

How to generate Content Provider for Entity in GreenDao 3?

In connection to this issue: How to generate a content provider with GreenDao3? Can someone provide an example how to create a Content Provider for the annotated Entity in GreenDao3? For example my entity looks like this: @Entity public class…
3
votes
1 answer

How to use bi-directional Many To Many relationship with GreenDAO?

After Reading the doc's Relations pages, I can use a many to many relation like this: @Entity public class Product { @Id private Long id; @ToMany @JoinEntity( entity = JoinProductsWithOrders.class, sourceProperty…
Asme Just
  • 1,287
  • 5
  • 27
  • 42
2
votes
1 answer

How to use SUM and DINSTINCT with GreenDao querybuilder?

I want to get the sum of total rows in a column of a table in SqlLite Database. I am using GreenDao Library. I know I Have to use SUM. But I don't know how to use it with GreenDao queryBuilder. Can anybody help me? and also DISTINCT.
Naroju
  • 2,637
  • 4
  • 25
  • 44
2
votes
1 answer

Working with Many to Many and GreenDao 3.1.0 - Android

I have 2 Entities Mood, MoodNote, both of them I get them from webservice as 1 json list. Json sample: { "id":1, "name":"Sad", "created_at":"2016-08-11 19:59:43", "updated_at":"2016-08-16 20:15:17", "deleted_at":null, …
MBH
  • 16,271
  • 19
  • 99
  • 149
1
vote
2 answers

App crash in release build for enabling proguard when using GreenDao

I am using GreenDao in my project, when I build the application in release mode then the app crashes. If I disable proguard (minifyEnabled false) in gradle then it's running perfectly. I have used the following rules in proguard. ### greenDAO…
Abu Noman
  • 435
  • 3
  • 13
1
vote
1 answer

Migrate from Greendao3 to Object box

I migrated from GreenDao3 to ObjectBox, and my project is't build. I get errors like this ../app/build/generated/source/kapt/indexDebug/com/aff/index/main/boxdb/AliasDao.java Error:(53, 29) error: cannot find symbol method getContentId() This…
user3057944
  • 701
  • 1
  • 8
  • 19
1
vote
1 answer

Android 25 and Espresso 2.2.2 fails instrumentation test annotations failure

I'm trying to setup android instrumentation tests in my project with usage of espresso library. The problem is that test class fails compilation (gradle task: compileDebugJavaWithJavac). My Gradle config file: buildscript { repositories { …
Waldek
  • 21
  • 1
  • 4
1
vote
0 answers

Exception about greendao3 encryption

I am using greendao ORM. I am trying to encrypt my database using SQLCipher. Greendao automativally supports sqlcipher. So I wrote the following code for encryption. DaoMaster.DevOpenHelper helper = new…
1
vote
1 answer

Is it better to save bitmaps to Sqlite Databse or Files handling its paths in Database ? - Android

Is Converting bitmaps to byte[] and saving it to Database better performance and management or saving the bitmaps to Files and handling the paths in the Database ? By better I mean as performance and management. I have started a new application and…
MBH
  • 16,271
  • 19
  • 99
  • 149
1
vote
1 answer

how to use DISTINCT in GreenDao

I want to query distinct rows in SqlLite, I am not getting how to query using GreenDao library for android. List activities = activityDao.queryRaw("SELECT DISTINCT "+Properties.Date_time +" FROM "+activityDao.getTablename()+" WHERE…
Naroju
  • 2,637
  • 4
  • 25
  • 44
1
vote
1 answer

How to implement relationships in Greendao?

I am new to Greendao.I am writing a generator for generating entities in greendao.So,I have two entities Hospital and patient. They have a one to many relationship between them. So,a hospital can have many patients but one patient can have only one…
Prateek Ratnaker
  • 817
  • 11
  • 35
0
votes
1 answer

What is the best data type to use in greendao for Decimal(10,2)

I am trying to migrate my old db written in sqlite to greendao ORM , I need to set the column to DECIMAL(10,2) for storing the price of the item. What is the equivalent data type that I can use. DO I need to use a custom data type for that?
Prens
  • 420
  • 1
  • 5
  • 15
1
2