org.datanucleus.store.query.Query.getCandidateClassName()方法的使用及代码示例

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

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

Query.getCandidateClassName介绍

暂无

代码示例

代码示例来源:origin: org.datanucleus/datanucleus-api-jdo

if (query.getCandidateClassName() != null)
  queryName = query.getCandidateClassName() + "_" + name;

代码示例来源:origin: org.datanucleus/datanucleus-rdbms

/**
 * Convenience method to return if the specified query should use an "UPDATE" lock on returned objects.
 * First checks whether serializeRead is set on the query and, if not, falls back to the setting for the class.
 * @param query The query
 * @return Whether to use an "UPDATE" lock
 */
public static boolean useUpdateLockForQuery(Query query)
{
  if (query.getSerializeRead() != null)
  {
    if (!query.getExecutionContext().getTransaction().isActive())
    {
      // Only applies in a transaction
      return false;
    }
    // Query value takes top priority
    return query.getSerializeRead();
  }
  // Fallback to transaction or class itself
  return query.getExecutionContext().getSerializeReadForClass(query.getCandidateClassName());
}

相关文章