Why ormlite has its own annotations?

独自空忆成欢 提交于 2019-12-08 06:27:58

问题


From what I see in ormlite it has implemented its annotations as well as JPA standard annotations. First of all, what was the reason of designing new set of annotations? Secondly, how one can use standard annotation like @Entity, etc instead of ormlite specific annotations. Right now, I am getting not defined error for those entities. Do I need a jar file?


回答1:


Because it isn't a real JPA implementation, and just makes use of JPA annotations for convenience. Obviously, by using it, you lose the portability offered by JPA itself, but then it may have some advantages for very specific situations




回答2:


@DataNucleus is correct. ORMLite is not a fully compliant JPA implementation. There are many features of ORMLite that do not map well with the JPA annotations and it was easier to create my own set. JPA is also a very large specification and I didn't want a large percentage of the annotations to generate UnsupportedOperationException or jut fail quietly. Lastly, I was trying to write a ORM library with 0 dependencies.

All that said, I am interested in improving ORMLite's JPA compatibility so if you have any suggestions on how to make it better, please send them to the developers mailing list. I'd love to improve it.



来源:https://stackoverflow.com/questions/10187304/why-ormlite-has-its-own-annotations

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!