Questions tagged [greendao]

greenDAO is an object/relational mapping (ORM) tool for Android. It offers an object oriented interface to the relational database SQLite. ORM tools like greenDAO do many repetitive tasks for you and offer a simple interface to your data.

greenDAO's primary features:

  • Fast & slim: designed for Android and SQLite
  • Support for entity relations
  • Query builder
  • Code generation

Links:

592 questions
60
votes
3 answers

Green DAO vs ORM lite vs Active Android

Which is the best ORM tool available for Android? I am seeing ORMlite and ActiveAndroid are the most discussed across and a friend of mine suggested me to use GreenDAO. So looking for some knowledge resource which can help me in Decision…
Ravi G
  • 859
  • 1
  • 8
  • 21
59
votes
7 answers

GreenDAO schema update and data migration?

I'm evaluating GreenDAO for consideration in a commercial Android app I will be working on and wanted to determine the migration path for schema updates. Am I correct in asserting that I would have to write a custom OpenHelper which provides the…
Syntax
  • 2,155
  • 2
  • 23
  • 34
35
votes
6 answers

GreenDao Android Studio

I'm looking for a clear step-by-step explanation on how to import GreenDao in Android Studio. I've used it before in AS, but failed to get it to work again. There are some tutorials out there, but they don't seem to apply to the latest version of…
TomCB
  • 3,983
  • 9
  • 40
  • 66
32
votes
1 answer

ORM performance: is greenDAO faster than ORMLite?

I've been using ORMLite in my application and I was considering whether to move to greenDAO. Performance is a huge part of that decision, and greenDAO's Features page says: For the same given entity, greenDAO inserts and updates entities over 2…
Dan J
  • 25,433
  • 17
  • 100
  • 173
31
votes
3 answers

Connection pool has been unable to grant a connection to thread

I'm using GreenDAO for database handling in Android. When performing many database changes (> 15.000) I get this error Message: The connection pool for database '/data/data/...' has been unable to grant a connection to thread 312 (Thread-312) with…
Basic Coder
  • 10,882
  • 6
  • 42
  • 75
26
votes
4 answers

greenDao Schema Upgrade

I have seen another question about schema upgrade/migration using green dao (here) There are lots of links in that answer for a good pattern to use when doing schema upgrades - however there are no examples of what you actually do to your data to…
DiscDev
  • 38,652
  • 20
  • 117
  • 133
21
votes
6 answers

Only using Proguard: Could not init DaoConfig => ArrayIndexOutOfBoundsException

I am using the following ProGuard rules: -keepclassmembers class * extends org.greenrobot.greendao.AbstractDao { *; } -keep class **$Properties -keep class org.greenrobot.greendao.** -keepclassmembers class org.greenrobot.greendao.** { *; } # If…
muetzenflo
  • 5,653
  • 4
  • 41
  • 82
19
votes
2 answers

Are there greenDAO thread safety best practices?

I'm having a go with greenDAO and so far it's going pretty well. One thing that doesn't seem to be covered by the docs or website (or anywhere :( ) is how it handles thread safety. I know the basics mentioned elsewhere, like "use a single dao…
Groxx
  • 2,489
  • 1
  • 25
  • 32
14
votes
4 answers

greenDAO 40 seconds to insert 600 records

I've chosen greenDAO because it's site states that it's one of the fastest ORM systems for android. To my dissapointment it takes it like 40 seconds to insert 600 records on Samsung i9001. I'm not sure if I'm doing anything wrong. Could you suggest…
midnight
  • 3,420
  • 3
  • 36
  • 58
13
votes
2 answers

Greendao entity when serialized using GSON doesn't contain related entity in Generated JSON string

I have two entities Generated using Greendao generator. The two entities are Hospital and Patient. There exists a one to many relationship between Hospital and Patient. So one hospital can have multiple patients and one Patient can have only one…
Prateek Ratnaker
  • 817
  • 11
  • 35
13
votes
6 answers

How to clean/delete greenDao database

Currently I'm doing it like this: DaoMaster.dropAllTables(getDb(), true); DaoMaster.createAllTables(getDb(), true); but then, when I'm trying to add entity to the database, I'm getting crash log saying that this table isn't exist Edit1: I know that…
Nativ
  • 3,092
  • 6
  • 38
  • 69
12
votes
2 answers

greendao: way to debug queries?

Is there any way to make greendao spit queries that're being carried out into Logcat? I just want to reassure everything's working fine and it would be a good feature to have while getting accustomed to the system.
midnight
  • 3,420
  • 3
  • 36
  • 58
12
votes
1 answer

GreenDAO support multiple relations between tables

I've been trying to create a DB model using GreenDAO. the problem started when I tried to create more than one relationship between a different tables. basically, I have a Message table, a Conversation table and a User table. the User has a list of…
thepoosh
  • 12,497
  • 15
  • 73
  • 132
11
votes
0 answers

Using swagger with an android database

I'm looking for away to use Swagger with an on-device database on android, ideally with GreenDAO and retrofit but I'm willing to use what works. The app will need to have a persistent database and also sync/communicate with a server that uses…
GetSwifty
  • 7,568
  • 1
  • 29
  • 46
10
votes
3 answers

greenDAO not generating FOREIGN KEY(...) constraint in table

When I create a bidirectional 1:n relationship as shown below, the generator does not use any FOREIGN KEY(...) constraints on the table. entity customer =…
Monstieur
  • 7,992
  • 10
  • 51
  • 77
1
2 3
39 40