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
10
votes
1 answer

Android - add default value in GreenDao database

I would like to ask, if there is possibility to add default value when I create greenDao database? Example: Property pictureIdProperty = user.addLongProperty("pictureId").getProperty(); Property thumbnailIdProperty =…
Dariusz Mazur
  • 587
  • 5
  • 21
10
votes
2 answers

GreenDao freemaker.jar is missing

I just downloaded the new jar file for GreenDao in order to create my DB for the app I'm building. After going through all the process of modeling my entities and the connections between them, I tried to run the generator project but got this error…
thepoosh
  • 12,497
  • 15
  • 73
  • 132
10
votes
1 answer

GreenDAO creating an automatic ID property

is there a way to make the DB create the ID property in an automatic way? I want to generate something that looks like this: Entity entity = schema.addEntity("MyEntity"); entity.addIdProperty().autoIncrement().primaryKey(); is this possible?
thepoosh
  • 12,497
  • 15
  • 73
  • 132
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,…
9
votes
1 answer

Using Green DAO with content provider

I am planning to use GreenDAO in my project. I had already tested it by creating a test project. However, I have couple of requirements, which I need to fulfill. Database of my app will be encrypted. To do so, we are planning to use SQLCipher. I…
Nitish
  • 3,097
  • 13
  • 45
  • 80
9
votes
1 answer

GreenDAO with Sqlcipher Integration Example

I have setup a new project using GreenDAO, was able to generate with ExampleDAO using DaoGenerator. Everything works fine. I also have a prepopulated sqlite database shipped in android assets folder, on app run, it is being copied to android…
Faisal Basra
  • 1,624
  • 4
  • 25
  • 40
8
votes
3 answers

SQLiteFullException: database or disk is full (code 13) GreenDao

how to solving SQLiteFulException in greenDao when I delete record from table? this is my stacktrace : android.database.sqlite.SQLiteFullException: database or disk is full (code 13) at android.database.sqlite.SQLiteConnection.nativeExecute(Native…
Gigin Ginanjar
  • 151
  • 1
  • 2
  • 12
8
votes
1 answer

Understanding deleting and deleting relations in greenDao

First question is, when does greenDao generate a delete function for a entity? And what's the difference between calling the entity.delete() and the session.getEntityDao.delete(entity)? Second, if I delete a parent entity with a child that has ToOne…
prom85
  • 16,896
  • 17
  • 122
  • 242
8
votes
1 answer

Proper way to add index columns in greenDao?

I am building a data model in greenDAO. It is a port of an iOS app that uses Core Data. In iOS we use indexes (indices?) to increase lookup performance in a table of 20 columns (properties) where 5 columns are frequently queried. I know this results…
Ralph Pina
  • 761
  • 7
  • 16
8
votes
2 answers

How do I build a GreenDao query that loads all Items specified through a list of ids?

I have a List of Strings each String is a unique identifier for a item persisted through GreenDao. How do I build a query that allows me to load all this items form my database? Is there a possibility to do it with a QueryBuilder or do I need to…
Janusz
  • 187,060
  • 113
  • 301
  • 369
8
votes
2 answers

How can get top of records by GreenDAO?

I wanna to get top some records from my table, but GreenDAO doesn't provide it. Like this: SELECT TOP 1 * FROM table_name In LINQ you can get top of records with Take(), is there any solution for GreenDAO? Could every one offer a suggestion?
Omid Nazifi
  • 5,235
  • 8
  • 30
  • 56
8
votes
2 answers

greendao delete from db and session

I'm using greendao for a android project and wanted to know how to properly delete and object from the db and from the session cache. Currently I do the following to delete from the db: ChatDao chatDao =…
marchinram
  • 5,698
  • 5
  • 47
  • 59
7
votes
2 answers

GreenDao primary key on multiple columns

I am using greendao to maintain SQL database on Android. Right now I am facing a problem of generating entity with two columns as primary key. To be clear I have column1 and column2 both of them are Long values and they together form a primary…
horin
  • 1,664
  • 6
  • 23
  • 52
7
votes
2 answers

GreenDAO groupby clause

I am currently using greenDAO as the ORM for my Android Application. I ran into an issue when trying to execute a GROUPBY clause. greenDAO does not have API / helper methods for performing groupby clauses, so I decided to use query() or queryRaw()…
SimplyJaymin
  • 444
  • 8
  • 17
7
votes
1 answer

How do I execute "select distinct ename from emp" using GreenDao

How do I execute "select distinct ename from emp" using GreenDao I am trying to get distinct values of a column of sqlite DB using GreenDao. How do I do it? Any help appreciated.
Ananth
  • 1,065
  • 1
  • 12
  • 20
1
2
3
39 40