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

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

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

Example.getEntityMode介绍

暂无

代码示例

代码示例来源: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

if ( component != null ) {
  final String[] propertyNames = type.getPropertyNames();
  final Object[] values = type.getPropertyValues( component, getEntityMode( criteria, criteriaQuery ) );
  final Type[] subtypes = type.getSubtypes();
  for ( int i=0; i<propertyNames.length; i++ ) {

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

Type[] propertyTypes = meta.getPropertyTypes();
Object[] propertyValues = meta.getPropertyValues( entity, getEntityMode(criteria, criteriaQuery) );
for (int i=0; i<propertyNames.length; i++) {
  Object propertyValue = propertyValues[i];

代码示例来源: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

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.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: org.hibernate/com.springsource.org.hibernate.core

Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
Type[] subtypes = type.getSubtypes();
for (int i=0; i<propertyNames.length; i++) {

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

Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
Type[] subtypes = type.getSubtypes();
for (int i=0; i<propertyNames.length; i++) {

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

Object[] values = type.getPropertyValues( component, getEntityMode(criteria, criteriaQuery) );
Type[] subtypes = type.getSubtypes();
for (int i=0; i<propertyNames.length; i++) {

相关文章