/** * Returns true if the from node contains the class alias name. * * @param alias The HQL class alias name. * * @return true if the from node contains the class alias name. */ public boolean containsClassAlias(String alias) { boolean isAlias = fromElementByClassAlias.containsKey( alias ); if ( !isAlias && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { isAlias = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( alias ) != null; } return isAlias; }
/** * Retrieve the from-element represented by the given alias. * * @param aliasOrClassName The alias by which to locate the from-element. * * @return The from-element assigned the given alias, or null if none. */ public FromElement getFromElement(String aliasOrClassName) { FromElement fromElement = fromElementByClassAlias.get( aliasOrClassName ); if ( fromElement == null && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { fromElement = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( aliasOrClassName ); } if ( fromElement == null && parentFromClause != null ) { fromElement = parentFromClause.getFromElement( aliasOrClassName ); } return fromElement; }
@Override protected AST generatePositionalParameter(AST delimiterNode, AST numberNode) throws SemanticException { if ( getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() && namedParameters != null ) { throw new SemanticException( "Cannot mix positional and named parameters: " + queryTranslatorImpl.getQueryString()
@Override protected AST generateNamedParameter(AST delimiterNode, AST nameNode) throws SemanticException { if ( getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() && positionalParameters != null ) { throw new SemanticException( "Cannot mix positional and named parameters: " + queryTranslatorImpl.getQueryString() ); } final String name = nameNode.getText(); trackNamedParameterPositions( name ); // create the node initially with the param name so that it shows // appropriately in the "original text" attribute final ParameterNode parameter = (ParameterNode) astFactory.create( NAMED_PARAM, name ); parameter.setText( "?" ); final NamedParameterSpecification paramSpec = new NamedParameterSpecification( delimiterNode.getLine(), delimiterNode.getColumn(), name ); parameter.setHqlParameterSpecification( paramSpec ); parameterSpecs.add( paramSpec ); return parameter; }
/** * Returns true if the from node contains the class alias name. * * @param alias The HQL class alias name. * @return true if the from node contains the class alias name. */ public boolean containsClassAlias(String alias) { boolean isAlias = fromElementByClassAlias.containsKey( alias ); if ( !isAlias && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { isAlias = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( alias ) != null; } return isAlias; }
/** * Returns true if the from node contains the class alias name. * * @param alias The HQL class alias name. * @return true if the from node contains the class alias name. */ public boolean containsClassAlias(String alias) { boolean isAlias = fromElementByClassAlias.containsKey( alias ); if ( !isAlias && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { isAlias = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( alias ) != null; } return isAlias; }
/** * Retreives the from-element represented by the given alias. * * @param aliasOrClassName The alias by which to locate the from-element. * @return The from-element assigned the given alias, or null if none. */ public FromElement getFromElement(String aliasOrClassName) { FromElement fromElement = ( FromElement ) fromElementByClassAlias.get( aliasOrClassName ); if ( fromElement == null && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { fromElement = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( aliasOrClassName ); } if ( fromElement == null && parentFromClause != null ) { fromElement = parentFromClause.getFromElement( aliasOrClassName ); } return fromElement; }
/** * Retreives the from-element represented by the given alias. * * @param aliasOrClassName The alias by which to locate the from-element. * @return The from-element assigned the given alias, or null if none. */ public FromElement getFromElement(String aliasOrClassName) { FromElement fromElement = ( FromElement ) fromElementByClassAlias.get( aliasOrClassName ); if ( fromElement == null && getSessionFactoryHelper().isStrictJPAQLComplianceEnabled() ) { fromElement = findIntendedAliasedFromElementBasedOnCrazyJPARequirements( aliasOrClassName ); } if ( fromElement == null && parentFromClause != null ) { fromElement = parentFromClause.getFromElement( aliasOrClassName ); } return fromElement; }