javax.persistence.EntityManager.getFlushMode()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中javax.persistence.EntityManager.getFlushMode()方法的一些代码示例,展示了EntityManager.getFlushMode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EntityManager.getFlushMode()方法的具体详情如下:
包路径:javax.persistence.EntityManager
类名称:EntityManager
方法名:getFlushMode

EntityManager.getFlushMode介绍

[英]Get the flush mode that applies to all objects contained in the persistence context.
[中]获取应用于持久性上下文中包含的所有对象的刷新模式。

代码示例

代码示例来源:origin: rapidoid/rapidoid

@Override
public FlushModeType getFlushMode() {
  return em.getFlushMode();
}

代码示例来源:origin: rapidoid/rapidoid

@Override
public FlushModeType getFlushMode() {
  return em().getFlushMode();
}

代码示例来源:origin: de.juplo.yourshouter.api/persistence-jpa

@Override
 public FlushModeType getFlushMode()
 {
  return manager.getFlushMode();
 }
}

代码示例来源:origin: com.helger/ph-db-jpa

public FlushModeType getFlushMode ()
{
 return m_aEntityMgr.getFlushMode ();
}

代码示例来源:origin: org.evolvis.bsi/kolab-ws

@Override
public FlushModeType
getFlushMode()
{
  return delegate.getFlushMode();
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

/** {@inheritDoc} */
@Override
public FlushModeType getFlushMode() {
  return entityManager.getFlushMode();
}

代码示例来源:origin: org.apache.deltaspike.modules/deltaspike-data-module-impl

@Override
public FlushModeType getFlushMode()
{
  return entityManager().getFlushMode();
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    Assert.assertNotNull("The EntityManager is null", emField);
    try {
      // call a do nothing method to assure entity manager actually exists
      emField.getFlushMode();
    } catch (Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.codehaus.fabric3/fabric3-jpa-core

public FlushModeType getFlushMode() {
  initEntityManager();
  return em.getFlushMode();
}

代码示例来源:origin: apache/oozie

public String getFlushMode() {
    return entityManager.getFlushMode().toString();
  }
}

代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException{
  try{
    try{
      EntityManager em = (EntityManager) mdbContext.lookup("persistence/TestContext");
      Assert.assertNotNull("The EntityManager is null", em);
      // call a do nothing method to assure entity manager actually exists
      em.getFlushMode();
    } catch (Exception e){
      Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
    }
  } catch (AssertionFailedError afe){
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-jpa

public FlushModeType getFlushMode() {
  long start = 0;
  if (isTraceEnabled)
    start = System.currentTimeMillis();
  try {
    return getEntityManager().getFlushMode();
  } finally {
    if (isTraceEnabled) {
      long elapsed = System.currentTimeMillis() - start;
      ROOT_LOGGER.tracef("getFlushMode took %dms", elapsed);
    }
  }
}

代码示例来源:origin: org.seasar.container/s2-tiger

public FlushModeType getFlushMode() {
  final boolean mustClose = !isTxActive();
  final EntityManager em = getEntityManager();
  try {
    return em.getFlushMode();
  } finally {
    if (mustClose) {
      em.close();
    }
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    Assert.assertNotNull("The EntityManager is null", em);
    try {
      // call a do nothing method to assure entity manager actually exists
      em.getFlushMode();
    } catch (final Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (final AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    Assert.assertNotNull("The EntityManager is null", emField);
    try {
      // call a do nothing method to assure entity manager actually exists
      emField.getFlushMode();
    } catch (final Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (final AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    Assert.assertNotNull("The EntityManager is null", emField);
    try {
      // call a do nothing method to assure entity manager actually exists
      emField.getFlushMode();
    } catch (final Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (final AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    Assert.assertNotNull("The EntityManager is null", em);
    try {
      // call a do nothing method to assure entity manager actually exists
      em.getFlushMode();
    } catch (final Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (final AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: Jasig/uPortal

@Override
public DateDimension getDateDimensionById(long key) {
  final EntityManager entityManager = this.getEntityManager();
  final FlushModeType flushMode = entityManager.getFlushMode();
  try {
    entityManager.setFlushMode(FlushModeType.COMMIT);
    return entityManager.find(DateDimensionImpl.class, key);
  } finally {
    entityManager.setFlushMode(flushMode);
  }
}

代码示例来源:origin: org.apache.openejb/openejb-itests-beans

public void lookupPersistenceContext() throws TestFailureException {
  try {
    try {
      final EntityManager em = (EntityManager) ejbContext.lookup("persistence/TestContext");
      Assert.assertNotNull("The EntityManager is null", em);
      // call a do nothing method to assure entity manager actually exists
      em.getFlushMode();
    } catch (final Exception e) {
      Assert.fail("Received Exception " + e.getClass() + " : " + e.getMessage());
    }
  } catch (final AssertionFailedError afe) {
    throw new TestFailureException(afe);
  }
}

代码示例来源:origin: org.apache.tomee/openejb-core

public FlushModeType getFlushMode() {
  final EntityManager entityManager = getEntityManager();
  try {
    final Timer timer = Op.getFlushMode.start(this.timer, this);
    try {
      return entityManager.getFlushMode();
    } finally {
      timer.stop();
    }
  } finally {
    closeIfNoTx(entityManager);
  }
}

相关文章