Is this possible? Does anyone ever do this? I feel like I can lay out my application better if I use what I'm used to in web applications. Would it possible to use this and dependency injection?
If this is not possible or a viable solution can anyone point me to a couple of example projects using JPA and EntityManger to query databases. Thanks.
You can use the JPA part of EJB 3.1 in Java SE or any Java environment. Most EJB 3 implementations of SessionBeans and such are normally coupled with an application server.
Spring offers dependency injection in any environment and supports JPA.
I guess, it is possible, but the stack is still heavy (both, in terms of resources and, more importantly, maintenance, installation etc.) I wouldn't do it, I would prefer MyBatis. Alternatively, use Hibernate, if you want to stay with JPA-like query language.
There is nothing wrong with using the concept of dependency injection, and Spring is widely used in many desktop apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With