Package javax.persistence

Examples of javax.persistence.EntityManager.clear()


    EntityManager em = getPersistenceContext(false);
    try {
      return em.createNativeQuery(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public Query createNativeQuery(String arg0, String arg1)
  {
View Full Code Here


    EntityManager em = getPersistenceContext(false);
    try {
      return em.createNativeQuery(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public Query createQuery(String arg0)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.createQuery(arg0);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public <T> T find(Class<T> arg0, Object arg1)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.find(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  /**
   * @throws TransactionRequiredException
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.getReference(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public EntityTransaction getTransaction()
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      em.setFlushMode(arg0);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public <T> TypedQuery<T> createNamedQuery(String arg0, Class<T> arg1)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.createNamedQuery(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public <T> TypedQuery<T> createQuery(CriteriaQuery<T> arg0)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.createQuery(arg0);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public <T> TypedQuery<T> createQuery(String arg0, Class<T> arg1)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.createQuery(arg0, arg1);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  public void detach(Object arg0)
  {
View Full Code Here

    EntityManager em = getPersistenceContext(false);
    try {
      return em.find(arg0, arg1, arg2);
    } finally {
      if(em == detachedManager)
        em.clear();
    }
  }

  /**
   * @throws TransactionRequiredException if lock mode is not NONE
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.