public Type[] getReturnTypes() { return selectClause.getQueryReturnTypes(); }
public void validateTypes(SelectClause selectClause) throws QueryException { Type[] selectTypes = selectClause.getQueryReturnTypes(); if ( selectTypes.length + selectClause.getTotalParameterCount() != types.length ) { throw new QueryException( "number of select types did not match those for insert" ); } int parameterCount = 0; for ( int i = 0; i < types.length; i++ ) { if ( selectClause.getParameterPositions().contains( i ) ) { parameterCount++; } else if ( !areCompatible( types[i], selectTypes[i - parameterCount] ) ) { throw new QueryException( "insertion type [" + types[i] + "] and selection type [" + selectTypes[i - parameterCount] + "] at position " + i + " are not compatible" ); } } // otherwise, everything ok. }
scalarColumnNames = selectClause.getColumnNames(); queryReturnTypes = selectClause.getQueryReturnTypes();
public Type[] getReturnTypes() { return selectClause.getQueryReturnTypes(); }
public Type[] getReturnTypes() { return selectClause.getQueryReturnTypes(); }
public void validateTypes(SelectClause selectClause) throws QueryException { Type[] selectTypes = selectClause.getQueryReturnTypes(); if ( selectTypes.length != types.length ) { throw new QueryException( "number of select types did not match those for insert" ); } for ( int i = 0; i < types.length; i++ ) { if ( !areCompatible( types[i], selectTypes[i] ) ) { throw new QueryException( "insertion type [" + types[i] + "] and selection type [" + selectTypes[i] + "] at position " + i + " are not compatible" ); } } // otherwise, everything ok. }
public void validateTypes(SelectClause selectClause) throws QueryException { Type[] selectTypes = selectClause.getQueryReturnTypes(); if ( selectTypes.length != types.length ) { throw new QueryException( "number of select types did not match those for insert" ); } for ( int i = 0; i < types.length; i++ ) { if ( !areCompatible( types[i], selectTypes[i] ) ) { throw new QueryException( "insertion type [" + types[i] + "] and selection type [" + selectTypes[i] + "] at position " + i + " are not compatible" ); } } // otherwise, everything ok. }
public OgmQueryLoader(QueryTranslatorImpl queryTranslator, SessionFactoryImplementor factory, SelectClause selectClause, BackendQuery<?> query, List<String> scalarColumns) { super( queryTranslator, factory, selectClause ); this.loaderContext = getLoaderContext( query, factory ); this.hasScalars = selectClause.isScalarSelect(); this.scalarColumns = scalarColumns; this.queryReturnTypes = selectClause.getQueryReturnTypes(); this.typeTranslator = factory.getServiceRegistry().getService( TypeTranslator.class ); }
@Override protected void doCompile(Map replacements, boolean shallow) throws QueryException, MappingException { try { // Unfortunately, we cannot obtain the select clause from the delegate, so we need to parse it again selectClause = getSelectClause( replacements, null ); Type[] queryReturnTypes = selectClause.getQueryReturnTypes(); singleEntityMetadataInformation = determineSingleEntityInformation( queryReturnTypes ); } catch ( Exception qse ) { throw log.querySyntaxException( qse, query ); } if ( queryParser.supportsParameters() ) { loader = getLoader( null ); } }
QueryNode queryNode = getField(translator, "sqlAst"); SelectClause selectClause = queryNode.getSelectClause(); Type[] queryReturnTypes = selectClause.getQueryReturnTypes();
scalarColumnNames = selectClause.getColumnNames(); queryReturnTypes = selectClause.getQueryReturnTypes();
scalarColumnNames = selectClause.getColumnNames(); queryReturnTypes = selectClause.getQueryReturnTypes();