Top Description Inners Fields Constructors Methods
org.hibernate.hql.internal.ast.tree

public Class MapEntryNode

extends AbstractMapComponentNode
implements AggregatedSelectExpression
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression, org.hibernate.hql.internal.ast.tree.SelectExpression
Imports
java.util.ArrayList, .Iterator, .List, .Map, antlr.collections.AST, org.hibernate.HibernateException, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.hql.internal.NameGenerator, org.hibernate.persister.collection.QueryableCollection, org.hibernate.persister.entity.Queryable, org.hibernate.sql.AliasGenerator, .SelectExpression, .SelectFragment, org.hibernate.transform.BasicTransformerAdapter, .ResultTransformer, org.hibernate.type.EntityType, .Type, antlr.SemanticException

Tree node representing reference to the entry (Map.Entry) of a Map association.
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final String[]
private MapEntryNode.MapEntryBuilder
private int
private List<E>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
appendSelectExpressions(String[] columnNames, List<E> selections, AliasGenerator aliasGenerator)

private void
appendSelectExpressions(SelectFragment fragment, List<E> selections, AliasGenerator aliasGenerator)

private String
private void
determineKeySelectExpressions(QueryableCollection collectionPersister, List<E> selections)

private void
determineValueSelectExpressions(QueryableCollection collectionPersister, List<E> selections)

private String
protected String
public String[]
getAggregatedAliases()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregatedAliases.

Retrieve the aliases for the columns aggregated here.
public List<E>
public Class<T>
public ResultTransformer
getResultTransformer()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getResultTransformer.

Retrieve the ResultTransformer responsible for building aggregated select expression results into their aggregated form.
public int
public boolean
public void
resolve(boolean generateJoin, boolean implicitJoin, String classAlias, AST parent, AST parentPredicate)

Overrides org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.resolve.

Implements org.hibernate.hql.internal.ast.tree.ResolvableNode.resolve.

Does the work of resolving an identifier or a dot
protected String[]
protected Type
public void
setScalarColumn(int
The index of the select expression in the projection list.
i
)

Overrides org.hibernate.hql.internal.ast.tree.AbstractSelectExpression.setScalarColumn.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Sets the index and text for select expression in the projection list.
public void
setScalarColumnText(int
The index of the select expression in the projection list.
i
)

Overrides org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.setScalarColumnText.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Appends AST nodes that represent the columns after the current AST node.
public void
public SessionFactoryImplementor
sfi()

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Inherited from org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode:
findOrAddMapKeyEntityFromElementgetColumnsgetMapFromElementgetMapReferencegetReferencedTablesnonMapresolveIndex

Field Detail

ALIASESback to summary
private static final String[] ALIASES
mapEntryBuilderback to summary
private MapEntryNode.MapEntryBuilder mapEntryBuilder
scalarColumnIndexback to summary
private int scalarColumnIndex

Hides org.hibernate.hql.internal.ast.tree.AbstractSelectExpression.scalarColumnIndex.

typesback to summary
private List<E> types

Constructor Detail

MapEntryNodeback to summary
public MapEntryNode()

Method Detail

appendSelectExpressionsback to summary
private void appendSelectExpressions(String[] columnNames, List<E> selections, AliasGenerator aliasGenerator)
Annotations
@SuppressWarnings:unchecked, ForLoopReplaceableByForEach
appendSelectExpressionsback to summary
private void appendSelectExpressions(SelectFragment fragment, List<E> selections, AliasGenerator aliasGenerator)
Annotations
@SuppressWarnings:unchecked, WhileLoopReplaceableByForEach
collectionTableAliasback to summary
private String collectionTableAlias()
determineKeySelectExpressionsback to summary
private void determineKeySelectExpressions(QueryableCollection collectionPersister, List<E> selections)
determineValueSelectExpressionsback to summary
private void determineValueSelectExpressions(QueryableCollection collectionPersister, List<E> selections)
elementTableAliasback to summary
private String elementTableAlias()
expressionDescriptionback to summary
protected String expressionDescription()

Implements abstract org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.expressionDescription.

Annotations
@Override
getAggregatedAliasesback to summary
public String[] getAggregatedAliases()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregatedAliases.

Doc from org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregatedAliases.

Retrieve the aliases for the columns aggregated here.

Returns:String[]

The column aliases.

