public ConverterDescriptor mapKeyAttributeConverterDescriptor(XProperty mapXProperty, XClass keyXClass) { AttributeConversionInfo info = locateAttributeConversionInfo( "key" ); if ( info != null ) { if ( info.isConversionDisabled() ) { return null; } else { try { return makeAttributeConverterDescriptor( info ); } catch (Exception e) { throw buildExceptionFromInstantiationError( info, e ); } } } log.debugf( "Attempting to locate auto-apply AttributeConverter for collection key [%s]", collection.getRole() ); // todo : do we need to pass along `XClass keyXClass`? return getContext().getMetadataCollector() .getAttributeConverterAutoApplyHandler() .findAutoApplyConverterForMapKey( mapXProperty, getContext() ); }
public ConverterDescriptor resolveElementAttributeConverterDescriptor(XProperty collectionXProperty, XClass elementXClass) { AttributeConversionInfo info = locateAttributeConversionInfo( "element" ); if ( info != null ) { if ( info.isConversionDisabled() ) { return null; } else { try { return makeAttributeConverterDescriptor( info ); } catch (Exception e) { throw buildExceptionFromInstantiationError( info, e ); } } } log.debugf( "Attempting to locate auto-apply AttributeConverter for collection element [%s]", collection.getRole() ); // todo : do we need to pass along `XClass elementXClass`? return getContext().getMetadataCollector() .getAttributeConverterAutoApplyHandler() .findAutoApplyConverterForCollectionElement( collectionXProperty, getContext() ); }
private Class determineElementClass(XClass elementXClass) { if ( elementXClass != null ) { try { return getContext().getBootstrapContext().getReflectionManager().toClass( elementXClass ); } catch (Exception e) { log.debugf( "Unable to resolve XClass [%s] to Class for collection elements [%s]", elementXClass.getName(), collection.getRole() ); } } if ( collection.getElement() != null ) { if ( collection.getElement().getType() != null ) { return collection.getElement().getType().getReturnedClass(); } } // currently this is called from paths where the element type really should be known, // so log the fact that we could not resolve the collection element info log.debugf( "Unable to resolve element information for collection [%s]", collection.getRole() ); return null; }
private Class determineKeyClass(XClass keyXClass) { if ( keyXClass != null ) { try { return getContext().getBootstrapContext().getReflectionManager().toClass( keyXClass ); } catch (Exception e) { log.debugf( "Unable to resolve XClass [%s] to Class for collection key [%s]", keyXClass.getName(), collection.getRole() ); } } final IndexedCollection indexedCollection = (IndexedCollection) collection; if ( indexedCollection.getIndex() != null ) { if ( indexedCollection.getIndex().getType() != null ) { return indexedCollection.getIndex().getType().getReturnedClass(); } } // currently this is called from paths where the element type really should be known, // so log the fact that we could not resolve the collection element info log.debugf( "Unable to resolve key information for collection [%s]", collection.getRole() ); return null; } }
public ConverterDescriptor mapKeyAttributeConverterDescriptor(XProperty mapXProperty, XClass keyXClass) { AttributeConversionInfo info = locateAttributeConversionInfo( "key" ); if ( info != null ) { if ( info.isConversionDisabled() ) { return null; } else { try { return makeAttributeConverterDescriptor( info ); } catch (Exception e) { throw buildExceptionFromInstantiationError( info, e ); } } } log.debugf( "Attempting to locate auto-apply AttributeConverter for collection key [%s]", collection.getRole() ); // todo : do we need to pass along `XClass keyXClass`? return getContext().getMetadataCollector() .getAttributeConverterAutoApplyHandler() .findAutoApplyConverterForMapKey( mapXProperty, getContext() ); }
public ConverterDescriptor resolveElementAttributeConverterDescriptor(XProperty collectionXProperty, XClass elementXClass) { AttributeConversionInfo info = locateAttributeConversionInfo( "element" ); if ( info != null ) { if ( info.isConversionDisabled() ) { return null; } else { try { return makeAttributeConverterDescriptor( info ); } catch (Exception e) { throw buildExceptionFromInstantiationError( info, e ); } } } log.debugf( "Attempting to locate auto-apply AttributeConverter for collection element [%s]", collection.getRole() ); // todo : do we need to pass along `XClass elementXClass`? return getContext().getMetadataCollector() .getAttributeConverterAutoApplyHandler() .findAutoApplyConverterForCollectionElement( collectionXProperty, getContext() ); }
private Class determineElementClass(XClass elementXClass) { if ( elementXClass != null ) { try { return getContext().getBootstrapContext().getReflectionManager().toClass( elementXClass ); } catch (Exception e) { log.debugf( "Unable to resolve XClass [%s] to Class for collection elements [%s]", elementXClass.getName(), collection.getRole() ); } } if ( collection.getElement() != null ) { if ( collection.getElement().getJavaTypeMapping() != null ) { return collection.getElement().getJavaTypeMapping().getJavaTypeDescriptor().getJavaType(); } } // currently this is called from paths where the element type really should be known, // so log the fact that we could not resolve the collection element info log.debugf( "Unable to resolve element information for collection [%s]", collection.getRole() ); return null; }