public Object hydrate( final ResultSet rs, final String[] names, final SessionImplementor session, final Object owner) throws HibernateException, SQLException { int begin = 0; boolean notNull = false; Object[] values = new Object[propertySpan]; for ( int i = 0; i < propertySpan; i++ ) { int length = propertyTypes[i].getColumnSpan( session.getFactory() ); String[] range = ArrayHelper.slice( names, begin, length ); //cache this Object val = propertyTypes[i].hydrate( rs, range, session, owner ); if ( val == null ) { if ( isKey ) { return null; //different nullability rules for pk/fk } } else { notNull = true; } values[i] = val; begin += length; } return notNull ? values : null; }
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 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); } } }
public Object hydrate( final ResultSet rs, final String[] names, final SessionImplementor session, final Object owner) throws HibernateException, SQLException { int begin = 0; boolean notNull = false; Object[] values = new Object[propertySpan]; for ( int i = 0; i < propertySpan; i++ ) { int length = propertyTypes[i].getColumnSpan( session.getFactory() ); String[] range = ArrayHelper.slice( names, begin, length ); //cache this Object val = propertyTypes[i].hydrate( rs, range, session, owner ); if ( val == null ) { if (isKey) return null; //different nullability rules for pk/fk } else { notNull = true; } values[i] = val; begin += length; } return notNull ? values : null; }
return ArrayHelper.slice( lhsPersister.getSubclassPropertyColumnNames(property), begin,
return ArrayHelper.slice( lhsPersister.getSubclassPropertyColumnNames(property), begin,
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
/** * Get the aliased columns of the owning entity which are to * be used in the join */ public static String[] getAliasedLHSColumnNames( AssociationType type, String alias, int property, int begin, OuterJoinLoadable lhsPersister, Mapping mapping ) { if ( type.useLHSPrimaryKey() ) { return StringHelper.qualify( alias, lhsPersister.getIdentifierColumnNames() ); } else { String propertyName = type.getLHSPropertyName(); if (propertyName==null) { return ArrayHelper.slice( lhsPersister.toColumns(alias, property), begin, type.getColumnSpan(mapping) ); } else { return ( (PropertyMapping) lhsPersister ).toColumns(alias, propertyName); //bad cast } } }
for ( int i=0; i <types.length; i++ ) { int length = types[i].getColumnSpan( getFactory() ); String[] lhsColumns = ArrayHelper.slice(cols, begin, length);
for ( int i=0; i <types.length; i++ ) { int length = types[i].getColumnSpan( getFactory() ); String[] lhsColumns = ArrayHelper.slice(cols, begin, length);