org.hibernate.mapping.Property.getPropertyAccessorName()方法的使用及代码示例

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

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

Property.getPropertyAccessorName介绍

暂无

代码示例

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

private void addPersistentProperty(Property property) {
  if ( "field".equals( property.getPropertyAccessorName() ) ) {
    fieldAccessedPersistentProperties.add( property.getName() );
  }
  else {
    propertyAccessedPersistentProperties.put( property.getName(), property.getPropertyAccessorName() );
  }
}

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

private static void matchColumnsByProperty(Property property, Map<Column, Set<Property>> columnsToProperty) {
    if ( property == null ) {
      return;
    }
    if ( "noop".equals( property.getPropertyAccessorName() )
        || "embedded".equals( property.getPropertyAccessorName() ) ) {
      return;
    }
// FIXME cannot use subproperties becasue the caller needs top level properties
//        if ( property.isComposite() ) {
//            Iterator subProperties = ( (Component) property.getValue() ).getPropertyIterator();
//            while ( subProperties.hasNext() ) {
//                matchColumnsByProperty( (Property) subProperties.next(), columnsToProperty );
//            }
//        }
    else {
      Iterator columnIt = property.getColumnIterator();
      while ( columnIt.hasNext() ) {
        //can be a Formula so we don't cast
        Object column = columnIt.next();
        //noinspection SuspiciousMethodCalls
        if ( columnsToProperty.containsKey( column ) ) {
          columnsToProperty.get( column ).add( property );
        }
      }
    }
  }

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

private PropertyAuditingData getIdPersistentPropertyAuditingData(Property property) {
  return new PropertyAuditingData(
      property.getName(), property.getPropertyAccessorName(),
      ModificationStore.FULL, RelationTargetAuditMode.AUDITED, null, null, false
  );
}

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

private void readPersistentPropertiesAccess() {
  final Iterator<Property> propertyIter = persistentPropertiesSource.getPropertyIterator();
  while ( propertyIter.hasNext() ) {
    final Property property = propertyIter.next();
    addPersistentProperty( property );
    // See HHH-6636
    if ( "embedded".equals( property.getPropertyAccessorName() ) && !PropertyPath.IDENTIFIER_MAPPER_PROPERTY.equals( property.getName() ) ) {
      createPropertiesGroupMapping( property );
    }
  }
}

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

public PropertyAccessStrategy getPropertyAccessStrategy(Class clazz) throws MappingException {
  String accessName = getPropertyAccessorName();
  if ( accessName == null ) {
    if ( clazz == null || java.util.Map.class.equals( clazz ) ) {
      accessName = "map";
    }
    else {
      accessName = "property";
    }
  }
  final EntityMode entityMode = clazz == null || java.util.Map.class.equals( clazz )
      ? EntityMode.MAP
      : EntityMode.POJO;
  return resolveServiceRegistry().getService( PropertyAccessStrategyResolver.class ).resolvePropertyAccessStrategy(
      clazz,
      accessName,
      entityMode
  );
}

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

private PropertyData getIdPropertyData(Property property) {
  return new PropertyData(
      property.getName(), property.getName(), property.getPropertyAccessorName(),
      ModificationStore.FULL
  );
}

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

@Test
public void testAttributeAccessorConfiguration() {
  final Metadata metadata = new MetadataSources( serviceRegistry )
      .addAnnotatedClass( Foo.class )
      .buildMetadata();
  final Property property = metadata.getEntityBinding( Foo.class.getName() ).getProperty( "name" );
  assertEquals( BasicAttributeAccessor.class.getName(), property.getPropertyAccessorName() );
}

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

private static Getter getGetter(Property mappingProperty) {
  if ( mappingProperty == null || !mappingProperty.getPersistentClass().hasPojoRepresentation() ) {
    return null;
  }
  final PropertyAccessStrategyResolver propertyAccessStrategyResolver =
      mappingProperty.getPersistentClass().getServiceRegistry().getService( PropertyAccessStrategyResolver.class );
  final PropertyAccessStrategy propertyAccessStrategy = propertyAccessStrategyResolver.resolvePropertyAccessStrategy(
      mappingProperty.getClass(),
      mappingProperty.getPropertyAccessorName(),
      EntityMode.POJO
  );
  final PropertyAccess propertyAccess = propertyAccessStrategy.buildPropertyAccess(
      mappingProperty.getPersistentClass().getMappedClass(),
      mappingProperty.getName()
  );
  return propertyAccess.getGetter();
}

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

