throw new MappingException( "broken column mapping for: " + path + " of: " + getEntityName() ); AssociationType actype = (AssociationType) type; if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); columnReaders = getIdentifierColumnReaders(); columnReaderTemplates = getIdentifierColumnReaderTemplates(); addPropertyPath( path, type, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory ); initComponentPropertyPaths( path, actype, ); if ( actype.isEmbedded() ) { initComponentPropertyPaths( path == null ? null : StringHelper.qualifier( path ), actype, initIdentifierPropertyPaths( path, (EntityType) type,
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName( factory ); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath( path, EntityPersister.ENTITY_ID ); addPropertyPath( idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); initPropertyPaths( idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); } } if ( (! etype.isNullable() ) && idPropName != null ) { String idpath2 = extendPath( path, idPropName ); addPropertyPath( idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); initPropertyPaths( idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory ); } }
public String[] toColumns(final String alias, final String propertyName) throws QueryException { return super.toColumns( AbstractEntityPersister.generateTableAlias( alias, persister.getSubclassPropertyTableNumber( propertyName ) ), propertyName ); }
logDuplicateRegistration( path, existingType, type ); logDuplicateRegistration( path, existingType, type ); logDuplicateRegistration( path, existingType, type ); return; logIncompatibleRegistration( path, existingType, type ); logDuplicateRegistration( path, existingType, type ); return; commonType = getCommonType( metadata, entityType1, entityType2 ); logIncompatibleRegistration( path, existingType, type );
throw new MappingException( "broken column mapping for: " + path + " of: " + getEntityName() ); AssociationType actype = (AssociationType) type; if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); if (path!=null) addPropertyPath(path, type, columns, formulaTemplates); initComponentPropertyPaths( path, (AbstractComponentType) type, columns, formulaTemplates, factory ); initIdentifierPropertyPaths( path, (EntityType) type, columns, factory );
int begin = 0; for ( int i = 0; i < properties.length; i++ ) { String subpath = extendPath( path, properties[i] ); try { int length = types[i].getColumnSpan( factory ); String[] formulaSlice = formulaTemplates == null ? null : ArrayHelper.slice( formulaTemplates, begin, length ); initPropertyPaths( subpath, types[i],
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType(factory); if ( etype.isReferenceToPrimaryKey() ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, null); initPropertyPaths(idpath1, idtype, columns, null, factory); } String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, null); initPropertyPaths(idpath2, idtype, columns, null, factory); } }
protected final QueryException propertyException(String propertyName) throws QueryException { return new QueryException( "could not resolve property: " + propertyName + " of: " + getEntityName() ); }
throw new MappingException( "broken column mapping for: " + path + " of: " + getEntityName() ); AssociationType actype = (AssociationType) type; if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); if (path!=null) addPropertyPath(path, type, columns, formulaTemplates); initComponentPropertyPaths( path, actype, columns, formulaTemplates, factory ); if ( actype.isEmbedded() ) { initComponentPropertyPaths( path==null ? null : StringHelper.qualifier(path), actype, initIdentifierPropertyPaths( path, (EntityType) type, columns, factory );
protected void initComponentPropertyPaths( final String path, final AbstractComponentType type, final String[] columns, String[] formulaTemplates, final Mapping factory) throws MappingException { Type[] types = type.getSubtypes(); String[] properties = type.getPropertyNames(); int begin=0; for ( int i=0; i<properties.length; i++ ) { String subpath = extendPath( path, properties[i] ); try { int length = types[i].getColumnSpan(factory); String[] columnSlice = ArrayHelper.slice(columns, begin, length); String[] formulaSlice = formulaTemplates==null ? null : ArrayHelper.slice(formulaTemplates, begin, length); initPropertyPaths(subpath, types[i], columnSlice, formulaSlice, factory); begin+=length; } catch (Exception e) { throw new MappingException("bug in initComponentPropertyPaths", e); } } }
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType(factory); if ( etype.isReferenceToPrimaryKey() ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, null); initPropertyPaths(idpath1, idtype, columns, null, factory); } String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, null); initPropertyPaths(idpath2, idtype, columns, null, factory); } }
private void logIncompatibleRegistration(String path, Type existingType, Type type) { if ( LOG.isTraceEnabled() ) { LOG.tracev( "Skipped adding attribute [{1}] to base-type [{0}] as more than one sub-type defined the attribute using incompatible types (strictly speaking the attributes are not inherited); existing type = [{2}], incoming type = [{3}]", getEntityName(), path, existingType, type ); } }
throw new MappingException( "broken column mapping for: " + path + " of: " + getEntityName() ); AssociationType actype = (AssociationType) type; if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); columnReaders = getIdentifierColumnReaders(); columnReaderTemplates = getIdentifierColumnReaderTemplates(); if (path!=null) addPropertyPath(path, type, columns, columnReaders, columnReaderTemplates, formulaTemplates); initComponentPropertyPaths( path, actype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory ); if ( actype.isEmbedded() ) { initComponentPropertyPaths( path==null ? null : StringHelper.qualifier(path), actype, initIdentifierPropertyPaths( path, (EntityType) type, columns, columnReaders, columnReaderTemplates, factory );
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } } if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } }
protected void initComponentPropertyPaths( final String path, final AbstractComponentType type, final String[] columns, String[] formulaTemplates, final Mapping factory) throws MappingException { Type[] types = type.getSubtypes(); String[] properties = type.getPropertyNames(); int begin=0; for ( int i=0; i<properties.length; i++ ) { String subpath = extendPath( path, properties[i] ); try { int length = types[i].getColumnSpan(factory); String[] columnSlice = ArrayHelper.slice(columns, begin, length); String[] formulaSlice = formulaTemplates==null ? null : ArrayHelper.slice(formulaTemplates, begin, length); initPropertyPaths(subpath, types[i], columnSlice, formulaSlice, factory); begin+=length; } catch (Exception e) { throw new MappingException("bug in initComponentPropertyPaths", e); } } }
protected final void throwPropertyException(String propertyName) throws QueryException { throw new QueryException( "could not resolve property: " + propertyName + " of: " + getEntityName() ); }
public String[] toColumns(final String alias, final String propertyName) throws QueryException { return super.toColumns( persister.generateTableAlias( alias, persister.getSubclassPropertyTableNumber(propertyName) ), propertyName ); }
throw new MappingException( "broken column mapping for: " + path + " of: " + getEntityName() ); AssociationType actype = (AssociationType) type; if ( actype.useLHSPrimaryKey() ) { columns = getIdentifierColumnNames(); columnReaders = getIdentifierColumnReaders(); columnReaderTemplates = getIdentifierColumnReaderTemplates(); if (path!=null) addPropertyPath(path, type, columns, columnReaders, columnReaderTemplates, formulaTemplates); initComponentPropertyPaths( path, actype, columns, columnReaders, columnReaderTemplates, formulaTemplates, factory ); if ( actype.isEmbedded() ) { initComponentPropertyPaths( path==null ? null : StringHelper.qualifier(path), actype, initIdentifierPropertyPaths( path, (EntityType) type, columns, columnReaders, columnReaderTemplates, factory );
protected void initIdentifierPropertyPaths( final String path, final EntityType etype, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, final Mapping factory) throws MappingException { Type idtype = etype.getIdentifierOrUniqueKeyType( factory ); String idPropName = etype.getIdentifierOrUniqueKeyPropertyName(factory); boolean hasNonIdentifierPropertyNamedId = hasNonIdentifierPropertyNamedId( etype, factory ); if ( etype.isReferenceToPrimaryKey() ) { if ( !hasNonIdentifierPropertyNamedId ) { String idpath1 = extendPath(path, EntityPersister.ENTITY_ID); addPropertyPath(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath1, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } } if (idPropName!=null) { String idpath2 = extendPath(path, idPropName); addPropertyPath(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null); initPropertyPaths(idpath2, idtype, columns, columnReaders, columnReaderTemplates, null, factory); } }
protected void initComponentPropertyPaths( final String path, final CompositeType type, final String[] columns, final String[] columnReaders, final String[] columnReaderTemplates, String[] formulaTemplates, final Mapping factory) throws MappingException { Type[] types = type.getSubtypes(); String[] properties = type.getPropertyNames(); int begin=0; for ( int i=0; i<properties.length; i++ ) { String subpath = extendPath( path, properties[i] ); try { int length = types[i].getColumnSpan(factory); String[] columnSlice = ArrayHelper.slice(columns, begin, length); String[] columnReaderSlice = ArrayHelper.slice(columnReaders, begin, length); String[] columnReaderTemplateSlice = ArrayHelper.slice( columnReaderTemplates, begin, length ); String[] formulaSlice = formulaTemplates==null ? null : ArrayHelper.slice(formulaTemplates, begin, length); initPropertyPaths(subpath, types[i], columnSlice, columnReaderSlice, columnReaderTemplateSlice, formulaSlice, factory); begin+=length; } catch (Exception e) { throw new MappingException("bug in initComponentPropertyPaths", e); } } }