/** * buid a property holder on top of a collection */ public static CollectionPropertyHolder buildPropertyHolder( Collection collection, String path, XClass clazzToProcess, XProperty property, PropertyHolder parentPropertyHolder, MetadataBuildingContext context) { return new CollectionPropertyHolder( collection, path, clazzToProcess, property, parentPropertyHolder, context ); }
public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) { //Ejb3Column.checkPropertyConsistency( ); //already called earlier /* * Check table matches between the component and the columns * if not, change the component table if no properties are set * if a property is set already the core cannot support that */ if (columns != null) { Table table = columns[0].getTable(); if ( !table.equals( component.getTable() ) ) { if ( component.getPropertySpan() == 0 ) { component.setTable( table ); } else { throw new AnnotationException( "A component cannot hold properties split into 2 different tables: " + this.getPath() ); } } } addProperty( prop, declaringClass ); }
@Override public Column[] getOverriddenColumn(String propertyName) { //FIXME this is yukky Column[] result = super.getOverriddenColumn( propertyName ); if ( result == null ) { String userPropertyName = extractUserPropertyName( "id", propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } if ( result == null ) { String userPropertyName = extractUserPropertyName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY, propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } return result; }
super( path, parent, inferredData.getPropertyClass(), context ); final XProperty embeddedXProperty = inferredData.getProperty(); setCurrentProperty( embeddedXProperty ); this.component = component; this.isOrWithinEmbeddedId = this.attributeConversionInfoMap = processAttributeConversions( embeddedXProperty ); this.attributeConversionInfoMap = processAttributeConversions( inferredData.getClassOrElement() );
public ComponentPropertyHolder( Component component, String path, PropertyData inferredData, PropertyHolder parent, ExtendedMappings mappings ) { super( path, parent, inferredData.getPropertyClass(), mappings ); final XProperty property = inferredData.getProperty(); setCurrentProperty( property ); this.component = component; this.isOrWithinEmbeddedId = parent.isOrWithinEmbeddedId() || ( property != null && ( property.isAnnotationPresent( Id.class ) || property.isAnnotationPresent( EmbeddedId.class ) ) ); }
private Map<String,AttributeConversionInfo> processAttributeConversions(XClass embeddableXClass) { final Map<String,AttributeConversionInfo> infoMap = new HashMap<String, AttributeConversionInfo>(); processAttributeConversions( embeddableXClass, infoMap ); return infoMap; }
@Override protected AttributeConversionInfo locateAttributeConversionInfo(XProperty property) { final String propertyName = property.getName(); // conversions on parent would have precedence AttributeConversionInfo conversion = locateAttributeConversionInfo( propertyName ); if ( conversion != null ) { return conversion; } return null; }
private static boolean isToManyAssociationWithinEmbeddableCollection(PropertyHolder propertyHolder) { if(propertyHolder instanceof ComponentPropertyHolder) { ComponentPropertyHolder componentPropertyHolder = (ComponentPropertyHolder) propertyHolder; return componentPropertyHolder.isWithinElementCollection(); } return false; }
@Override protected String normalizeCompositePathForLogging(String attributeName) { return normalizeCompositePath( attributeName ); }
public ComponentPropertyHolder( Component component, String path, PropertyData inferredData, PropertyHolder parent, ExtendedMappings mappings ) { super( path, parent, inferredData.getPropertyClass(), mappings ); setCurrentProperty( inferredData.getProperty() ); this.component = component; }
super( path, parent, inferredData.getPropertyClass(), context ); final XProperty embeddedXProperty = inferredData.getProperty(); setCurrentProperty( embeddedXProperty ); this.component = component; this.isOrWithinEmbeddedId = this.attributeConversionInfoMap = processAttributeConversions( embeddedXProperty ); this.attributeConversionInfoMap = processAttributeConversions( inferredData.getClassOrElement() );
processAttributeConversions( embeddableXClass, infoMap );
@Override protected AttributeConversionInfo locateAttributeConversionInfo(XProperty property) { final String propertyName = property.getName(); // conversions on parent would have precedence AttributeConversionInfo conversion = locateAttributeConversionInfo( propertyName ); if ( conversion != null ) { return conversion; } return null; }
private static boolean isToManyAssociationWithinEmbeddableCollection(PropertyHolder propertyHolder) { if(propertyHolder instanceof ComponentPropertyHolder) { ComponentPropertyHolder componentPropertyHolder = (ComponentPropertyHolder) propertyHolder; return componentPropertyHolder.isWithinElementCollection(); } return false; }
@Override protected String normalizeCompositePathForLogging(String attributeName) { return normalizeCompositePath( attributeName ); }
public void addProperty(Property prop, Ejb3Column[] columns, XClass declaringClass) { //Ejb3Column.checkPropertyConsistency( ); //already called earlier /* * Check table matches between the component and the columns * if not, change the component table if no properties are set * if a property is set already the core cannot support that */ if (columns != null) { Table table = columns[0].getTable(); if ( !table.equals( component.getTable() ) ) { if ( component.getPropertySpan() == 0 ) { component.setTable( table ); } else { throw new AnnotationException( "A component cannot hold properties split into 2 different tables: " + this.getPath() ); } } } addProperty( prop, declaringClass ); }
@Override public Column[] getOverriddenColumn(String propertyName) { //FIXME this is yukky Column[] result = super.getOverriddenColumn( propertyName ); if ( result == null ) { String userPropertyName = extractUserPropertyName( "id", propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } if ( result == null ) { String userPropertyName = extractUserPropertyName( "_identifierMapper", propertyName ); if ( userPropertyName != null ) result = super.getOverriddenColumn( userPropertyName ); } return result; }
/** * build a component property holder * * @param component component to wrap * @param path component path * @param mappings * @return PropertyHolder */ public static PropertyHolder buildPropertyHolder( Component component, String path, PropertyData inferredData, PropertyHolder parent, ExtendedMappings mappings ) { return new ComponentPropertyHolder( component, path, inferredData, parent, mappings ); }
public ComponentPropertyHolder( Component component, String path, PropertyData inferredData, PropertyHolder parent, Mappings mappings) { super( path, parent, inferredData.getPropertyClass(), mappings ); final XProperty property = inferredData.getProperty(); setCurrentProperty( property ); this.component = component; this.isOrWithinEmbeddedId = parent.isOrWithinEmbeddedId() || ( property != null && ( property.isAnnotationPresent( Id.class ) || property.isAnnotationPresent( EmbeddedId.class ) ) ); }
private Map<String,AttributeConversionInfo> processAttributeConversions(XClass embeddableXClass) { final Map<String,AttributeConversionInfo> infoMap = new HashMap<>(); processAttributeConversions( embeddableXClass, infoMap ); return infoMap; }