Comments (6)
I took a crack at automating this with an annotation processor. #45
from ormlite-android.
Annotation processing is interesting. Took a quick look at the PR, but
would need to dig more heavily and test.
I did a really simple solution for 49 that reads and saves on first run
rather than compile time. Based on db version number. Positive is that
it'll run automatically. Negative is slow first run for DB.
I've been toying around with annotation processing and code to copy values
from the cursor into model objects. Generated can copy values about twice
as fast as reflection. Would be a pretty significant change, but hoping
somebody gets the urge to try it ;)
In any case, should pull the config gen code in to a version and see if we
can get some people testing.
On Fri, May 8, 2015 at 11:22 PM, NCrouther [email protected] wrote:
I took a crack at automating this with an annotation processor. #45
#45—
Reply to this email directly or view it on GitHub
#40 (comment)
.
Kevin Galligan
http://about.me/kpgalligan
from ormlite-android.
Thanks for taking a look. Let me know if you have any questions. The big area to test would be to hammer on it with incremental compilation; I saw plenty of weirdness when changing annotated files in eclipse. I think all cases are handled properly, but be on the lookout for any spurious warnings/errors raised by the annotation processor during incremental builds.
I'd also definitely be interested in collaborating on expanding the use of annotation processors to eliminate more runtime reflection. I greatly prefer the ORMLite style to the other Android ORMs such as greendao, so if we can get comparable performance, it will be a slam dunk.
from ormlite-android.
Where did you learn the annotation processing stuff?
On May 9, 2015 6:37 PM, "Nathan Crouther" [email protected] wrote:
Thanks for taking a look. Let me know if you have any questions. The big
area to test would be to hammer on it with incremental compilation; I saw
plenty of weirdness when changing annotated files in eclipse. I think all
cases are handled properly, but be on the lookout for any spurious
warnings/errors raised by the annotation processor during incremental
builds.I'd also definitely be interested in collaborating on expanding the use of
annotation processors to eliminate more runtime reflection. I greatly
prefer the ORMLite style to the other Android ORMs such as greendao, so if
we can get comparable performance, it will be a slam dunk.—
Reply to this email directly or view it on GitHub
#40 (comment)
.
from ormlite-android.
This tutorial got me started: http://hannesdorfmann.com/annotation-processing/annotationprocessing101/
I also learned a lot by examining the source for: https://github.com/JakeWharton/butterknife
StackOverflow had a lot of great information about gotchas: http://stackoverflow.com/questions/tagged/annotation-processing
Unfortunately, much of it was trial and error and Googling problems as they came up.
from ormlite-android.
We actually ran the Droidcon NYC last year. Our video wasn't great,
though. JW gave a talk on annotation processing. Still need to dive into
it:
https://www.youtube.com/watch?v=tRmJm2_qytM
I want to review this: https://github.com/yahoo/squidb
Haven't had a chance yet to dig into it and see what its doing. I'm a
little wary of the generated code, as you're regularly using classes
derived from your own templates, which I think is disorienting. GreenDao
is totally weird. You actually write builder code to generate objects, and
adding your own code to your models is clunky. There was a performance
benchmark project that claimed 12x performance difference, but it was super
shady in how it was set up. See my blog post about:
http://kpgalligan.tumblr.com/post/111719199393/ormlite-android-performance
However, I did run my own tests with hand-rolled RowMapper's for OrmLite,
and there is a significant performance boost. I also suspect there might
be issues with lots of temp object creations that could be avoided. It'll
be a deep dive to replace that plumbing, but I think it would be well
received.
I also think something that will allow join queries in an efficient way
would be very helpful. To discuss.
On Sat, May 9, 2015 at 8:14 PM, Nathan Crouther [email protected]
wrote:
This tutorial got me started:
http://hannesdorfmann.com/annotation-processing/annotationprocessing101/I also learned a lot by examining the source for:
https://github.com/JakeWharton/butterknifeStackOverflow had a lot of great information about gotchas:
http://stackoverflow.com/questions/tagged/annotation-processingUnfortunately, much of it was trial and error and Googling problems as the
came up.—
Reply to this email directly or view it on GitHub
#40 (comment)
.
Kevin Galligan
http://about.me/kpgalligan
from ormlite-android.
Related Issues (20)
- android ,执行update操作,总是返回0 HOT 4
- ORMLite Android - Prevent Upgrade inside catch HOT 2
- The connection pool for database has been unable to grant a connection in ORMLite 5.1 HOT 5
- Missing or reset data HOT 3
- getReadWriteConnection: SQLiteCantOpenDatabaseException unknown error (Sqlite code 14): Could not open database, (OS error - 13:Permission denied)
- Is there any way we can get a 5.2 release to benefit from a bugfix in core 5.2? HOT 1
- Feature Request: SupportSQLiteOpenHelper HOT 2
- Null variable AndroidLogBackend causes "Could not construct instance of helper class" HOT 2
- UpdateBuilder use Nonparametric statement cause sql injection problem HOT 3
- Exception when create object with string including single quote HOT 2
- log4j HOT 2
- how to join two table? HOT 2
- [Bug] Using Limit and Offset causes SQL exception. HOT 3
- Duplicate classes and files when depending on a project using ormlite-core HOT 6
- Can't use a dependency with ormlite annotations. HOT 3
- Does ormlite support In-Memory database? HOT 1
- R8 minifyEnabled proguard rules
- EXTERNAL DATA IN SQL QUERIES [SAST] [M7] [CWE-89]
- Security vulnerability - SQL injection
- dao.queryForId() returns null even though row exists HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ormlite-android.