descriptor.getDomainValueResolvedType().getSignature(), conversionSite.getSiteDescriptor(), xProperty.getDeclaringClass().getName(), xProperty.getName(), xProperty.getType().getName() "Multiple auto-apply converters matched %s [%s.%s] : %s", conversionSite.getSiteDescriptor(), xProperty.getDeclaringClass().getName(), xProperty.getName(), StringHelper.join( matches, RENDERER )
private void validateLobMappingSupport(XProperty property) { // HHH-9834 - Sanity check try { if ( property.isAnnotationPresent( ElementCollection.class ) ) { if ( property.isAnnotationPresent( Lob.class ) ) { if ( !property.getCollectionClass().isAssignableFrom( Map.class ) ) { throw new MappingException( "@ElementCollection combined with @Lob is only supported for Map collection types." ); } } } } catch ( MappingException e ) { throw new HibernateException( String.format( "Invalid mapping in [%s] for property [%s]", property.getDeclaringClass().getName(), property.getName() ), e ); } }
reflectionManager.toClass( xProperty.getDeclaringClass() ) ); final ResolvedTypeWithMembers declaringClassWithMembers = classmateContext.getMemberResolver().resolve(
"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()
private void validateAllPathsEncountered(XProperty member, PathsContext updatedPathsContext, IndexedEmbedded indexedEmbeddedAnnotation) { Set<String> unEncounteredPaths = updatedPathsContext.getUnEncounteredPaths(); if ( unEncounteredPaths.size() > 0 ) { StringBuilder sb = new StringBuilder( ); String prefix = indexedEmbeddedAnnotation.prefix(); for ( String path : unEncounteredPaths ) { sb.append( removeLeadingPrefixFromPath( path, prefix ) ); sb.append( ',' ); } String invalidPaths = sb.substring( 0, sb.length() - 1 ); throw log.invalidIncludePathConfiguration( member.getName(), member.getDeclaringClass().getName(), invalidPaths ); } }
private void validateAllPathsEncountered(XProperty member, PathsContext updatedPathsContext, IndexedEmbedded indexedEmbeddedAnnotation) { Set<String> unEncounteredPaths = updatedPathsContext.getUnEncounteredPaths(); if ( unEncounteredPaths.size() > 0 ) { StringBuilder sb = new StringBuilder( ); String prefix = indexedEmbeddedAnnotation.prefix(); for ( String path : unEncounteredPaths ) { sb.append( removeLeadingPrefixFromPath( path, prefix ) ); sb.append( ',' ); } String invalidPaths = sb.substring( 0, sb.length() - 1 ); throw log.invalidIncludePathConfiguration( member.getName(), member.getDeclaringClass().getName(), invalidPaths ); } }
descriptor.getDomainValueResolvedType().getSignature(), conversionSite.getSiteDescriptor(), xProperty.getDeclaringClass().getName(), xProperty.getName(), xProperty.getType().getName() "Multiple auto-apply converters matched %s [%s.%s] : %s", conversionSite.getSiteDescriptor(), xProperty.getDeclaringClass().getName(), xProperty.getName(), StringHelper.join( matches, RENDERER )
public Builder addProperty(PropertyMetadata propertyMetadata) { if ( idPropertyMetadata != null && idPropertyMetadata.getPropertyAccessorName() != null ) { // the id property is always a single field String idFieldName = idPropertyMetadata.getFieldMetadataSet().iterator().next().getAbsoluteName(); for ( DocumentFieldMetadata fieldMetadata : propertyMetadata.getFieldMetadataSet() ) { if ( idFieldName.equals( fieldMetadata.getAbsoluteName() ) ) { throw log.fieldTriesToOverrideIdFieldSettings( propertyMetadata.getPropertyAccessor().getDeclaringClass().getName(), propertyMetadata.getPropertyAccessor().getName() ); } } } this.propertyMetadataSet.add( propertyMetadata ); return this; }
public Builder addProperty(PropertyMetadata propertyMetadata) { if ( idPropertyMetadata != null && idPropertyMetadata.getPropertyAccessorName() != null ) { // the id property is always a single field String idFieldName = idPropertyMetadata.getFieldMetadataSet().iterator().next().getAbsoluteName(); for ( DocumentFieldMetadata fieldMetadata : propertyMetadata.getFieldMetadataSet() ) { if ( idFieldName.equals( fieldMetadata.getAbsoluteName() ) ) { throw log.fieldTriesToOverrideIdFieldSettings( propertyMetadata.getPropertyAccessor().getDeclaringClass().getName(), propertyMetadata.getPropertyAccessor().getName() ); } } } this.propertyMetadataSet.add( propertyMetadata ); return this; }
private FacetEncodingType determineFacetEncodingType(XProperty member, Facet facetAnnotation) { FacetEncodingType facetEncodingType = facetAnnotation.encoding(); if ( !facetEncodingType.equals( FacetEncodingType.AUTO ) ) { return facetEncodingType; // encoding type explicitly set } Class<?> indexedType = reflectionManager.toClass( returnedType( member ) ); if ( ReflectionHelper.isIntegerType( indexedType ) ) { facetEncodingType = FacetEncodingType.LONG; } else if ( Date.class.isAssignableFrom( indexedType ) || Calendar.class.isAssignableFrom( indexedType ) ) { facetEncodingType = FacetEncodingType.LONG; } else if ( ReflectionHelper.isFloatingPointType( indexedType ) ) { facetEncodingType = FacetEncodingType.DOUBLE; } else if ( String.class.isAssignableFrom( indexedType ) ) { facetEncodingType = FacetEncodingType.STRING; } else { throw log.unsupportedFieldTypeForFaceting( indexedType.getName(), member.getDeclaringClass().getName(), member.getName() ); } return facetEncodingType; }
private FacetEncodingType determineFacetEncodingType(XProperty member, Facet facetAnnotation) { FacetEncodingType facetEncodingType = facetAnnotation.encoding(); if ( !facetEncodingType.equals( FacetEncodingType.AUTO ) ) { return facetEncodingType; // encoding type explicitly set } Class<?> indexedType = reflectionManager.toClass( returnedType( member ) ); if ( ReflectionHelper.isIntegerType( indexedType ) ) { facetEncodingType = FacetEncodingType.LONG; } else if ( Date.class.isAssignableFrom( indexedType ) || Calendar.class.isAssignableFrom( indexedType ) ) { facetEncodingType = FacetEncodingType.LONG; } else if ( ReflectionHelper.isFloatingPointType( indexedType ) ) { facetEncodingType = FacetEncodingType.DOUBLE; } else if ( String.class.isAssignableFrom( indexedType ) ) { facetEncodingType = FacetEncodingType.STRING; } else { throw log.unsupportedFieldTypeForFaceting( indexedType.getName(), member.getDeclaringClass().getName(), member.getName() ); } return facetEncodingType; }
private void validateLobMappingSupport(XProperty property) { // HHH-9834 - Sanity check try { if ( property.isAnnotationPresent( ElementCollection.class ) ) { if ( property.isAnnotationPresent( Lob.class ) ) { if ( !property.getCollectionClass().isAssignableFrom( Map.class ) ) { throw new MappingException( "@ElementCollection combined with @Lob is only supported for Map collection types." ); } } } } catch ( MappingException e ) { throw new HibernateException( String.format( "Invalid mapping in [%s] for property [%s]", property.getDeclaringClass().getName(), property.getName() ), e ); } }
private Map<String, DocumentFieldMetadata> buildFieldMetadataMap(Set<DocumentFieldMetadata> documentFieldMetadataSet) { Map<String, DocumentFieldMetadata> tmpMap = new LinkedHashMap<String, DocumentFieldMetadata>(); for ( DocumentFieldMetadata documentFieldMetadata : documentFieldMetadataSet ) { String name = documentFieldMetadata.getAbsoluteName(); if ( StringHelper.isEmpty( name ) ) { continue; } DocumentFieldMetadata oldFieldMetadata = tmpMap.put( name, documentFieldMetadata ); if ( oldFieldMetadata != null ) { if ( !documentFieldMetadata.getIndex().equals( oldFieldMetadata.getIndex() ) ) { // Try to use the actual declaring type, if possible PropertyMetadata sourceProperty = documentFieldMetadata.getSourceProperty(); String sourceTypeName = sourceProperty != null ? sourceProperty.getPropertyAccessor().getDeclaringClass().getName() : documentFieldMetadata.getSourceType().getType().getName(); log.inconsistentFieldConfiguration( sourceTypeName, name ); } } } return Collections.unmodifiableMap( tmpMap ); }
private Map<String, DocumentFieldMetadata> buildFieldMetadataMap(Set<DocumentFieldMetadata> documentFieldMetadataSet) { Map<String, DocumentFieldMetadata> tmpMap = new LinkedHashMap<String, DocumentFieldMetadata>(); for ( DocumentFieldMetadata documentFieldMetadata : documentFieldMetadataSet ) { String name = documentFieldMetadata.getAbsoluteName(); if ( StringHelper.isEmpty( name ) ) { continue; } DocumentFieldMetadata oldFieldMetadata = tmpMap.put( name, documentFieldMetadata ); if ( oldFieldMetadata != null ) { if ( !documentFieldMetadata.getIndex().equals( oldFieldMetadata.getIndex() ) ) { // Try to use the actual declaring type, if possible PropertyMetadata sourceProperty = documentFieldMetadata.getSourceProperty(); String sourceTypeName = sourceProperty != null ? sourceProperty.getPropertyAccessor().getDeclaringClass().getName() : documentFieldMetadata.getSourceType().getType().getName(); log.inconsistentFieldConfiguration( sourceTypeName, name ); } } } return Collections.unmodifiableMap( tmpMap ); }
reflectionManager.toClass( xProperty.getDeclaringClass() ) ); final ResolvedTypeWithMembers declaringClassWithMembers = classmateContext.getMemberResolver().resolve(
final XClass declaringClazz = property.getDeclaringClass(); final ComponentAuditingData auditingData = (ComponentAuditingData) auditedPropertiesHolder;
throw new IllegalStateException( "No javax.persistence.TemporalType defined for @javax.persistence.Temporal " + "associated with attribute " + attributeDescriptor.getDeclaringClass().getName() + '.' + attributeDescriptor.getName() ); throw new IllegalStateException( "javax.persistence.EnumType was null on @javax.persistence.Enumerated " + " associated with attribute " + attributeDescriptor.getDeclaringClass().getName() + '.' + attributeDescriptor.getName() );
throw new IllegalStateException( "javax.persistence.EnumType was null on @javax.persistence.MapKeyEnumerated " + " associated with attribute " + mapAttribute.getDeclaringClass().getName() + '.' + mapAttribute.getName() );
throw new IllegalStateException( "No javax.persistence.TemporalType defined for @javax.persistence.Temporal " + "associated with attribute " + attributeDescriptor.getDeclaringClass().getName() + '.' + attributeDescriptor.getName() ); throw new IllegalStateException( "javax.persistence.EnumType was null on @javax.persistence.Enumerated " + " associated with attribute " + attributeDescriptor.getDeclaringClass().getName() + '.' + attributeDescriptor.getName() );
throw log.attemptToFacetOnAnalyzedField( fieldPath.getAbsoluteName(), member.getDeclaringClass().getName() );