ormlite

How can I use ORMLite with SQLCipher together in Android?

只愿长相守 提交于 2019-11-27 21:20:47
I would like to use OrmLite with SQLCipher in my Android project, but both libraries have their own abstract SQLiteOpenHelper class to implement. Java don't allow a class to extend two classes and if I implement separately, they will not communicate with each other. How can I work with both together? How do I resolve the SQLiteOpenHelper implementation problem? How can I use ORMLite with SQLCipher together in Android? It should be possible @Bruno. One way that should work is to just copy ORMLite's OrmLiteSqliteOpenHelper class into your project, rename it to LocalOrmLiteSqliteOpenHelper or

Android Studio run configuration for ORMLite config generation

一笑奈何 提交于 2019-11-27 18:08:52
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? I managed to do it, but it was a little bit tricky. I have a class called DatabaseConfigUtil which extends OrmLiteConfigUtil, that I created just by following the ormlite official tutorial, so I'll just assume you did the same and also have that class. Please note that you have to pass the complete path to the configuration file, instead of just the file name.

ORMLite's createOrUpdate seems slow - what is normal speed?

試著忘記壹切 提交于 2019-11-27 14:09:40
Calling the ORMLite RuntimeExceptionDao 's createOrUpdate(...) method in my app is very slow. I have a very simple object ( Item ) with a 2 ints (one is the generatedId ), a String and a double . I test the time it takes (roughly) to update the object in the database (a 100 times) with the code below. The log statement logs: time to update 1 row 100 times: 3069 Why does it take 3 seconds to update an object 100 times, in a table with only 1 row. Is this the normal ORMLite speed? If not, what might be the problem? RuntimeExceptionDao<Item, Integer> dao = DatabaseManager.getInstance().getHelper(

Collections in ORMLite

若如初见. 提交于 2019-11-27 14:08:08
问题 Hello I want persist some collections data with ORMlite in my android app. For example : class Person { @DatabaseField(generatedId=true) private int id; @DatabaseField private String name; @DatabaseField private String surname; @ForeignCollectionField private Collections<Phone> phones; } class Phone { @DatabaseField(generatedId=true) private int id; @DatabaseField private String number; @DatabaseField private String type; } How i should do it to persist this collection. EDIT I use

How can I reset a autoincrement sequence number in sqlite

£可爱£侵袭症+ 提交于 2019-11-27 08:46:15
How to update table sqlite_sequence in Ormlite ? I just need update seq. How can I get that table via ORMLite ? EDIT I can't find ORLite tool to do this, so instead I use simple sqlite query. In my class extends OrmLiteSqliteOpenHelper I use SQLiteDatabase to make that update. EDIT2 ;) In my project I persist class Lesson and class WeekDefinition. class Lesson{ @DatabaseField(generatedId=true) private int id; ... } class WeekDefinitions{ @DatabaseField(generatedId=true) private int id; @DatabaseField(foreign=true, columnName="lesson_id") private Lesson lesson; ... } Now , when I add new

compilation of Ormliteconfig file in Android studio

半腔热情 提交于 2019-11-27 08:45:27
问题 Can anyone guide me how to compile OrmLiteConfigUtil file in AndroidStudio i'm new to both ormlite and Android Studio.Thanks I checked the below link.but it is still giving the ClassnotFoundException. Checked this but it is still giving the exception 回答1: The pdf doc of ormLite said: You will need to run this utility locally on your development box (not in an Android device), whenever you make a change to one of your data classes. This means that right now, this must be done by hand to keep

ORMLite poor performance on Android?

北慕城南 提交于 2019-11-27 07:27:22
问题 I'm developing an application for Android, and have tried to use ORMLite, but the performance seems to be really poor. Has anyone else experienced this? Or am I doing something wrong? EDIT No I'm not doing any joins, and all queries are made with indexed keys as parameters. But the data set is resonably big, and there is quite many comparisions. Haven't tried to do with pure SQLite... 回答1: I guess the best answer is that the performance of ORMLite is highly dependent on how you use it. If you

How do I know if my app is running with Robolectric?

允我心安 提交于 2019-11-27 06:39:23
问题 I have an android app that uses ORMLite/SQLite and I use Robolectric in conjunction with JUnit 4 to allow me to run unit tests in Android Studio and on a Jenkins build server. Typically I would setup test data in my tests, in the setup, and then run my test scenarios against it but when I tried to do this I started getting issues and exceptions which seemed to be related to files being locked or something and that seems to be a problem others have had... so what I have done up until now is

Android/ORMLite Insert Row with ID

亡梦爱人 提交于 2019-11-27 03:30:55
问题 I'm currently using ORMLite to work with a SQLite database on Android. As part of this I am downloading a bunch of data from a backend server and I'd like to have this data added to the SQLite database in the exact same format it is on the backend server (ie the IDs are the same, etc). So, my question to you is if I populate my database entry object (we'll call it Equipment), including Equipment's generatedId/primary key field via setId(), and I then run a DAO.create() with that Equipment

Android Cursor with ORMLite to use in CursorAdapter

大兔子大兔子 提交于 2019-11-27 02:51:37
Is there any way, how to get Cursor for a query, which I am processing with ORMLite Dao object? ORMLite now supports next() , previous() , moveRelative(offset) , ... methods on the CloseableIterator class . This should allow you to move the underlying Cursor object around at will. It also supports the following DAO Cursor methods: dao.mapSelectStarRow(databaseResults) Return the latest row from the database results from a query to select * . With this you can change the cursor location (for example) and then get the current object. dao.getSelectStarRowMapper() Provides a mapper that you can