Android Orm - Room
There are a lot of ORM for Android. Previously, I have used Ormlite. That is quite good. I got a new personal project of Android App. This is a good to look around new framework I can use. I found Google has their ORM layer. That is not form the standard SDK. This ORM is from the Android Architecture Components. That is quite modern, and similar with others. It used annotations like this to define the mapping
Code
@Entity(tableName = "people") | |
public class Person { | |
@PrimaryKey(autoGenerate = true) | |
public int id; | |
public String name; | |
| |
public int eventId; | |
} |
But the Dao is a strange
public interface DrawingEventDao {
@Query("SELECT * FROM drawEvents")
List loadAll();
}
Because it is a ORM of sqlite. You still need to write the SQL like this. That is the things I do not really like. Maybe I have been LINQ for too long. That is not easy to go back the SQL. But that is still much better than connecting with Sqlite
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 52 feedbacks awaiting moderation...
Form is loading...