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

Testing Android App using greendao with Mockito

I am new to android testing and trying to write unit tests (running on local jvm) using mockito in Android Studio. My IDE setup (gradle scripts) is done so far. dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') // Unit testing…
Dokumans
  • 359
  • 1
  • 3
  • 14
0
votes
2 answers

GreenDao - Saving an Entity and related - "Entity is detached from DAO context"

I'm trying to save with GreenDAO an entity called hotel. Each hotel has a relation one-to-many with some agreements and each agreement has got... well, a picture is worth a thousand words. Now, what I do is the following: daoSession.runInTx(new…
Marco Zanetti
  • 4,051
  • 6
  • 32
  • 48
0
votes
0 answers

GreenDao gets me data that I can't see in database

I'm developing a Hotel-booking app and I use greenDao. I create a Hotel entity. This is the entry in my MyGreenDaoGenerator: // Hotels private Entity createHotels() { Entity hotels = createEntity("Hotel", "hotels"); …
Marco Zanetti
  • 4,051
  • 6
  • 32
  • 48
0
votes
0 answers

Android external database sqlite + GreenDao

I'm having a problem trying to import my sqlite database using GreenDao library. It's empty. How can I do it? In my external library I have one table box. I have also generated Box class using gradle + MyDaoGenerator. On application…
Yurii Kot
  • 316
  • 3
  • 11
0
votes
1 answer

SQLite transaction behaviour using greendao

I am using greendao as ORM library in my Android project and have problems understanding the behaviour of transactions. greendao offers an API runInTx(Runnable r) . My question is, how will two calls of this method from different Threads will be…
Dokumans
  • 359
  • 1
  • 3
  • 14
0
votes
1 answer

Safe to leave database open at all times? Is crash detection needed?

Right now, to make sure that I'm writing to a correct and functional database at all times, I'm calling the following createDB function every time when I'm accessing the database for data insertion (which happens on a 15 second interval): protected…
Kester
  • 61
  • 2
  • 8
0
votes
2 answers

How to load database data, and store it into array list, and show it into ListVIew

So, I want to build an app to view some data from database. I already have the database, also already made some entities that have exactly same properties name with the column names in database. And also I put the database into database directory by…
Gabriel Juan
  • 77
  • 1
  • 8
0
votes
1 answer

greenDAO manyToMany reflexive relation

I am trying to figure out how to model this relation for Android in GreenDao. We have a NavigationNode, which can have ManytoMany other NavigationNodes. In Rails we modelled this with a 'has_many :through' with a NavigationPath join table: class…
Louis
  • 11
  • 5
0
votes
1 answer

Can I develop with GreenDAO on Linux?

I would like to learn GreenDAO, and was wondering if I could play around with it on Linux, or do I need a full Android SDK environment/emulator/ide in order to just use it? TIA
aaa90210
  • 11,295
  • 13
  • 51
  • 88
0
votes
1 answer

GreenDao helper class

I'm creating a class called DBHelper to make easier to use dao inside my app but i dont know how to do a simple select they keep giving that "Getting starting" link but a I dont understand nothing, any help modifing these codes from the class to do…
Lucas Bertollo
  • 373
  • 2
  • 5
  • 19
0
votes
1 answer

Unexpected entity related to newly created

In my Android application I am using GreenDao as an orm. I have two tables: A and B. Table B has foreign key to table A. A entities can execute getBList() method and B entities can execute getA() method. When I started to remove some A entities with…
Ari
  • 3,101
  • 2
  • 27
  • 49
0
votes
1 answer

GreenDao why using Integer instead of int?

I want to know that why greendao uses Integer instead of int? I find that ExampleDaoGenerator generator the entity int field are all Integer.
周鹏飞
  • 1
  • 1
0
votes
4 answers

Why my activity can't import DaoMaster.java gennerated by greendao

I created by this post,I genarate the Entity,Dao,DaoMaster and DaoSession ,but I can't import these class? How can I do this?My android project has a java module in android studio,I generated the src-gem in my android project,and I can't add the src…
user3940641
0
votes
2 answers

Greendao - How to compare string column ignoring case?

I have a query in sqlite: select * from table where upper(name) = "ABC"; Is there a function in greendao to execute same query?
Anuj
  • 1,160
  • 2
  • 20
  • 40
0
votes
1 answer

Can you encapsulate multiple nested transactions across different threads into an overall transaction with greenDAO?

I am working on an Android application that uses greenDAO as a data persistence layer. The application downloads data from various different sources across multiple threads (determined by a thread pool), each piece of data is inserted into the…
jdmunro
  • 581
  • 2
  • 10