-
Apr 11th, 2011, 04:45 AM
#11
Prepared statement...
Hello,
Spring data JPA is really awesome 
BUT i've got some question :
I've more than one entity manager in my project. How inject the correct entity manager in a JpaRepository?
My configuration display the generated SQL into log. I noticed that the query don't use binding. Why ? 
EDIT:
I think i found a bug:
If you have 2 entities :
Parent {int id; ...}
Child{String name; @ManyToOne(...) Parent parent;...}
In JpaRepository<Child, ...>
Method findByName(String name); generate "select .... from Child where name=?" It is correct
Method findByParentId(int id); generate "select ... from Child where child.parentId=id" (no binding...)
Last edited by gwa; Apr 11th, 2011 at 04:55 AM.
-
Apr 11th, 2011, 04:57 AM
#12
There is an entity-manager-factory-ref attribute at the namespace element. If set, all repositories discovered by this element will be using the entity manager created by this EMF.
What do you exactly mean with "don't use binding"?
-
Apr 11th, 2011, 05:15 AM
#13
The entity-manager-factory-ref attributes seems to work. Thank you.
For the binding, I've edited my previous message with an example. With more test, I think it is a bug, not a features
.
-
May 19th, 2011, 03:05 PM
#14
Nice work, any plans for a callback mechanism? Something similar to what ActiveRecord does before_save, after_save, etc. I'm doing those now using AOP but I would like to see something maybe inside custom repository code mark with annotations
-
May 20th, 2011, 12:56 AM
#15
JPA has the EntityListener concept that you would want to use for that kind of functionality.
-
Jun 2nd, 2011, 09:58 PM
#16
Oliver great work. Really like Spring Data.
-
Jun 19th, 2011, 10:23 AM
#17
Maven repository
Hi,
Really nice features. Thanks!
I can't access Maven repository, it moved to other URL?
Alex
-
Jun 20th, 2011, 07:44 PM
#18
Jboss wrapped entity manager
Hello,
Could you take in consideration the following problem?
When obtaining jboss managed entity manager via jndi lookup, spring-data does not recognize it as HibernateEntityManager because it is wrapped with some Jboss proxy.
Thus, certain features stay unavailable.
Maybe there's some nice and clean solution for it, apart the dirty hack I'm currently using ?
-
Jun 21st, 2011, 05:14 PM
#19
Is there a way to let the proxy expose HibernateEntityManager interface?
-
Jul 19th, 2011, 04:35 AM
#20
Just stumbled across spring-data-jpa (i initially checked for NoSQL helpers in spring-data :-)) and read the docs the last 2 hours. Damn! This is so good. I liked your before/after showcase in one of your blog posts. My DAO is definitely the one in "before". Smile. Thanks for this great work. Will apply this framework to one of our newest projects. Besides all these nice automatic query creation features, the page/sorting feature got me at the end. I wrote so much codes for doing exactly this stuff and in the world of jQuery, Ajax and Tables, you need this paging/sorting all over the place.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules