Tabnine Logo
org.hibernate.hql.internal.ast.tree
Code IndexAdd Tabnine to your IDE (free)

How to use org.hibernate.hql.internal.ast.tree

Best Java code snippets using org.hibernate.hql.internal.ast.tree (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

private Type prepareLhs() throws SemanticException {
  FromReferenceNode lhs = getLhs();
  lhs.prepareForDot( propertyName );
  return getDataType();
}
origin: hibernate/hibernate-orm

private Type[] resolveConstructorArgumentTypes() throws SemanticException {
  SelectExpression[] argumentExpressions = collectSelectExpressions();
  if ( argumentExpressions == null ) {
    // return an empty Type array
    return new Type[] {};
  }
  Type[] types = new Type[argumentExpressions.length];
  for ( int x = 0; x < argumentExpressions.length; x++ ) {
    types[x] = argumentExpressions[x].getDataType();
  }
  return types;
}
origin: hibernate/hibernate-orm

@Override
protected AST createFromElement(String path, AST alias, AST propertyFetch) throws SemanticException {
  FromElement fromElement = currentFromClause.addFromElement( path, alias );
  fromElement.setAllPropertyFetch( propertyFetch != null );
  return fromElement;
}
origin: hibernate/hibernate-orm

private String[] getColumns() throws QueryException {
  if ( columns == null ) {
    // Use the table fromElement and the property name to get the array of column names.
    String tableAlias = getLhs().getFromElement().getTableAlias();
    columns = getFromElement().toColumns( tableAlias, propertyPath, false );
  }
  return columns;
}
origin: hibernate/hibernate-orm

private FromElement initializeJoin(
    String path,
    FromElement destination,
    JoinSequence joinSequence,
    String[] columns,
    FromElement origin,
    boolean manyToMany) {
  destination.setType( JOIN_FRAGMENT );
  destination.setJoinSequence( joinSequence );
  destination.setColumns( columns );
  destination.setOrigin( origin, manyToMany );
  fromClause.addJoinByPathMap( path, destination );
  return destination;
}
origin: hibernate/hibernate-orm

@SuppressWarnings("SimplifiableIfStatement")
private boolean isReturnableEntity(SelectExpression selectExpression) throws SemanticException {
  FromElement fromElement = selectExpression.getFromElement();
  boolean isFetchOrValueCollection = fromElement != null &&
      ( fromElement.isFetch() || fromElement.isCollectionOfValuesOrComponents() );
  if ( isFetchOrValueCollection ) {
    return false;
  }
  else {
    return selectExpression.isReturnableEntity();
  }
}
origin: hibernate/hibernate-orm

  private boolean checkSubclassOrSuperclassPropertyReference(FromReferenceNode lhs, String propertyName) {
    if ( lhs != null && !( lhs instanceof IndexNode ) ) {
      final FromElement source = lhs.getFromElement();
      if ( source != null ) {
        source.handlePropertyBeingDereferenced( lhs.getDataType(), propertyName );
      }
    }
    return false;
  }
}
origin: hibernate/hibernate-orm

/**
 * Retrieve this insert statement's select-clause.
 *
 * @return The select-clause.
 */
public SelectClause getSelectClause() {
  return ( (QueryNode) getIntoClause().getNextSibling() ).getSelectClause();
}
origin: hibernate/hibernate-orm

@Override
public Type getDataType() {
  return ( (SelectExpression) getSelectClause().getFirstSelectExpression() ).getDataType();
}
origin: hibernate/hibernate-orm

private String collectionTableAlias() {
  return getFromElement().getCollectionTableAlias() != null
      ? getFromElement().getCollectionTableAlias()
      : getFromElement().getTableAlias();
}
origin: hibernate/hibernate-orm

/**
 * Performs detailed semantic validation on this insert statement tree.
 *
 * @throws QueryException Indicates validation failure.
 */
public void validate() throws QueryException {
  getIntoClause().validateTypes( getSelectClause() );
}
origin: hibernate/hibernate-orm

/**
 * Figure out the type of the binary expression by looking at
 * the types of the operands. Sometimes we don't know both types,
 * if, for example, one is a parameter.
 */
@Override
public Type getDataType() {
  if ( super.getDataType() == null ) {
    super.setDataType( resolveDataType() );
  }
  return super.getDataType();
}
origin: hibernate/hibernate-orm

private static Type extractDataType(Node operand) {
  if ( operand instanceof SqlNode ) {
    return ( (SqlNode) operand ).getDataType();
  }
  if ( operand instanceof ExpectedTypeAwareNode ) {
    return ( (ExpectedTypeAwareNode) operand ).getExpectedType();
  }
  return null;
}
origin: hibernate/hibernate-orm

private void renderScalarSelects(SelectExpression[] se, FromClause currentFromClause) throws SemanticException {
  if ( !currentFromClause.isSubQuery() ) {
    for ( int i = 0; i < se.length; i++ ) {
      SelectExpression expr = se[i];
      expr.setScalarColumn( i );    // Create SQL_TOKEN nodes for the columns.
    }
  }
}
origin: hibernate/hibernate-orm

public void initializeEntity(
    FromClause fromClause,
    String className,
    EntityPersister persister,
    EntityType type,
    String classAlias,
    String tableAlias) {
  doInitialize( fromClause, tableAlias, className, classAlias, persister, type );
  this.sequence = fromClause.nextFromElementCounter();
  initialized = true;
}
origin: hibernate/hibernate-orm

@Override
public void setScalarColumn(int i) throws SemanticException {
  SelectExpression[] selectExpressions = collectSelectExpressions();
  // Invoke setScalarColumnText on each constructor argument.
  for ( int j = 0; j < selectExpressions.length; j++ ) {
    SelectExpression selectExpression = selectExpressions[j];
    selectExpression.setScalarColumn( j );
  }
}
origin: hibernate/hibernate-orm

private void initAliases(SelectExpression[] selectExpressions) {
  if ( aggregatedSelectExpression == null ) {
    aliases = new String[selectExpressions.length];
    for ( int i = 0; i < selectExpressions.length; i++ ) {
      aliases[i] = selectExpressions[i].getAlias();
    }
  }
  else {
    aliases = aggregatedSelectExpression.getAggregatedAliases();
  }
}
origin: hibernate/hibernate-orm

@Override
public void setText(String s) {
  if ( isResolved() ) {
    return;
  }
  super.setText( s );
}
origin: hibernate/hibernate-orm

@Override
public void setScalarColumnText(int i) throws SemanticException {
  SelectExpression[] selectExpressions = collectSelectExpressions();
  // Invoke setScalarColumnText on each constructor argument.
  for ( int j = 0; j < selectExpressions.length; j++ ) {
    SelectExpression selectExpression = selectExpressions[j];
    selectExpression.setScalarColumnText( j );
  }
}
origin: hibernate/hibernate-orm

protected Type extractDataType(Node operand) {
  Type type = null;
  if ( operand instanceof SqlNode ) {
    type = ( (SqlNode) operand ).getDataType();
  }
  if ( type == null && operand instanceof ExpectedTypeAwareNode ) {
    type = ( (ExpectedTypeAwareNode) operand ).getExpectedType();
  }
  return type;
}
org.hibernate.hql.internal.ast.tree

Most used classes

  • FromElement
    Represents a single mapped class mentioned in an HQL FROM clause. Each class reference will have the
  • FromClause
    Represents the 'FROM' part of a query or subquery, containing all mapped class references.
  • AssignmentSpecification
    Encapsulates the information relating to an individual assignment within the set clause of an HQL up
  • UpdateStatement
    Defines a top-level AST node representing an HQL update statement.
  • DotNode
    Represents a reference to a property or alias expression. This should duplicate the relevant behavio
  • QueryNode,
  • SelectClause,
  • BooleanLiteralNode,
  • IdentNode,
  • Node,
  • ParameterNode,
  • SqlNode,
  • Statement,
  • AbstractMapComponentNode,
  • AbstractNullnessCheckNode,
  • AbstractRestrictableStatement,
  • AbstractSelectExpression,
  • AbstractStatement,
  • AggregateNode
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now