private void addPersistentProperty(Property property) { if ( "field".equals( property.getPropertyAccessorName() ) ) { fieldAccessedPersistentProperties.add( property.getName() ); } else { propertyAccessedPersistentProperties.put( property.getName(), property.getPropertyAccessorName() ); } }
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 ); } } } }
private PropertyAuditingData getIdPersistentPropertyAuditingData(Property property) { return new PropertyAuditingData( property.getName(), property.getPropertyAccessorName(), ModificationStore.FULL, RelationTargetAuditMode.AUDITED, null, null, false ); }
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 ); } } }
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 ); }
private PropertyData getIdPropertyData(Property property) { return new PropertyData( property.getName(), property.getName(), property.getPropertyAccessorName(), ModificationStore.FULL ); }
@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() ); }
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(); }
property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() ); SimpleValue value = new SimpleValue( buildingContext, component.getTable() ); property.setValue( value );
property.getPropertyAccessorName(), referencedAuditData );
property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() ); Component value = new Component( buildingContext, component.getOwner() );
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 ); } } } }
/** * 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; }
newProperty.setPropertyAccessorName( current.getPropertyAccessorName() ); newProperty.setSelectable( current.isSelectable() ); newProperty.setValue(
accessType = owner.getIdentifierProperty().getPropertyAccessorName().equals( "property" ) ? AccessType.PROPERTY : AccessType.FIELD; accessType = prop.getPropertyAccessorName().equals( "property" ) ? AccessType.PROPERTY : AccessType.FIELD;
isPropertyAnnotated = owner.getIdentifierProperty().getPropertyAccessorName().equals( "property" ); isPropertyAnnotated = prop.getPropertyAccessorName().equals( "property" );
newProperty.setPropertyAccessorName( current.getPropertyAccessorName() ); newProperty.setSelectable( current.isSelectable() ); newProperty.setValue( createFormulatedValue( current.getValue(), collection, targetPropertyName,
property.setPropertyAccessorName( referencedProperty.getPropertyAccessorName() ); SimpleValue value = new SimpleValue( component.getTable() ); property.setValue( value );
.getPropertyAccessorName() .equals( "property" ); if ( owner.getIdentifierMapper() != null && owner.getIdentifierMapper().getPropertySpan() > 0 ) { Property prop = (Property) owner.getIdentifierMapper().getPropertyIterator().next(); isPropertyAnnotated = prop.getPropertyAccessorName().equals( "property" );
/** * 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; }