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
594
questions
0
votes
0
answers
40
views
GreenDao how to update table by other column (not the primary key id)?
I know I can use these code to update the table, but it use the primary key id for comparison.
DaoSession daoSession = ((App) getApplication()).getDaoSession();
StudentDao studentDao = daoSession....
0
votes
1
answer
35
views
Observable.fromCallable() method inside not getting called
This is how i'm using the Observable.fromCallable(). In other classes its working fine, but not in some of the classes. Any help would be appreciated.
Observable
.fromCallable(() ->
...
1
vote
0
answers
76
views
Return "blank" entity if entity does not exist using QueryBuilder
I would like to be able to return a "DefaultEntity" if the query created by QueryBuilder does not exist, example :
myDao.queryBuilder().where(MyEntityDao.Properties.Id.eq(100)).unique()
If ...
1
vote
1
answer
72
views
android greendao plugin config confusing
In latest androidstudio, the project build.gradle format changed as below:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com....
0
votes
1
answer
89
views
Is green Dao supported by kotlin?
I'm converting my existing java project into the Kotlin , while during this I come across the problem that unresolved ref to 'dao', I tried changing the sequence of greendao & Kotlin dependency as ...
0
votes
1
answer
638
views
greendao - android.database.CursorWindowAllocationException: Could not allocate CursorWindow <DBName> of size 104857600 due to error -12 [duplicate]
So I basically parse a JSON and store ~3000 rows (no multimedia) in the greendao generated table and I am getting the above error from while querying data in this function:
@Synchronized
...
0
votes
1
answer
218
views
how to change AlertDialog to intent to move to another activity
I've tried various ways but can't and until I stop here, I've tried it myself with an Intent (Intent intent = new Intent) now I've used this method but it doesn't work then I've also created a new ...
2
votes
1
answer
558
views
How to use greenorg.greenrobot:greendao-gradle-plugin:3.3.0 without jcenter repo?
jcenter repo is deprecated, so I'd like to migrate from it. Unfortunatelly org.greenrobot:greendao-gradle-plugin:3.3.0 is published only here.
How can I use it without jcenter?
1
vote
0
answers
63
views
SQLiteOpenHelper onUpgrade called with wrong oldVersion?
I am using GreenDao in my Android app, and have a subclass of SQLiteOpenHelper which I call DBHelper:
public class DBHelper extends DaoMaster.OpenHelper {
// DaoMaster.OpenHelper extends ...
0
votes
1
answer
220
views
How to set a one-to-many relationship in greenDAO?
hope you have a good day.
I am new to greenDAO, and am wondering how to model a one-to-many relationship using greenDAO in an Android app so that I can retrieve a list of TestResult entities that ...
2
votes
0
answers
224
views
How To Migrate existing Database From greendao to Room database in android
My current Database version is 29 But When migrate to Room greendao schema version is not change in gradle
2
votes
1
answer
140
views
How do i update call log data in db upto date (java android)
Part 1: when app opens my MainActivity() gets all call logs and saves in DB
Part 2: When app is closed and user makes multiple calls and recieves multiple calls, how do i update them in db.
possible ...
0
votes
1
answer
122
views
Android SQLite query optimization (ORM GreenDao)
My job is to maintain an application that is essentially a database for another application. the application uses ORM GreenDao.
Here is StorageUtil.getResults method which processes queries:
public ...
1
vote
1
answer
750
views
android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed using greenDAO ORM
I am using GreenDAO for a local Android project. I am creating the login and register of the users (they work fine) the problem happens after one user is created. Registering more than one user throws ...
0
votes
1
answer
272
views
Does RoomDB supports dropAllTables() and createAllTables()?
GreenDAO supports DaoMaster.dropAllTables() and DaoMaster.createAllTables(). I'm looking for similar functionality in RoomDB. Does RoomDB supports this functionality ??
The use-case for this ...
1
vote
1
answer
3k
views
Upgrading Android Studio Gradle to 6.1.1 breaks Greendao3GradlePlugin
This morning I upgraded Android Studio to use Gradle 6.1.1.
Now, my attempts to build fail with the following error:
Unable to find method
'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/...
0
votes
1
answer
406
views
greenDAO Android no create tables in file database
I took the guide of https://blog.mindorks.com/powerful-android-orm-greendao-3-tutorial to integrate greenDAO in my android project, I follow everything (or so I think XD) and when I try on my mobile ...
0
votes
1
answer
340
views
org.greenrobot.greendao.DaoException in android release mode when using androidx
I'm using greenDAO for a long time in my app without any problem!
But after migrating my project to using androidX , I received an Exception (org.greenrobot.greendao.DaoException) like below.
Non-...
0
votes
1
answer
59
views
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 ...
0
votes
1
answer
325
views
Android Greendao - group and order by
I'm using GreenDAO in my project.
I have a chats table which contains all the messages.
I want to group by the chat_id and order the messages in descending order by the timestamp of the message.
so ...
1
vote
2
answers
794
views
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 ...
1
vote
2
answers
303
views
GreenDAO Cannot access existing database after upgrading sqlcipher from 3.5.4 to 4.2.0
I'm using GreenDAO with SQLCipher. After I upgrade SQLCipher from 3.5.4 to 4.2.0, my app cannot access the old encrypted database. I have already searched for a solution and found out that I need to ...
0
votes
1
answer
521
views
android studio can't resolve DaoMaster after import GreenDao
below are project build.gradle and app build.gradle files
//project build.gradle
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
...
2
votes
1
answer
1k
views
How can I save user messages and history to room database
I am developing a chat app and I want to save user chat history and messages using room database. By this, when the users start the app they can see their previous history and messages.
Below my User....
0
votes
1
answer
237
views
Using Embedded POJO class in Green Dao annotated Entity
I want to use embedded POJO class in my persistent entity.
It is needed to match the server data model in my android app. App using GreeanDao framework for DB DAO layer and self-written annotated-...
0
votes
1
answer
205
views
Android realtime database inspection
I am working on an app and using GreenDao for database. So now to debug and inspect and validate database changes I have to do fetch out the database file after making any changes to database.
To ...
1
vote
0
answers
219
views
Error using pre-populated database with GreenDao - "table already exists"
I know this question is asked many times before but i couldn't figure it out.
I copy my database from asset folder in the first launch using the method explained here. but when i launch the app , it ...
1
vote
1
answer
204
views
GreenDAO cannot access existed database after upgrading sqlcipher from 3.5.2 to 4.0.1
I'm using GreenDAO with SQLCipher.
After I upgrade SQLCipher from 3.5.2 to 4.0.1, my app cannot access the old encrypted database.
I have already searched for a solution and found out that I need to ...
0
votes
0
answers
33
views
GreenDao Sort dataset not query result
I'm using GreenDao's QueryBuilder to query for items i need in my list.
I have an extremely large dataset of categories with names
eg (Tools, Engines, Pliers, Bricks)
I need to use offset and limit ...
0
votes
0
answers
90
views
if i update table using rowQuery in greendao then after i cant get updated data using below Querybuilder?
CODE FOR UPDATE DATA IN TABLE
Cursor cursor = daoSession.getDatabase().rawQuery("UPDATE " + PayCycle_tblDao.TABLENAME + " SET " + PayCycle_tblDao.Properties.TotalSaving.columnName + "=" + ...
1
vote
0
answers
149
views
which database provide easy Encryption of data? realm vs greenDao vs (room+saferoom) vs (sqlLite+cipher)
currently, in our Project, we are using sqlLite+cipher old school method for storing in database and encryption. we planning to rewrite need advice on what to use for database+encryption
our app is ...
0
votes
1
answer
29
views
Can I name an entity as "Property" in GreenDAO?
Lets say you have a project and one of the tables or entities is named Property. This is giving me an error in my Android project. Why we ca't freely call our data model objects the names that we want ...
0
votes
1
answer
58
views
Problems with queryBuilder greenDAO
I am using latest version of GreenDAO... I am missing something on using the data from the DB.
I need to prevent the creation of records that have the same PROFILE_NUMBER. Currently during testing ...
0
votes
1
answer
49
views
DC2type on greenDao
I am using GreenDao for Android application, with some specification, for example, I have a Contact Model with some information like name, avatar, phone number, etc...
Right now the need is to ...
0
votes
0
answers
50
views
How to join two entities and map the output to a model?
I'm trying to join two entities using greenDAO and map the output to a model which has both entities' properties. I joined the entities, but I couldn't access the second entity in my model.
Take ...
0
votes
1
answer
59
views
How do I call retrofit along with greendao for post request?
I am trying to integrate greendao with the retrofit. This link will give an idea ( https://i.stack.imgur.com/7qmbu.jpg) of how the data is sent to the server. It is a post request and I am really ...
0
votes
1
answer
175
views
Return last inserted record with greenDAO
I am developing an android App with greenDAO, I need to insert an order-detail but I dont't find a practical way to do it, I don't know if there is a method that returns the created object.
order....
1
vote
0
answers
90
views
Accessing GreenDao from a separate process (e.g. sync)
On various occasions I receive log errors like this
my.app:sync E/SQLiteLog: (5) statement aborts at 1: [PRAGMA journal_mode=TRUNCATE] database is locked
While investigating into this issue I ...
1
vote
0
answers
192
views
Implementing Multiple SQLite ORM Libraries In a Single Android Project
Currently, we are using ActiveAndroid ORM in our project. We have thousands of records in a single SQLite Table. When we run multiple queries (with conditions) and shows results on the views. Our app ...
0
votes
2
answers
66
views
RxJava2 Observable Issue
I am new to RXJava2, so need some help, I have to implement the functionality of favourite, when user clicks on fav then it's inserted in the greendo database and when he unfavourite the same event ...
0
votes
0
answers
85
views
Greendao insert into new table issue
I'm working on an android app already built by other. and this project has green dao as database framework. This project has already some tables built and working great. recently i've added two tables ...
1
vote
0
answers
243
views
How to secure password used for Greendao with SQLcipher database in Android?
I want to secure the password used for Greendao db with SQLCipher. I am using a keystore to genrate a key and using that key encrypting a password getting from the server. I want to use encrypted data ...
0
votes
0
answers
181
views
Why are greenDao Queries taking 15 seconds?
So we are using GreenDao as our ORM and Just yesterday I noticed some severe lag in a new feature. After some investigating I found it wasn't our code but rather some Code generated by greenDao.
...
0
votes
1
answer
3k
views
Migrate from greendao to Android Room
I have an existing Android application with greendao as ORM. However, for the future, I would prefer to use Android Room.
I rebuild now my database scheme in Android Room and I wanted to reuse an ...
0
votes
0
answers
134
views
Pick up points from the map and store the coordinates in the database, but some points are not GPS coordinates
The function is to select points from the map and store the co-ordinates of the points in the database.
This is normal:
But there are some special cases, I don't know what caused it:
I don't know ...
0
votes
1
answer
597
views
DaoException: No DAO registered for class
I am trying to perform a join with GreenDao on my Android project, this is my code:
QueryBuilder<User> queryBuilder = daoSession.getUserDao().queryBuilder();
queryBuilder.join(UserDao....
1
vote
0
answers
535
views
How to execute raw queries using GreenDAO
I'm starting with and thinking of integrating GreenDAO in my app but the app heavily relies on queries like this:
"SELECT c.Id, c.primary_name, case when c.alt_name in('','null',null) then c....
0
votes
0
answers
31
views
Greendao takes much time to generate class android
I am using Greendao to generate the class but it takes much time to generate the classes.
It has been more minutes, it's still keep on displaying Gradle build using task.
Below is screenshot
...
0
votes
1
answer
628
views
dagger2 Inject database in a ContentProvider error NoClassDefFoundError - DbOpenHelper_Factory.get
I am trying to setup an Android MVPApp & have setup Dagger 2, butterknife successfully in my project & it is working with all activities on my device but still the android's firebase ...
0
votes
1
answer
639
views
How to resolve greendao build errors
I am working on an android application which uses GreenDao (ORM) for Object Relation mapping . I have defined entity classes in my code. When i build the code , greendao generates Dao classes ...