public XProperty getProperty() { return wrappedInferredData.getProperty(); }
MetadataBuildingContext context) { super( path, parent, inferredData.getPropertyClass(), context ); final XProperty embeddedXProperty = inferredData.getProperty(); setCurrentProperty( embeddedXProperty ); this.component = component;
XProperty idXProperty = inferredData.getProperty();
XProperty property = inferredData.getProperty(); setupComponentTuplizer( property, componentId ); value.setPersistentClassName( persistentClassName ); value.setBuildingContext( buildingContext ); value.setType( inferredData.getProperty(), inferredData.getClassOrElement(), persistentClassName, null ); value.setAccessType( propertyAccessor ); id = value.make(); SecondPass secondPass = new IdGeneratorResolverSecondPass( id, inferredData.getProperty(), generatorType, generatorName, BinderHelper.makeIdGenerator( id, inferredData.getProperty(), generatorType, generatorName, binder.setValue( id ); binder.setAccessType( inferredData.getDefaultAccess() ); binder.setProperty( inferredData.getProperty() ); Property prop = binder.makeProperty(); rootClass.setIdentifierProperty( prop );
AnyMetaDef metaAnnDef = inferredData.getProperty().getAnnotation( AnyMetaDef.class ); bindAnyMetaDefs( inferredData.getProperty(), context );
propertyHolder.startingProperty( inferredData.getProperty() ); ); final boolean hasXToOneAnnotation = entityPropertyData.getProperty() .isAnnotationPresent( ManyToOne.class ) || entityPropertyData.getProperty().isAnnotationPresent( OneToOne.class ); final boolean isOfDifferentType = !entityPropertyData.getClassOrElement() .equals( idClassPropertyData.getClassOrElement() ); ); XProperty property = propertyAnnotatedElement.getProperty(); if ( property.isAnnotationPresent( GeneratedValue.class ) && property.isAnnotationPresent( Id.class ) ) {
/** * useful to override a column either by @MapsId or by @IdClass */ Ejb3Column[] buildExcplicitOrDefaultJoinColumn(PropertyData overridingProperty) { Ejb3Column[] result; result = buildExplicitJoinColumns( overridingProperty.getProperty(), overridingProperty ); if (result == null) { result = buildDefaultJoinColumnsForXToOne( overridingProperty.getProperty(), overridingProperty); } return result; } }
if ( propertyData.getPropertyName().equals( property.getName() ) ) { Id incomingIdProperty = property.getAnnotation( Id.class ); Id existingIdProperty = propertyData.getProperty().getAnnotation( Id.class ); if ( incomingIdProperty != null && existingIdProperty == null ) { throw new MappingException( String.format( "You cannot override the [%s] non-identifier property from the [%s] base class or @MappedSuperclass and make it an identifier in the [%s] subclass!", propertyData.getProperty().getName(), propertyData.getProperty().getDeclaringClass().getName(), property.getDeclaringClass().getName() final XAnnotatedElement element = propertyAnnotatedElement.getProperty(); if ( element.isAnnotationPresent( Id.class ) || element.isAnnotationPresent( EmbeddedId.class ) ) { inFlightPropertyDataList.add( 0, propertyAnnotatedElement );
final XProperty property = inferredData.getProperty(); if ( property.isAnnotationPresent( Parent.class ) ) { if ( propertyHolder.isComponent() ) { boolean ignoreNotFound = notFound != null && notFound.action().equals( NotFoundAction.IGNORE ); collectionBinder.setIgnoreNotFound( ignoreNotFound ); collectionBinder.setCollectionType( inferredData.getProperty().getElementClass() ); collectionBinder.setBuildingContext( context ); collectionBinder.setAccessType( inferredData.getDefaultAccess() );
@Override public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { if ( propertiesAnnotatedWithMapsId == null ) { propertiesAnnotatedWithMapsId = new HashMap<>(); } Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
&& !inferredData.getProperty().isArray() ) { column.setNullable( false );
public static XClass getTargetEntity(PropertyData propertyData, MetadataBuildingContext buildingContext) { XProperty property = propertyData.getProperty(); return buildingContext.getBootstrapContext().getReflectionManager().toXClass( getTargetEntityClass( property ) ); }
XProperty property = inferredData.getProperty(); setupComponentTuplizer( property, comp ); PropertyBinder binder = new PropertyBinder(); binder.setName( inferredData.getPropertyName() ); binder.setValue( comp ); binder.setProperty( inferredData.getProperty() ); binder.setAccessType( inferredData.getDefaultAccess() ); binder.setEmbedded( isComponentEmbedded );
private static void applyColumnDefault(Ejb3Column column, PropertyData inferredData) { final XProperty xProperty = inferredData.getProperty(); if ( xProperty != null ) { ColumnDefault columnDefaultAnn = xProperty.getAnnotation( ColumnDefault.class ); if ( columnDefaultAnn != null ) { column.setDefaultValue( columnDefaultAnn.value() ); } } else { LOG.trace( "Could not perform @ColumnDefault lookup as 'PropertyData' did not give access to XProperty" ); } }
boolean isIdentifierMapper, MetadataBuildingContext buildingContext) { org.hibernate.annotations.Any anyAnn = inferredData.getProperty() .getAnnotation( org.hibernate.annotations.Any.class ); if ( anyAnn == null ) {
public Boolean hasIdClassOrEmbeddedId() { if ( hasIdClassOrEmbeddedId == null ) { hasIdClassOrEmbeddedId = false; if ( getClassWithIdClass( true ) != null ) { hasIdClassOrEmbeddedId = true; } else { final ElementsToProcess process = getElementsToProcess(); for ( PropertyData property : process.getElements() ) { if ( property.getProperty().isAnnotationPresent( EmbeddedId.class ) ) { hasIdClassOrEmbeddedId = true; break; } } } } return hasIdClassOrEmbeddedId; }
String referencedEntityName = ToOneBinder.getReferenceEntityName( inferredData, targetEntity, buildingContext ); value.setReferencedEntityName( referencedEntityName ); AnnotationBinder.defineFetchingStrategy( value, inferredData.getProperty() ); AnnotationBinder.bindForeignKeyNameAndDefinition( value, inferredData.getProperty(), inferredData.getProperty().getAnnotation( javax.persistence.ForeignKey.class ), inferredData.getProperty().getAnnotation( JoinColumn.class ), inferredData.getProperty().getAnnotation( JoinColumns.class ) ); binder.setAccessType( inferredData.getDefaultAccess() ); final LazyGroup lazyGroupAnnotation = inferredData.getProperty().getAnnotation( LazyGroup.class ); if ( lazyGroupAnnotation != null ) { binder.setLazyGroup( lazyGroupAnnotation.value() );
private void extractDataFromPropertyData(PropertyData inferredData) { if ( inferredData != null ) { XProperty property = inferredData.getProperty(); if ( property != null ) { processExpression( property.getAnnotation( ColumnTransformer.class ) ); ColumnTransformers annotations = property.getAnnotation( ColumnTransformers.class ); if (annotations != null) { for ( ColumnTransformer annotation : annotations.value() ) { processExpression( annotation ); } } } } }
final XProperty property = inferredData.getProperty(); defineFetchingStrategy( value, property );
final XProperty property = idPropertyOnBaseClass.getProperty(); return property.isAnnotationPresent( ManyToOne.class ) || property.isAnnotationPresent( OneToOne.class );