property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() );
SimpleValue value = new SimpleValue( buildingContext, component.getTable() );
property.setValue( value );

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

property.getPropertyAccessorName(),
    referencedAuditData
);

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

property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() );
Component value = new Component( buildingContext, component.getOwner() );

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

private static void matchColumnsByProperty(Property property, Map<Column, Set<Property>> columnsToProperty) {
    if ( property == null ) return;
    if ( "noop".equals( property.getPropertyAccessorName() )
        || "embedded".equals( property.getPropertyAccessorName() ) ) {
      return;
    }
// FIXME cannot use subproperties becasue the caller needs top level properties
//        if ( property.isComposite() ) {
//            Iterator subProperties = ( (Component) property.getValue() ).getPropertyIterator();
//            while ( subProperties.hasNext() ) {
//                matchColumnsByProperty( (Property) subProperties.next(), columnsToProperty );
//            }
//        }
    else {
      Iterator columnIt = property.getColumnIterator();
      while ( columnIt.hasNext() ) {
        Object column = columnIt.next(); //can be a Formula so we don't cast
        //noinspection SuspiciousMethodCalls
        if ( columnsToProperty.containsKey( column ) ) {
          columnsToProperty.get( column ).add( property );
        }
      }
    }
  }

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

/**
 * create a property copy reusing the same value
 */
public static Property shallowCopy(Property property) {
  Property clone = new Property();
  clone.setCascade( property.getCascade() );
  clone.setInsertable( property.isInsertable() );
  clone.setLazy( property.isLazy() );
  clone.setName( property.getName() );
  clone.setNaturalIdentifier( property.isNaturalIdentifier() );
  clone.setOptimisticLocked( property.isOptimisticLocked() );
  clone.setOptional( property.isOptional() );
  clone.setPersistentClass( property.getPersistentClass() );
  clone.setPropertyAccessorName( property.getPropertyAccessorName() );
  clone.setSelectable( property.isSelectable() );
  clone.setUpdateable( property.isUpdateable() );
  clone.setValue( property.getValue() );
  return clone;
}

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

newProperty.setPropertyAccessorName( current.getPropertyAccessorName() );
newProperty.setSelectable( current.isSelectable() );
newProperty.setValue(

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

accessType = owner.getIdentifierProperty().getPropertyAccessorName().equals( "property" )
    ? AccessType.PROPERTY
    : AccessType.FIELD;
accessType = prop.getPropertyAccessorName().equals( "property" ) ? AccessType.PROPERTY
    : AccessType.FIELD;

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

isPropertyAnnotated = owner.getIdentifierProperty().getPropertyAccessorName().equals( "property" );
isPropertyAnnotated = prop.getPropertyAccessorName().equals( "property" );

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

newProperty.setPropertyAccessorName( current.getPropertyAccessorName() );
newProperty.setSelectable( current.isSelectable() );
newProperty.setValue( createFormulatedValue( current.getValue(), collection, targetPropertyName,

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

property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() );
SimpleValue value = new SimpleValue( component.getTable() );
property.setValue( value );

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

.getPropertyAccessorName()
      .equals( "property" );
if ( owner.getIdentifierMapper() != null && owner.getIdentifierMapper().getPropertySpan() > 0 ) {
  Property prop = (Property) owner.getIdentifierMapper().getPropertyIterator().next();
  isPropertyAnnotated = prop.getPropertyAccessorName().equals( "property" );

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

/**
 * create a property copy reusing the same value
 */
public static Property shallowCopy(Property property) {
  Property clone = new Property();
  clone.setCascade( property.getCascade() );
  clone.setInsertable( property.isInsertable() );
  clone.setLazy( property.isLazy() );
  clone.setName( property.getName() );
  clone.setNodeName( property.getNodeName() );
  clone.setNaturalIdentifier( property.isNaturalIdentifier() );
  clone.setOptimisticLocked( property.isOptimisticLocked() );
  clone.setOptional( property.isOptional() );
  clone.setPersistentClass( property.getPersistentClass() );
  clone.setPropertyAccessorName( property.getPropertyAccessorName() );
  clone.setSelectable( property.isSelectable() );
  clone.setUpdateable( property.isUpdateable() );
  clone.setValue( property.getValue() );
  return clone;
}

相关文章

微信公众号

最新文章

更多