Announcement Announcement Module
Collapse
No announcement yet.
JPA and Implementation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • JPA and Implementation

    How do you get hold of the underlying JPA implementation, is this possible?

    regards,
    JC.

  • #2
    I'm only a beginner with JPA myself, but I'm not sure what you mean. What is it you're trying to get hold of?
    Last edited by karldmoore; Aug 29th, 2007, 11:02 AM.

    Comment


    • #3
      I solved it.

      Basically I wanted to use JPA, but want also to use Criteria API from hibernate because this is currently not in the JPA spec (yet).

      To get the session you can go:

      Code:
      Session session (Session)em.getDelegate();
      I found that if I extended JpaSupportDao from spring getting the EM from the template was NULL..

      Comment


      • #4
        Just to add, previously when I extracted the delegate it was NULL when extending JpaSupportDao.

        If you use the doInJpa callback it DOES work...

        Code:
        List list = this.getJpaTemplate().executeFind(new JpaCallback() {
          public Object doInJpa(EntityManager em) throws PersistenceException  {
           Session session = (Session)em.getDelegate();

        Comment

        Working...
        X