Annotations
@Override
getAggregatedSelectionTypeListback to summary
public List<E> getAggregatedSelectionTypeList()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregatedSelectionTypeList.

Doc from org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregatedSelectionTypeList.

Retrieves a list of the selection types being aggregated

Returns:List<E>

The list of types.

Annotations
@Override
getAggregationResultTypeback to summary
public Class<T> getAggregationResultType()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregationResultType.

Doc from org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getAggregationResultType.

Obtain the java type of the aggregation

Returns:Class<T>

The java type.

Annotations
@Override
getResultTransformerback to summary
public ResultTransformer getResultTransformer()

Implements org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getResultTransformer.

Doc from org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression.getResultTransformer.

Retrieve the ResultTransformer responsible for building aggregated select expression results into their aggregated form.

Returns:ResultTransformer

The appropriate transformer

Annotations
@Override
getScalarColumnIndexback to summary
public int getScalarColumnIndex()

Overrides org.hibernate.hql.internal.ast.tree.AbstractSelectExpression.getScalarColumnIndex.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.getScalarColumnIndex.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.getScalarColumnIndex.

Gets index of the select expression in the projection list.

Returns:int

The index of the select expression in the projection list.

Annotations
@Override
isScalarback to summary
public boolean isScalar()

Overrides org.hibernate.hql.internal.ast.tree.AbstractSelectExpression.isScalar.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.isScalar.

Annotations
@Override
resolveback to summary
public void resolve(boolean generateJoin, boolean implicitJoin, String classAlias, AST parent, AST parentPredicate) throws SemanticException

Overrides org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.resolve.

Implements org.hibernate.hql.internal.ast.tree.ResolvableNode.resolve.

Doc from org.hibernate.hql.internal.ast.tree.ResolvableNode.resolve.

Does the work of resolving an identifier or a dot

Annotations
@Override
resolveColumnsback to summary
protected String[] resolveColumns(QueryableCollection collectionPersister)

Implements abstract org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.resolveColumns.

Annotations
@Override
resolveTypeback to summary
protected Type resolveType(QueryableCollection collectionPersister)

Implements abstract org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.resolveType.

Annotations
@Override
@SuppressWarnings:unchecked
setScalarColumnback to summary
public void setScalarColumn(int i)

Overrides org.hibernate.hql.internal.ast.tree.AbstractSelectExpression.setScalarColumn.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumn.

Sets the index and text for select expression in the projection list.

Parameters
i:int

The index of the select expression in the projection list.

Annotations
@Override
setScalarColumnTextback to summary
public void setScalarColumnText(int i)

Overrides org.hibernate.hql.internal.ast.tree.AbstractMapComponentNode.setScalarColumnText.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.setScalarColumnText.

Appends AST nodes that represent the columns after the current AST node. (e.g. 'as col0_O_')

Parameters
i:int

The index of the select expression in the projection list.

Annotations
@Override
setTextback to summary
public void setText(String s)

Overrides org.hibernate.hql.internal.ast.tree.SqlNode.setText.

Implements org.hibernate.hql.internal.ast.tree.SelectExpression.setText, antlr.collections.AST.setText.

Doc from org.hibernate.hql.internal.ast.tree.SelectExpression.setText.

Sets the text of the node.

Parameters
s:String

the new node text.

Annotations
@Override
sfiback to summary
public SessionFactoryImplementor sfi()

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

org.hibernate.hql.internal.ast.tree back to summary

private Class MapEntryNode.BasicSelectExpression

extends Object
implements SelectExpression
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.internal.ast.tree.MapEntryNode.BasicSelectExpression
All Implemented Interfaces
org.hibernate.sql.SelectExpression

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
private
BasicSelectExpression(String expression, String alias)

Method Summary

Modifier and TypeMethod and Description
public String
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasback to summary
private final String alias
expressionback to summary
private final String expression

Constructor Detail

BasicSelectExpressionback to summary
private BasicSelectExpression(String expression, String alias)

Method Detail

getAliasback to summary
public String getAlias()

Implements org.hibernate.sql.SelectExpression.getAlias.

Annotations
@Override
getExpressionback to summary
public String getExpression()

Implements org.hibernate.sql.SelectExpression.getExpression.

Annotations
@Override
org.hibernate.hql.internal.ast.tree back to summary

private Class MapEntryNode.EntryAdapter

extends Object
implements Entry
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.internal.ast.tree.MapEntryNode.EntryAdapter
All Implemented Interfaces
java.util.Map.Entry

