Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Spring Data JPA 1.0 M2 released

  1. #11
    Join Date
    Apr 2011
    Posts
    107

    Default 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.

  2. #12
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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"?

  3. #13
    Join Date
    Apr 2011
    Posts
    107

    Default

    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 .

  4. #14
    Join Date
    May 2011
    Posts
    1

    Default

    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

  5. #15
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    JPA has the EntityListener concept that you would want to use for that kind of functionality.

  6. #16

    Thumbs up

    Oliver great work. Really like Spring Data.

  7. #17
    Join Date
    Jun 2011
    Posts
    1

    Default Maven repository

    Hi,

    Really nice features. Thanks!

    I can't access Maven repository, it moved to other URL?

    Alex

  8. #18
    Join Date
    Jun 2011
    Posts
    2

    Default 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 ?

  9. #19
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    Is there a way to let the proxy expose HibernateEntityManager interface?

  10. #20
    Join Date
    Feb 2005
    Location
    Osnabrück, Germany
    Posts
    74

    Default

    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.
    regards
    Marc Logemann
    http://www.logemann.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •