For my job I'm trying to convince my colleague to use ORMLite (just found it) instead of writing our own cumbersome and error-prone beast of DB-accessor code. I've got about 2 hours to get this thing to work so I hope you guys can help me out here!
So I'm now trying to make sense of an example app I found here. As far as I understand you need to create a class for every model/table you will have. In the example there's a Person.java and an App.java file. In these files you need to manually create all the getters and setters for every field. So far so good.
Next to these files I've got the folloowing ones:
- DatabaseHelper.java
- DemoRepository.java
- PersonAdapter.java
- DemoORMLiteACtivity.java
My questions are:
- What is a repository in this sense? Why is it needed? I'm looking through the code and I can't really make sense out of it.
- Furthermore, would I need to create all these files myself as well, or are some of these auto-generated?
- If I would need to create all these files myself, what's the advantage of using an ORM, except for not needing the couple lines of SQL?