javax.persistence.Query.getLockMode()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(285)

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

Query.getLockMode介绍

[英]Get the current lock mode for the query. Returns null if a lock mode has not been set on the query object.
[中]获取查询的当前锁定模式。如果尚未对查询对象设置锁定模式,则返回null。

代码示例

代码示例来源:origin: Impetus/Kundera

@Override
public LockModeType getLockMode()
{
  return query.getLockMode();
}

代码示例来源:origin: org.apache.geronimo.modules/geronimo-persistence-jpa20

@Override
public LockModeType getLockMode() {
  return query.getLockMode();
}

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

/** {@inheritDoc} */
@Override
public LockModeType getLockMode() {
  return query.getLockMode();
}

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

@Override
public LockModeType
getLockMode()
{
  return delegate.getLockMode();
}

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

@Override
public LockModeType getLockMode() {
  return underlyingQuery.getLockMode();
}

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

@Override
public LockModeType getLockMode() {
  return underlyingQuery.getLockMode();
}

代码示例来源:origin: kumuluz/kumuluzee

@Override
public LockModeType getLockMode() {
  return query.getLockMode();
}

代码示例来源:origin: Blazebit/blaze-persistence

@Override
public LockModeType getLockMode() {
  return delegate.getLockMode();
}

代码示例来源:origin: Blazebit/blaze-persistence

@Override
public LockModeType getLockMode() {
  return delegate.getLockMode();
}

代码示例来源:origin: com.kumuluz.ee/kumuluzee-jpa-common

@Override
public LockModeType getLockMode() {
  return query.getLockMode();
}

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

public LockModeType getLockMode() {
  return query.getLockMode();
}

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

public LockModeType getLockMode() {
  return query.getLockMode();
}

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

public LockModeType getLockMode() {
  return query.getLockMode();
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.serviceaccess

/**
   * helper to log a query with its parameters
   * 
   * @param query query to analyse
   * @return informations of given query
   */
  public static String formatQuery(Query query) {
    final StringBuilder buf = new StringBuilder("\nQuery: ");
    buf.append("hints = " + query.getHints() + ", ");
    buf.append("lockmode = " + query.getLockMode() + ", ");
    buf.append("flushmode = " + query.getFlushMode() + ", ");
    buf.append("maxresults = " + query.getMaxResults()/* + ", "*/);
    //there is a illegalaccess problem on the parameters
//        buf.append("\nparameter:\n");
//        Set<Parameter<?>> parameters = query.getParameters();
//        for (Parameter<?> parameter : parameters) {
//            buf.append("    " + new Bean(parameter) + "\n");
//        }
    return buf.toString();
  }

代码示例来源:origin: org.glassfish.main.common/container-common

public LockModeType getLockMode() {
  try {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerQueryStart(EntityManagerQueryMethod.GET_LOCK_MODE);
    }
    return queryDelegate.getLockMode();
  } finally {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerQueryEnd();
    }
  }
}

代码示例来源:origin: org.glassfish.common/container-common

public LockModeType getLockMode() {
  try {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerQueryStart(EntityManagerQueryMethod.GET_LOCK_MODE);
    }
    Query delegate = getQueryDelegate();
    return delegate.getLockMode();
  } finally {
    if(callFlowAgent.isEnabled()) {
      callFlowAgent.entityManagerQueryEnd();
    }
  }
}

代码示例来源:origin: com.mysema.querydsl/querydsl-jpa

@Test
public void LockMode() {
  javax.persistence.Query query = query().from(cat)
      .setLockMode(LockModeType.PESSIMISTIC_READ).createQuery(cat);
  assertTrue(query.getLockMode().equals(LockModeType.PESSIMISTIC_READ));
  assertFalse(query.getResultList().isEmpty());
}

代码示例来源:origin: com.querydsl/querydsl-jpa

@Test
public void lockMode() {
  javax.persistence.Query query = query().from(cat)
      .setLockMode(LockModeType.PESSIMISTIC_READ)
      .select(cat).createQuery();
  assertTrue(query.getLockMode().equals(LockModeType.PESSIMISTIC_READ));
  assertFalse(query.getResultList().isEmpty());
}

相关文章