org.hibernate.criterion.Example.isPropertyIncluded()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(105)

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

Example.isPropertyIncluded介绍

暂无

代码示例

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

if ( ! isVersionProperty && isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] ) ) {
  if ( propertyTypes[i].isComponentType() ) {
    appendComponentCondition(

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

@Override
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) {
  final EntityPersister meta = criteriaQuery.getFactory().getEntityPersister(
      criteriaQuery.getEntityName( criteria )
  );
  final String[] propertyNames = meta.getPropertyNames();
  final Type[] propertyTypes = meta.getPropertyTypes();
  final Object[] values = meta.getPropertyValues( exampleEntity );
  final List<TypedValue> list = new ArrayList<TypedValue>();
  for ( int i=0; i<propertyNames.length; i++ ) {
    final Object value = values[i];
    final Type type = propertyTypes[i];
    final String name = propertyNames[i];
    final boolean isVersionProperty = i == meta.getVersionProperty();
    if ( ! isVersionProperty && isPropertyIncluded( value, name, type ) ) {
      if ( propertyTypes[i].isComponentType() ) {
        addComponentTypedValues( name, value, (CompositeType) type, list, criteria, criteriaQuery );
      }
      else {
        addPropertyTypedValue( value, type, list );
      }
    }
  }
  return list.toArray( new TypedValue[ list.size() ] );
}

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

protected void addComponentTypedValues(
    String path, 
    Object component, 
    CompositeType type,
    List<TypedValue> list,
    Criteria criteria, 
    CriteriaQuery criteriaQuery) {
  if ( component != null ) {
    final String[] propertyNames = type.getPropertyNames();
    final Type[] subtypes = type.getSubtypes();
    final Object[] values = type.getPropertyValues( component, getEntityMode( criteria, criteriaQuery ) );
    for ( int i=0; i<propertyNames.length; i++ ) {
      final Object value = values[i];
      final Type subtype = subtypes[i];
      final String subpath = StringHelper.qualify( path, propertyNames[i] );
      if ( isPropertyIncluded( value, subpath, subtype ) ) {
        if ( subtype.isComponentType() ) {
          addComponentTypedValues( subpath, value, (CompositeType) subtype, list, criteria, criteriaQuery );
        }
        else {
          addPropertyTypedValue( value, subtype, list );
        }
      }
    }
  }
}

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

final String subPath = StringHelper.qualify( path, propertyNames[i] );
final Object value = values[i];
if ( isPropertyIncluded( value, subPath, subtypes[i] ) ) {
  final Type subtype = subtypes[i];
  if ( subtype.isComponentType() ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] );
if (isPropertyIncluded) {
  if ( propertyTypes[i].isComponentType() ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] );
if (isPropertyIncluded) {
  if ( propertyTypes[i].isComponentType() ) {

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

isPropertyIncluded( propertyValue, propertyName, propertyTypes[i] );
if (isPropertyIncluded) {
  if ( propertyTypes[i].isComponentType() ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
  EntityPersister meta = criteriaQuery.getFactory()
      .getEntityPersister( criteriaQuery.getEntityName(criteria) );
  String[] propertyNames = meta.getPropertyNames();
  Type[] propertyTypes = meta.getPropertyTypes();
   //TODO: get all properties, not just the fetched ones!
  Object[] values = meta.getPropertyValues( entity );
  List list = new ArrayList();
  for (int i=0; i<propertyNames.length; i++) {
    Object value = values[i];
    Type type = propertyTypes[i];
    String name = propertyNames[i];
    boolean isPropertyIncluded = i!=meta.getVersionProperty() &&
      isPropertyIncluded(value, name, type);
    if (isPropertyIncluded) {
      if ( propertyTypes[i].isComponentType() ) {
        addComponentTypedValues(name, value, (CompositeType) type, list, criteria, criteriaQuery);
      }
      else {
        addPropertyTypedValue(value, type, list);
      }
    }
  }
  return (TypedValue[]) list.toArray(TYPED_VALUES);
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
  EntityPersister meta = criteriaQuery.getFactory()
      .getEntityPersister( criteriaQuery.getEntityName(criteria) );
  String[] propertyNames = meta.getPropertyNames();
  Type[] propertyTypes = meta.getPropertyTypes();
   //TODO: get all properties, not just the fetched ones!
  Object[] values = meta.getPropertyValues( entity );
  List list = new ArrayList();
  for (int i=0; i<propertyNames.length; i++) {
    Object value = values[i];
    Type type = propertyTypes[i];
    String name = propertyNames[i];
    boolean isPropertyIncluded = i!=meta.getVersionProperty() &&
      isPropertyIncluded(value, name, type);
    if (isPropertyIncluded) {
      if ( propertyTypes[i].isComponentType() ) {
        addComponentTypedValues(name, value, (CompositeType) type, list, criteria, criteriaQuery);
      }
      else {
        addPropertyTypedValue(value, type, list);
      }
    }
  }
  return (TypedValue[]) list.toArray(TYPED_VALUES);
}

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

public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery)
throws HibernateException {
  EntityPersister meta = criteriaQuery.getFactory()
      .getEntityPersister( criteriaQuery.getEntityName(criteria) );
  String[] propertyNames = meta.getPropertyNames();
  Type[] propertyTypes = meta.getPropertyTypes();
   //TODO: get all properties, not just the fetched ones!
  Object[] values = meta.getPropertyValues( entity, getEntityMode(criteria, criteriaQuery) );
  List list = new ArrayList();
  for (int i=0; i<propertyNames.length; i++) {
    Object value = values[i];
    Type type = propertyTypes[i];
    String name = propertyNames[i];
    boolean isPropertyIncluded = i!=meta.getVersionProperty() &&
      isPropertyIncluded(value, name, type);
    if (isPropertyIncluded) {
      if ( propertyTypes[i].isComponentType() ) {
        addComponentTypedValues(name, value, (AbstractComponentType) type, list, criteria, criteriaQuery);
      }
      else {
        addPropertyTypedValue(value, type, list);
      }
    }
  }
  return (TypedValue[]) list.toArray(TYPED_VALUES);
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

protected void addComponentTypedValues(
    String path, 
    Object component, 
    CompositeType type,
    List list, 
    Criteria criteria, 
    CriteriaQuery criteriaQuery)
throws HibernateException {
  if (component!=null) {
    String[] propertyNames = type.getPropertyNames();
    Type[] subtypes = type.getSubtypes();
    Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
    for (int i=0; i<propertyNames.length; i++) {
      Object value = values[i];
      Type subtype = subtypes[i];
      String subpath = StringHelper.qualify( path, propertyNames[i] );
      if ( isPropertyIncluded(value, subpath, subtype) ) {
        if ( subtype.isComponentType() ) {
          addComponentTypedValues(subpath, value, (CompositeType) subtype, list, criteria, criteriaQuery);
        }
        else {
          addPropertyTypedValue(value, subtype, list);
        }
      }
    }
  }
}

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

protected void addComponentTypedValues(
    String path, 
    Object component, 
    AbstractComponentType type, 
    List list, 
    Criteria criteria, 
    CriteriaQuery criteriaQuery)
throws HibernateException {
  if (component!=null) {
    String[] propertyNames = type.getPropertyNames();
    Type[] subtypes = type.getSubtypes();
    Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
    for (int i=0; i<propertyNames.length; i++) {
      Object value = values[i];
      Type subtype = subtypes[i];
      String subpath = StringHelper.qualify( path, propertyNames[i] );
      if ( isPropertyIncluded(value, subpath, subtype) ) {
        if ( subtype.isComponentType() ) {
          addComponentTypedValues(subpath, value, (AbstractComponentType) subtype, list, criteria, criteriaQuery);
        }
        else {
          addPropertyTypedValue(value, subtype, list);
        }
      }
    }
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

protected void addComponentTypedValues(
    String path, 
    Object component, 
    CompositeType type,
    List list, 
    Criteria criteria, 
    CriteriaQuery criteriaQuery)
throws HibernateException {
  if (component!=null) {
    String[] propertyNames = type.getPropertyNames();
    Type[] subtypes = type.getSubtypes();
    Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
    for (int i=0; i<propertyNames.length; i++) {
      Object value = values[i];
      Type subtype = subtypes[i];
      String subpath = StringHelper.qualify( path, propertyNames[i] );
      if ( isPropertyIncluded(value, subpath, subtype) ) {
        if ( subtype.isComponentType() ) {
          addComponentTypedValues(subpath, value, (CompositeType) subtype, list, criteria, criteriaQuery);
        }
        else {
          addPropertyTypedValue(value, subtype, list);
        }
      }
    }
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

String subpath = StringHelper.qualify( path, propertyNames[i] );
Object value = values[i];
if ( isPropertyIncluded( value, subpath, subtypes[i] ) ) {
  Type subtype = subtypes[i];
  if ( subtype.isComponentType() ) {

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

String subpath = StringHelper.qualify( path, propertyNames[i] );
Object value = values[i];
if ( isPropertyIncluded( value, subpath, subtypes[i] ) ) {
  Type subtype = subtypes[i];
  if ( subtype.isComponentType() ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

String subpath = StringHelper.qualify( path, propertyNames[i] );
Object value = values[i];
if ( isPropertyIncluded( value, subpath, subtypes[i] ) ) {
  Type subtype = subtypes[i];
  if ( subtype.isComponentType() ) {

相关文章