Questions tagged [ormlite]

ORMLite is a Java open source software framework that provides lightweight object relational mapping (ORM) between Java classes and SQL databases. It supports JDBC databases as well as Android mobile platform.

ORMLite was started with the goal of providing a simple yet powerful Java wrapper around the JDBC functions without the complexity of other frameworks such as Hibernate and iBATIS.

ORMLite supports a number of JDBC databases including: MySQL, PostgreSQL, Microsoft SQL Server, H2, Derby, HSQLDB, and SQLite and can be extended to additional databases relatively easily. There are also initial implementations for DB2 and Oracle. It has a separate database back-end which also supports native database calls on Android OS.

Useful links

1336 questions
60
votes
3 answers

Green DAO vs ORM lite vs Active Android

Which is the best ORM tool available for Android? I am seeing ORMlite and ActiveAndroid are the most discussed across and a friend of mine suggested me to use GreenDAO. So looking for some knowledge resource which can help me in Decision…
Ravi G
  • 859
  • 1
  • 8
  • 21
54
votes
1 answer

Saving child collections with OrmLite on Android with objects created from Jackson

I have a REST service which I'm calling from my app, which pulls in a JSON object as a byte[] that is then turned into a nice nested collection of objects -- all of that bit works fine. What I then want to do is persist these objects to SQLite…
Jonathan Ellis
  • 5,221
  • 2
  • 36
  • 53
47
votes
2 answers

What is a good tutorial for using ORMLite with SQLite and Android

I am looking for a good introductory tutorial on how to use ORMLite with SQLite and Android. A qucick google search did not produce any usefull information.
Maro
  • 4,065
  • 7
  • 33
  • 34
43
votes
2 answers

JavaFX, Casting ArrayList to ObservableList

Is there a way to cast ArrayList to ObservableList? I would like to do it without iterating through ArrayList. To be more specific, I am using ORMLite to get data from database, and I need ObservableList as an output of the method fetching data from…
Miljac
  • 2,045
  • 4
  • 19
  • 28
40
votes
4 answers

Saving nested foreign objects with ORMLite on Android

When working on Android, does ORMLite only save shallow level objects? I have a data structure with nested Objects, both of which are newly created, and I would like to be able to save both of them with one call to dao.create() For exmaple, I have…
Chase
  • 11,161
  • 8
  • 42
  • 39
35
votes
6 answers

Android Studio run configuration for ORMLite config generation

I'm using Android Studio and want to use ORMLite framework. ORMLite for Android has a mechanism for making DAO creation through table config file. How to setup additional Run Configuration in Android Studio for generating this config?
Stanislav Borzenko
  • 1,431
  • 1
  • 13
  • 9
34
votes
4 answers

Android Cursor with ORMLite to use in CursorAdapter

Is there any way to get Cursor for a query, which I am processing with ORMLite Dao object?
sealskej
  • 7,281
  • 12
  • 53
  • 64
32
votes
1 answer

ORM performance: is greenDAO faster than ORMLite?

I've been using ORMLite in my application and I was considering whether to move to greenDAO. Performance is a huge part of that decision, and greenDAO's Features page says: For the same given entity, greenDAO inserts and updates entities over 2…
Dan J
  • 25,433
  • 17
  • 100
  • 173
29
votes
3 answers

Convert ForeignCollection to ArrayList - ORMLite, Gson and Android

I apologize if I'm not super clear with my explanation but I'll add to and edit this question for clarity if requested. I am developing an Android app which receives data through an external API and stores data locally using ORMLite. Prior to…
wuliwong
  • 4,238
  • 9
  • 41
  • 69
26
votes
5 answers

how to delete a record from ORMLITE?

I need to delete a record from ORMLite Database I can delete a record by id using as below @Override public void Delete(int id) throws SQLException { this.dao.deleteById(id); } but what if I have to delete a record from same table not by id…
Sourabh Saldi
  • 3,567
  • 6
  • 34
  • 57
23
votes
8 answers

Proguard with OrmLite on Android

How should I use proguard with ormlite library on Android? Trying this: -keep class com.j256.** -keepclassmembers class com.j256.** -keep enum com.j256.** -keepclassmembers enum com.j256.** -keep interface com.j256.** -keepclassmembers interface…
sealskej
  • 7,281
  • 12
  • 53
  • 64
23
votes
2 answers

How to use the ORMLite query builder to get the total records in a table

Similar to select count(*) from tablename; what should be query in ORMLITE i tried something like int total = dao.queryBuilder().("select count(*)");
Sourabh Saldi
  • 3,567
  • 6
  • 34
  • 57
22
votes
3 answers

Android - ActionBar SearchView suggestions with a simple String array

I want to implement an ActionBar Search Widget with suggestions ability. I already have a string array stored in my ORMLite database that I want to use for the suggestions. How can I do this without creating loads of classes (Provider,…
Mehdiway
  • 10,337
  • 8
  • 36
  • 68
19
votes
3 answers

What is the best way to implement many-to-many relationships using ORMLite?

I'm currently playing with ORMlite to make a model with tables and relationships. One relationship is a many-to-many relationship. What's the best way to implement that? To be more concrete: Let's say I've got these two tables Product id …
Romain Piel
  • 11,017
  • 15
  • 71
  • 106
19
votes
2 answers

Deleting using ormlite on android?

I have a Client bean , @DatabaseField(columnName = "client_id",generatedId = true,useGetSet = true) private Integer clientId; @DatabaseField(columnName = "client_nom",useGetSet = true) private String clientNom; @DatabaseField(columnName =…
Majid
  • 199
  • 1
  • 1
  • 3
1
2 3
89 90