Field Summary

Modifier and TypeField and Description
private final Object
private Object

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
object to be compared for equality with this map entry
o
)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Compares the specified object with this entry for equality.
public Object
getKey()

Implements java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.
public Object
getValue()

Implements java.util.Map.Entry.getValue.

Returns the value corresponding to this entry.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry.
public Object
setValue(Object
new value to be stored in this entry
value
)

Implements java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation).
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private final Object key
valueback to summary
private Object value

Constructor Detail

EntryAdapterback to summary
private EntryAdapter(Object key, Object value)

Method Detail

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Implements java.util.Map.Entry.equals.

Doc from java.util.Map.Entry.equals.

Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if

    (e1.getKey()==null ?
     e2.getKey()==null : e1.getKey().equals(e2.getKey()))  &&
    (e1.getValue()==null ?
     e2.getValue()==null : e1.getValue().equals(e2.getValue()))
This ensures that the equals method works properly across different implementations of the Map.Entry interface.
Parameters
o:Object

object to be compared for equality with this map entry

Returns:boolean

true if the specified object is equal to this map entry

Annotations
@Override
getKeyback to summary
public Object getKey()

Implements java.util.Map.Entry.getKey.

Doc from java.util.Map.Entry.getKey.

Returns the key corresponding to this entry.

Returns:Object

the key corresponding to this entry

Annotations
@Override
getValueback to summary
public Object getValue()

Implements java.util.Map.Entry.getValue.

Doc from java.util.Map.Entry.getValue.

Returns the value corresponding to this entry. If the mapping has been removed from the backing map (by the iterator's remove operation), the results of this call are undefined.

Returns:Object

the value corresponding to this entry

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements java.util.Map.Entry.hashCode.

Doc from java.util.Map.Entry.hashCode.

Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:

    (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
    (e.getValue()==null ? 0 : e.getValue().hashCode())
This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode.
Returns:int

the hash code value for this map entry

Annotations
@Override
setValueback to summary
public Object setValue(Object value)

Implements java.util.Map.Entry.setValue.

Doc from java.util.Map.Entry.setValue.

Replaces the value corresponding to this entry with the specified value (optional operation). (Writes through to the map.) The behavior of this call is undefined if the mapping has already been removed from the map (by the iterator's remove operation).

Parameters
value:Object

new value to be stored in this entry

Returns:Object

old value corresponding to the entry

Annotations
@Override
org.hibernate.hql.internal.ast.tree back to summary

private Class MapEntryNode.LocalAliasGenerator

extends Object
implements AliasGenerator
Class Inheritance
  • java.lang.Object
  • org.hibernate.hql.internal.ast.tree.MapEntryNode.LocalAliasGenerator
All Implemented Interfaces
org.hibernate.sql.AliasGenerator

Field Summary

Modifier and TypeField and Description
private final int
private int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

baseback to summary
private final int base
counterback to summary
private int counter

Constructor Detail

LocalAliasGeneratorback to summary
private LocalAliasGenerator(int base)

Method Detail

generateAliasback to summary
public String generateAlias(String sqlExpression)

Implements org.hibernate.sql.AliasGenerator.generateAlias.

Annotations
@Override
org.hibernate.hql.internal.ast.tree back to summary

private Class MapEntryNode.MapEntryBuilder

extends BasicTransformerAdapter
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
transformTuple(Object[]
The result elements
tuple
,
String[]
The result aliases ("parallel" array to tuple)
aliases
)

Overrides org.hibernate.transform.BasicTransformerAdapter.transformTuple.

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Tuples are the elements making up each "row" of the query result.
Inherited from org.hibernate.transform.BasicTransformerAdapter:
transformList

Constructor Detail

MapEntryBuilderback to summary
private MapEntryBuilder()

Method Detail

transformTupleback to summary
public Object transformTuple(Object[] tuple, String[] aliases)

Overrides org.hibernate.transform.BasicTransformerAdapter.transformTuple.

Implements org.hibernate.transform.ResultTransformer.transformTuple.

Doc from org.hibernate.transform.ResultTransformer.transformTuple.

Tuples are the elements making up each "row" of the query result. The contract here is to transform these elements into the final row.

Parameters
tuple:Object[]

The result elements

aliases:String[]

The result aliases ("parallel" array to tuple)

Returns:Object

The transformed row.

Annotations
@Override