public static String getRelativePath(PropertyHolder propertyHolder, String propertyName) { if ( propertyHolder == null ) { return propertyName; } String path = propertyHolder.getPath(); String entityName = propertyHolder.getPersistentClass().getEntityName(); if ( path.length() == entityName.length() ) { return propertyName; } else { return StringHelper.qualify( path.substring( entityName.length() + 1 ), propertyName ); } }
public static String getPath(PropertyHolder holder, PropertyData property) { return StringHelper.qualify( holder.getPath(), property.getPropertyName() ); }
/** * In case the given annotation is a value generator annotation, the corresponding value generation strategy to be * applied to the given property is returned, {@code null} otherwise. */ private <A extends Annotation> AnnotationValueGeneration<A> getValueGenerationFromAnnotation( XProperty property, A annotation) { ValueGenerationType generatorAnnotation = annotation.annotationType() .getAnnotation( ValueGenerationType.class ); if ( generatorAnnotation == null ) { return null; } Class<? extends AnnotationValueGeneration<?>> generationType = generatorAnnotation.generatedBy(); AnnotationValueGeneration<A> valueGeneration = instantiateAndInitializeValueGeneration( annotation, generationType, property ); if ( annotation.annotationType() == Generated.class && property.isAnnotationPresent( javax.persistence.Version.class ) && valueGeneration.getGenerationTiming() == GenerationTiming.INSERT ) { throw new AnnotationException( "@Generated(INSERT) on a @Version property not allowed, use ALWAYS (or NEVER): " + StringHelper.qualify( holder.getPath(), name ) ); } return valueGeneration; }
/** * Returns the value generation strategy for the given property, if any. */ private ValueGeneration getValueGenerationFromAnnotations(XProperty property) { AnnotationValueGeneration<?> valueGeneration = null; for ( Annotation annotation : property.getAnnotations() ) { AnnotationValueGeneration<?> candidate = getValueGenerationFromAnnotation( property, annotation ); if ( candidate != null ) { if ( valueGeneration != null ) { throw new AnnotationException( "Only one generator annotation is allowed:" + StringHelper.qualify( holder.getPath(), name ) ); } else { valueGeneration = candidate; } } } return valueGeneration; }
"mapped-by [%s] defined for attribute [%s] referenced an invalid property (no columns)", mappedByPropertyName, propertyHolder.getPath() "mapped-by [%s] defined for attribute [%s] referenced an invalid property (formula)", mappedByPropertyName, propertyHolder.getPath() "mapped-by [%s] defined for attribute [%s] referenced an invalid property (multiple columns)", mappedByPropertyName, propertyHolder.getPath()
MetadataBuildingContext buildingContext) { JoinColumn[] actualColumns = propertyHolder.getOverriddenJoinColumn( StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); if ( actualColumns == null ) actualColumns = anns;
private String getCondition(String cond, String name) { if ( BinderHelper.isEmptyAnnotationValue( cond ) ) { cond = buildingContext.getMetadataCollector().getFilterDefinition( name ).getDefaultFilterCondition(); if ( StringHelper.isEmpty( cond ) ) { throw new AnnotationException( "no filter condition found for filter " + name + " in " + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); } } return cond; }
throw new AnnotationException( "Exception occurred during processing of generator annotation:" + StringHelper.qualify( holder.getPath(), name ), e
+ StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
+ StringHelper.qualify( propertyHolder.getPath(), inferredData.getPropertyName() ) );
public void bind() { this.collection = createCollection( propertyHolder.getPersistentClass() ); String role = StringHelper.qualify( propertyHolder.getPath(), propertyName ); LOG.debugf( "Collection role: %s", role ); collection.setRole( role ); "Cannot mix @javax.persistence.MapKey and @MapKeyColumn or @org.hibernate.annotations.MapKey " + "on the same collection: " + StringHelper.qualify( propertyHolder.getPath(), propertyName || propertyHolder.getJoinTable( property ) != null ) ) { String message = "Associations marked as mappedBy must not define database mappings like @JoinTable or @JoinColumn: "; message += StringHelper.qualify( propertyHolder.getPath(), propertyName ); throw new AnnotationException( message ); && !property.isAnnotationPresent( JoinColumn.class )) { String message = "Unidirectional one-to-many associations annotated with @OnDelete must define @JoinColumn: "; message += StringHelper.qualify( propertyHolder.getPath(), propertyName ); throw new AnnotationException( message );
public static String getRelativePath(PropertyHolder propertyHolder, String propertyName) { if ( propertyHolder == null ) return propertyName; String path = propertyHolder.getPath(); String entityName = propertyHolder.getPersistentClass().getEntityName(); if ( path.length() == entityName.length() ) { return propertyName; } else { return StringHelper.qualify( path.substring( entityName.length() + 1 ), propertyName ); } }
public static String getPath(PropertyHolder holder, PropertyData property) { return StringHelper.qualify( holder.getPath(), property.getPropertyName() ); }
throw new AnnotationException( "@OptimisticLock.exclude=true incompatible with @Id, @EmbeddedId and @Version: " + StringHelper.qualify( holder.getPath(), name ) );
throw new AnnotationException( "Illegal use of @FilterJoinTable on an association without join table:" + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); throw new AnnotationException( "Illegal use of @FilterJoinTable on an association without join table:" + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); throw new AnnotationException( "Illegal use of @WhereJoinTable on an association without join table:" + StringHelper.qualify( propertyHolder.getPath(), propertyName ) );
String path = StringHelper.qualify( propertyHolder.getPath(), propertyName ); final ToOneFkSecondPass secondPass = new ToOneFkSecondPass( value,
javax.persistence.Column[] actualCols = anns; javax.persistence.Column[] overriddenCols = propertyHolder.getOverriddenColumn( StringHelper.qualify( propertyHolder.getPath(), inferredData.getPropertyName() ) ); if ( overriddenCols != null ) {
private String getCondition(String cond, String name) { if ( BinderHelper.isDefault( cond ) ) { cond = mappings.getFilterDefinition( name ).getDefaultFilterCondition(); if ( StringHelper.isEmpty( cond ) ) { throw new AnnotationException( "no filter condition found for filter " + name + " in " + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); } } return cond; }
StringHelper.qualify( propertyHolder.getPath(), property.getName() ) ); if ( fkOverride != null && fkOverride.value() == ConstraintMode.NO_CONSTRAINT ) {