Class QMap

All Implemented Interfaces:
Expression<Map<Expression<?>,?>>, FactoryExpression<Map<Expression<?>,?>>, Serializable

public class QMap extends FactoryExpressionBase<Map<Expression<?>,?>>
QMap represents a projection of type Map

Usage example

 
 List<Map<Expression<?>,?> result = query.from(employee).select(Projections.map(employee.firstName, employee.lastName)).fetch();
 for (Tuple row : result) {
     System.out.println("firstName " + row.get(employee.firstName));
     System.out.println("lastName " + row.get(employee.lastName));
 }
 
 
Author:
tiwe
See Also:
  • Constructor Details

    • QMap

      protected QMap(Expression<?>... args)
      Create a new QMap instance
      Parameters:
      args -
    • QMap

      protected QMap(List<Expression<?>> args)
      Create a new QMap instance
      Parameters:
      args -
    • QMap

      protected QMap(Expression<?>[]... args)
      Create a new QMap instance
      Parameters:
      args -
  • Method Details

    • accept

      @Nullable public <R, C> R accept(Visitor<R,C> v, C context)
      Description copied from interface: Expression
      Accept the visitor with the given context
      Type Parameters:
      R - return type
      C - context type
      Parameters:
      v - visitor
      context - context of visit
      Returns:
      result of visit
    • getArgs

      public @Unmodifiable List<Expression<?>> getArgs()
      Description copied from interface: FactoryExpression
      Get the invocation arguments
      Returns:
      argument expressions
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class FactoryExpressionBase<Map<Expression<?>,?>>
    • newInstance

      @Nullable public @Nullable Map<Expression<?>,?> newInstance(Object... args)
      Description copied from interface: FactoryExpression
      Create a projection with the given arguments
      Parameters:
      args - row arguments
      Returns:
      constructed value