Questions tagged [greendao-generator]

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 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.

59 questions
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
5
votes
2 answers

The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files android studio

There are quite a few questions with the above error, but most of them are related to eclipse, for me it's happening in android studio and also for the project which was working fine till now. My android project was working fine all the while, and…
5
votes
0 answers

Set codeBeforeField for attribute before GreenDAO relation

I have recently started using GreenDao for my Android app where I am creating a Category entity which should have multiple Category entities as children. Therefore I am using a Tree Relation as follows: Entity category =…
4
votes
3 answers

Greendao Autoincrement inserting record not working

I am using greendao 3.2 and making Entities and database. Its all working fine. But I am having trouble when creating Id property that must be Auto increment. I know How to do it in SQL but using greendao its giving me much more tough time. I have…
Android teem
  • 780
  • 2
  • 13
  • 36
3
votes
1 answer

GreenDAO ToOne relationship not working

I am implementing a User class as: @Entity public class User implements Serializable { /** Serial version UID */ static final long serialVersionUID = 200L; @Id /** The user system id */ private long id; @Index(unique =…
htafoya
  • 18,261
  • 11
  • 80
  • 104
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 GROUP BY in GreenDao

I have found few questions related to this issue in SO, but did not help me much.I want to construct a query in Android using GreenDao library, query should grab all the rows containing particular phonenumber in descending order of datetime and I…
Naroju
  • 2,637
  • 4
  • 25
  • 44
3
votes
1 answer

How to override the interface methods in the generated database table class?

I am using GreenDao in my Android project and i have generated my database schema successfully but I am stuck on one issue. My generated class needs to implement an interface that is not related to db. In the generator I have used the following…
3
votes
0 answers

GreenDao error: Target entity has no primary key, but we need it for ToMany

I have this piece of code Entity pokemonSpecies = schema.addEntity("PokemonSpecies"); pokemonSpecies.setTableName("pokemon_species"); pokemonSpecies.addIdProperty(); pokemonSpecies.addStringProperty("identifier").notNull(); …
3
votes
1 answer

GreenDao IndsertOrReplaceInTx only insert last item of list

I have some POJOS and create some tables for them. All of them work well which means I can insert them and load them ... except this one: My Brand list contains 6 elements and I am really sure they are different(put break point and saw them) but…
mmlooloo
  • 18,937
  • 5
  • 45
  • 64
3
votes
1 answer

How can I persist an HashMap?

How do you persist an HashMap in greenDAO and how do you generate the respective entities? I have read the documentation twice going forward and backward but nothing there. Google wasn't of any help either.
doplumi
  • 2,938
  • 4
  • 29
  • 45
2
votes
0 answers

What is the best way for creating a greendao v3 session in a DAO module?

I have my project divided in three modules (multilayered architecture): App (where i have my activities) BusinessLogic DAO (where i am using greenDAO version 3) And i need to know the best way for opening a DB session from the DAO layer, where i…
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
0 answers

I want to know how to perform the CRUD operation in GreenDAO?

I am very new to GreenDAO, I don't know how to do CRUD operations in GreenDAO. I did some CRUD operation to retrieve the username and password that was totally making me confusion.Any one help to do CRUD operation…
hem
  • 311
  • 1
  • 5
  • 16
2
votes
1 answer

How to add initial data for DB using GreenDao in android?

I have been this answer for insert initial data in native mode How to add initial data to SQLite database? How can I get the same result using Green dao? this is my Application class public class App extends Application{ @Override public…
angel
  • 4,474
  • 12
  • 57
  • 89
1
2 3 4