ormlite

Is it possible to have an enum field in a class persisted with OrmLite?

Hello. I'm trying to persist the following class with OrmLite: public class Field { @DatabaseField(id = true) public String name; @DatabaseField(canBeNull = false) public FieldType type; public Field() { } } The FieldType is a public enum. The field, corresponding to the type is string in SQLite (is doesn't support enums). Wh...

Problems with escaping table and field names in Derby and Hsqldb

I'm having a problem with my ORMLite package ( http://ormlite.sourceforge.net/ ). When I generate the schema for a table, I thought it would be a good practice to escape all entity names. This would protect some Java class or field name from being a SQL reserved word: CREATE TABLE "footable" ("stuff" VARCHAR(255)) I'm now adding "ra...

Is it possible to get class of the generic argument?

Hi. I'm kind of lame with generics, but I wonder, for the following class: static class SomeClass<T> { private T value; public SomeClass(T value) { T.class? this.value = value; } public T getValue() { return value; } } If called for example: SomeClass<String> stringer = new SomeClass<String>("Hello"); Is it possible to ge...

Is it possible to write custom SQL in OrmLite?

Hello. I have a class which I want to persist with OrmLite and it stores most of its data in a HashMap. I want to map these fields to the table in Sqlite, leaving the ones absent in the map as null. Is it possible to override methods to save some record to the database with custom implementations using OrmLite? ...

How can I use OrmLite with Android's default SQLite

I have a big problem using the default SQLite database via JDBC driver.I would like to use ORMLite with this.Let me expose my code: String databaseUrl = "jdbc:sqlite:/data/data/my.package.name/db.sqlite"; Class.forName("SQLite.JDBCDriver"); DriverManager.getConnection(databaseUrl); dataSource = DatabaseTyp...

Android ORMLite, use pre-populated database and use it

Hello, I have a pre-populated database, I hadd .csv and make a database in sqllite manager and imported all values into this database. Now I put this database into android's assets folder and want to use this via ORMLite in my android application. Please, need your help and will be thankful to you. ...