Announcement Announcement Module
Collapse
No announcement yet.
replacement for em.containts(e) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • replacement for em.containts(e)

    I have JpaRepository bean and I need #contains method. How do I accomplish em.contains(t) with spring data?

    Code:
    repo.contains(e)
    but there is not such thing.

    If no way with spring-data, then how can I get em object from jpa repository that is being used for pulling my entity.
    Code:
    repo.getEM()
    but there is not such thing too.
    for example
    Code:
            Entity e = repo.findOne(1L)
            
            ....
            //here I need to check e is in em context or not,
            //I can do this: 
            em = meFactory.createEntityManager()
            em.contains(e), //but this is not the entityManager that repo used under the hood.  clearly false will be returned.
    Is there any way to get instance of em that repo used or check contains?
    Last edited by elbek; Mar 11th, 2013, 11:59 PM.

  • #2
    no way? any idea guys?

    Comment

    Working...
    X