Anthony Ogier commented on Bug HHH-7881

The problem seems to come from that calling stack :
org.hibernate.hql.internal.ast.tree.DotNode.getColumns()
+ org.hibernate.hql.internal.ast.tree.FromElementType.toColumns(String, String, boolean, boolean)
+ org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(String, String)
+ org.hibernate.persister.entity.AbstractPropertyMapping.toColumns(String, String)

And here is the code of that last call :

public String[] toColumns(String alias, String propertyName) throws QueryException {
		//TODO: *two* hashmap lookups here is one too many...
		String[] columns = (String[]) columnsByPropertyPath.get(propertyName);
		if ( columns == null ) {
			throw propertyException( propertyName );
		}
		String[] formulaTemplates = (String[]) formulaTemplatesByPropertyPath.get(propertyName);
		String[] columnReaderTemplates = (String[]) columnReaderTemplatesByPropertyPath.get(propertyName);
		String[] result = new String[columns.length];
		for ( int i=0; i<columns.length; i++ ) {
			if ( columnReaderTemplates[i]==null ) {
				result[i] = StringHelper.replace( formulaTemplates[i], Template.TEMPLATE, alias );
			}
			else {
				result[i] = StringHelper.replace( columnReaderTemplates[i], Template.TEMPLATE, alias );
			}
		}
		return result;
	}

Here formulaTemplates contains a template String, but columnReaderTemplates contains nothing... in a more general point of view, I think that architecture is a bit complex no ?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira