I started work on this a while back. It is pretty trivial to write a program that takes in a class file and from that class file generate the content provider and all the constants. Depending on what you are doing, you can add in some other "ORM" stuff if you need it.
The basic steps where to make a templated source code file and then using reflection determine what to fill in your class specific stuff. What I did was have the outer class represent the ContentProvider and a inner class for each table. You can use annotations for versioning and setting default sort columns and a couple of other things. I abandoned the project since it was too much of pain to keep up with Googles api changes. Hopefully that is no longer an issue. On Jan 6, 1:04 pm, antlers <[email protected]> wrote: > I've been looking at the code for connectbot, and I notice that the > objects that correspond to records in the SQLite database seem to have > an awful lot of boilerplate code (constants for field names, creating > a table, inserting a record, updating a record, populating an object > or collection from a cursor). I was wondering if there was an > existing tool to generate such code so you would have an easy way to > get an efficient object interface to an SQLite table? > > I was thinking of an interface with annotations that describe the > underlying table, and the code generator would create an object that > implements the interface and interacts with the table --something like > Hibernate-lite. > > If no such tool exists, is anyone else interested in something like > that? I've done Eclipse plugins before, and I could try to put > together an APT plugin that does this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

