org.datanucleus.store.mapped.expression
Class LogicSetExpression

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.LogicSetExpression
Direct Known Subclasses:
TableExprAsJoins, TableExprAsSubjoins

public abstract class LogicSetExpression
extends java.lang.Object

Represents a Set. A collection of objects. For in-depth details read about the mathematical "set" theory. Pragmatically, it represents a SQL table expression as might be listed in the FROM clause of a SELECT statement. A table expression is a fragment of a larger containing QueryStatement.

A table expression has a base "main" table. If that table serves as backing for a Java class, and that class has persistence-capable superclasses, then the table expression may include joins to superclass tables, or may cause such joins to occur in its surrounding QueryStatement.

See Also:
QueryExpression

Field Summary
protected  java.util.Map embeddedFieldMappings
          Collection of field expressions already created for this table expression.
protected static Localiser LOCALISER
          Localiser for messages
protected  DatastoreIdentifier mainAlias
          Alias for this table.
protected  DatastoreContainerObject mainTable
          The datastore table underlying this expression.
protected  QueryExpression qs
          Query Expression that this is part of.
protected  java.lang.String sqlText
          The SQL text.
 
Constructor Summary
protected LogicSetExpression(QueryExpression qs, DatastoreContainerObject mainTable, DatastoreIdentifier alias)
          Constructor.
 
Method Summary
protected  void assertNotFrozen()
           
 boolean equals(java.lang.Object obj)
           
 DatastoreIdentifier getAlias()
          Accessor for the alias for this table expression.
 DatastoreContainerObject getMainTable()
          Accessor for the main table for this expression.
 int hashCode()
           
 ScalarExpression newFieldExpression(java.lang.String fieldName)
          Accessor for a field expression on this table where the field is actually present in this table.
abstract  java.lang.String referenceColumn(DatastoreField col)
          Return an identifier/reference to the datastore field/column.
abstract  java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER

protected static final Localiser LOCALISER
Localiser for messages


qs

protected final QueryExpression qs
Query Expression that this is part of.


mainTable

protected final DatastoreContainerObject mainTable
The datastore table underlying this expression.


mainAlias

protected final DatastoreIdentifier mainAlias
Alias for this table.


sqlText

protected java.lang.String sqlText
The SQL text.


embeddedFieldMappings

protected java.util.Map embeddedFieldMappings
Collection of field expressions already created for this table expression. Used by nested embedded queries.

Constructor Detail

LogicSetExpression

protected LogicSetExpression(QueryExpression qs,
                             DatastoreContainerObject mainTable,
                             DatastoreIdentifier alias)
Constructor.

Parameters:
qs - Query Expression
mainTable - The main table for this query
alias - Table alias
Method Detail

assertNotFrozen

protected void assertNotFrozen()

getMainTable

public final DatastoreContainerObject getMainTable()
Accessor for the main table for this expression.

Returns:
The main table

getAlias

public final DatastoreIdentifier getAlias()
Accessor for the alias for this table expression.

Returns:
The alias

newFieldExpression

public ScalarExpression newFieldExpression(java.lang.String fieldName)
Accessor for a field expression on this table where the field is actually present in this table.

Parameters:
fieldName - Name of the field
Returns:
The field expression

referenceColumn

public abstract java.lang.String referenceColumn(DatastoreField col)
Return an identifier/reference to the datastore field/column.

Parameters:
col - the column to have a reference
Returns:
identifier or fully qualified identifier

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2010. All Rights Reserved.