javax.persistence.Persistence.getPersistenceUtil()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(403)

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

Persistence.getPersistenceUtil介绍

[英]Return the PersistenceUtil instance
[中]返回PersistenceUtil实例

代码示例

代码示例来源:origin: hibernate/hibernate-orm

PersistenceUtil persistenceUnitUtil = Persistence.getPersistenceUtil();

代码示例来源:origin: EvoSuite/evosuite

public static PersistenceUtil getPersistenceUtil() {
  return Persistence.getPersistenceUtil();
}

代码示例来源:origin: org.apache.bval/bval-jsr

/**
 * {@inheritDoc}
 */
@Override
public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType,
  Path pathToTraversableObject, ElementType elementType) {
  return traversableObject == null
    || Persistence.getPersistenceUtil().isLoaded(traversableObject, traversableProperty.getName());
}

代码示例来源:origin: org.apache.bval/bval-jsr303

/**
 * {@inheritDoc}
 */
public boolean isReachable(Object traversableObject, Path.Node traversableProperty,
              Class<?> rootBeanType, Path pathToTraversableObject,
              ElementType elementType) {
  return traversableObject == null || Persistence.getPersistenceUtil()
     .isLoaded(traversableObject, traversableProperty.getName());
}

代码示例来源:origin: org.apache.tomee.patch/bval-jsr

/**
 * {@inheritDoc}
 */
@Override
public boolean isReachable(Object traversableObject, Path.Node traversableProperty, Class<?> rootBeanType,
  Path pathToTraversableObject, ElementType elementType) {
  return traversableObject == null
    || Persistence.getPersistenceUtil().isLoaded(traversableObject, traversableProperty.getName());
}

代码示例来源:origin: com.github.friendlyjava/jpa-descriptor

@Override
  public boolean isLoaded(Object entity, String attrName) throws JpaLoadStateException {
    try {
      return Persistence.getPersistenceUtil().isLoaded(entity, attrName);
    } catch (Exception e) {
      throw new JpaLoadStateException(e);
    }
  }
}

代码示例来源:origin: org.hibernate.validator/hibernate-validator

@Override
public final boolean isReachable(Object traversableObject,
                 Path.Node traversableProperty,
                 Class<?> rootBeanType,
                 Path pathToTraversableObject,
                 ElementType elementType) {
  if ( LOG.isTraceEnabled() ) {
    LOG.tracef(
        "Calling isReachable on object %s with node name %s.",
        traversableObject,
        traversableProperty.getName()
    );
  }
  if ( traversableObject == null ) {
    return true;
  }
  return Persistence.getPersistenceUtil().isLoaded( traversableObject, traversableProperty.getName() );
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.hibernate-validator

@Override
public final boolean isReachable(Object traversableObject,
                 Path.Node traversableProperty,
                 Class<?> rootBeanType,
                 Path pathToTraversableObject,
                 ElementType elementType) {
  if ( log.isTraceEnabled() ) {
    log.tracef(
        "Calling isReachable on object %s with node name %s.",
        traversableObject,
        traversableProperty.getName()
    );
  }
  if ( traversableObject == null ) {
    return true;
  }
  return Persistence.getPersistenceUtil().isLoaded( traversableObject, traversableProperty.getName() );
}

相关文章