|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.farrago.query.ReposDefaultValueFactory
public class ReposDefaultValueFactory
DefaultValueFactory looks up a default value stored in the catalog, parses it, and converts it to an Expression. Processed expressions are cached for use by subsequent calls. The CwmExpression's MofId is used as the cache key.
| Field Summary | |
|---|---|
private Map<FemRoutine,SqlNodeList> |
constructorToSqlMap
|
protected FarragoPreparingStmt |
farragoPreparingStmt
|
| Constructor Summary | |
|---|---|
ReposDefaultValueFactory(FarragoPreparingStmt farragoPreparingStmt)
Creates a ReposDefaultValueFactory. |
|
| Method Summary | |
|---|---|
private RexNode |
convertConstructorAssignment(FarragoUserDefinedRoutine constructor,
FemSqltypeAttribute attribute,
RexNode[] constructorArgs)
|
private RexNode |
convertExpression(CwmExpression cwmExp)
Converts an expression definition from the repository into RexNode format. |
void |
initializeEntry(Object key,
FarragoObjectCache.UninitializedEntry entry)
Initializes a cache entry. |
boolean |
isGeneratedAlways(RelOptTable table,
int iColumn)
Whether a column is always generated. |
boolean |
isStale(Object value)
Tests a cached object for staleness. |
RexNode |
newAttributeInitializer(RelDataType type,
SqlFunction constructor,
int iAttribute,
RexNode[] constructorArgs)
Creates an expression which evaluates to the initializer expression for a particular attribute of a structured type. |
RexNode |
newColumnDefaultValue(RelOptTable table,
int iColumn)
Creates an expression which evaluates to the default value for a particular column. |
private RexNode |
sequenceValue(FemSequenceGenerator sequence)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Map<FemRoutine,SqlNodeList> constructorToSqlMap
protected FarragoPreparingStmt farragoPreparingStmt
| Constructor Detail |
|---|
public ReposDefaultValueFactory(FarragoPreparingStmt farragoPreparingStmt)
farragoPreparingStmt - Statement preparation context| Method Detail |
|---|
public boolean isGeneratedAlways(RelOptTable table,
int iColumn)
DefaultValueFactory
isGeneratedAlways in interface DefaultValueFactory
public RexNode newColumnDefaultValue(RelOptTable table,
int iColumn)
DefaultValueFactory
newColumnDefaultValue in interface DefaultValueFactorytable - the table containing the columniColumn - the 0-based offset of the column in the table
public RexNode newAttributeInitializer(RelDataType type,
SqlFunction constructor,
int iAttribute,
RexNode[] constructorArgs)
DefaultValueFactory
newAttributeInitializer in interface DefaultValueFactorytype - the structured typeconstructor - the constructor invoked to initialize the typeiAttribute - the 0-based offset of the attribute in the typeconstructorArgs - arguments passed to the constructor invocation
private RexNode convertConstructorAssignment(FarragoUserDefinedRoutine constructor,
FemSqltypeAttribute attribute,
RexNode[] constructorArgs)
private RexNode convertExpression(CwmExpression cwmExp)
cwmExp - Repository object representing an expression
private RexNode sequenceValue(FemSequenceGenerator sequence)
public void initializeEntry(Object key,
FarragoObjectCache.UninitializedEntry entry)
FarragoObjectCache.CachedObjectFactory
initializeEntry in interface FarragoObjectCache.CachedObjectFactorykey - key of the object to be constructedentry - to initialize by calling its FarragoObjectCache.UninitializedEntry.initialize(java.lang.Object, long, boolean) method; failing to call initialize
will lead to a subsequent assertion (unless an exception is thrown to
indicate initialization failure)public boolean isStale(Object value)
FarragoObjectCache.CachedObjectFactory
isStale in interface FarragoObjectCache.CachedObjectFactory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||