Questions tagged [activeandroid]

ActiveAndroid is an active record style ORM (object relational mapper) for Android.

ActiveAndroid allows you to save and retrieve SQLite database records without writing SQL statements. Each database record is wrapped into an object with methods like save() and delete().

The library is open sourced under the Apache 2.0 License.

Tutorials:

slidenerd Series

231 questions
3
votes
2 answers

How to make a field auto increment in ActiveAndroid ORM

How can I make an integer or long field to be auto-incremented using annotation.
Shahidul
  • 2,997
  • 1
  • 21
  • 20
3
votes
0 answers

How to load a whole object (with lists) using ActiveAndroid

I have this simple model: @Table(name = "Books") public class Book extends Model { @Column(name = "title") String title; //Variable to cache the pages List pages; public Book(){ } public List
Corbella
  • 1,791
  • 14
  • 24
3
votes
1 answer

Android library: activeandroid index and unique annotation not available

As activeandroid library suggests, when declaring a model class object to use annotation unique and index annotation parameters for unique constraint and indexing for a column respectively here, /**activeandroid imports**/ import…
3
votes
0 answers

Can't create insert cascade in ActiveAndroid library

I use ActiveAndroid library in my project. In the model I have the following parameters: onDelete = Column.ForeignKeyAction.CASCADE, onUpdate = Column.ForeignKeyAction.CASCADE But it's impossible to find Insert cascade or something else. My models…
Mark Korzhov
  • 2,109
  • 11
  • 31
  • 63
3
votes
2 answers

multi parameter in ActiveAndroid

I am using ActiveAndroid as ORM system in my project and i use this line of code for Query over database List s = new Select() .from(Chats.class) .where(col_conversation + " = ? and " + col_sender + " = ? and…
Navid_pdp11
  • 3,487
  • 3
  • 37
  • 65
3
votes
0 answers

Proper use of Column.ForeignKeyAction.CASCADE

If I have a relation like this, and what I want is that whenever I call delete() on an User, the vehicle field is also deleted. @Table (name = "Users") public class User extends Model { @Column(name = "Name", unique = true, onUniqueConflict =…
user1923613
  • 626
  • 5
  • 11
  • 31
3
votes
2 answers

ActiveAndroid: lock records for updates?

In ActiveRecord, there's a concept of locking records for updates to ensure that a stale object doesn't get saved to the database. Is there equivalent functionality in ActiveAndroid? If so, is there a link showing how to do it? If not, what would…
WindsurferOak
  • 4,861
  • 1
  • 31
  • 36
3
votes
1 answer

In ActiveAndroid Is it possible to update a specific field in a table row without wiping out the rest of the data in the row

ActiveAndroid: I need to push updates to specific table fields without wiping out any existing data in the row if i dont happen to save() data for all fields each time. For example: I have a table named 'user' which contains the following…
user2252028
  • 31
  • 1
  • 3
2
votes
1 answer

Memory Allocation - UI Stucks/Hangs - While Network Call (Rx2AndroidNetworking)& Inserting Records In SQLite(ActiveAndroid)

I am using Rx2AndroidNetworking in my project to get getObjectListObservable thousands of records from the Server JSON List of Objects about 150+ attributes of SQLite Database of 3 Tables which i have to resync(Insert) the data to SQLite tables…
2
votes
0 answers

Problem with SQLiteCantOpenDatabaseException only on Huawei devices

for some time an error SQLiteCantOpenDatabaseException has been thrown in my application. Adding WRITE_EXTERNAL_STORAGE permission didn't help. Also I've used ActiveAndroid ORM instead of default android sql implementation. I don't know what is the…
2
votes
0 answers

RecyclerView with Header Getting Duplicate Items

I have a recyclerview list of items and in the adapter, I have a button for adding an item as favorite to an active android database like below code: viewholder.favoriteWP_IV.setOnClickListener(new View.OnClickListener() { @Override …
Andromeda
  • 230
  • 1
  • 7
  • 22
2
votes
1 answer

Select a specific column in active-android

How to select a specific column in a table? This returns a row.. public static Model getData(String userId) { return new Select().from(Model.class).where("userId=?", userId).executeSingle(); } Replacing it as : return new…
2
votes
5 answers

How to deserialize a nested JSON object as a String with Gson, Retrofit, Active Android

I am using a ActiveAndroid to cache response from Retrofit network calls. I made a class which looks like :- class Article extends Model { @Column(name = "title") @SerializedName("title") @Expose public String title; …
Shobhit
  • 647
  • 1
  • 7
  • 19
2
votes
2 answers

Android Studio cannot resolve symbol from imported module

I have an android app that worked great. I have imported the ActiveAndroid project as a module because I did a change on the Model's file (I added a setId method, and that's why I can't use the gradle's version). I was using Android Studio 1.5 and…
2
votes
2 answers

ActiveAndroid returns always empty results

I tried to add ActiveAndroid to my first Android app. No errors so far, my items are being saved (I checked it with an sqlite manager) but no matter what query I use the result is always empty. I only have one model (Todo) and only strings, booleans…
hering
  • 1,956
  • 4
  • 28
  • 43