wt.inf.container
Class ContainerSpecHelper

java.lang.Object
  extended bywt.inf.container.ContainerSpecHelper

final class ContainerSpecHelper
extends Object

Utility class used by WTContainerHelper and StandardWTContainerService to build StatementSpecs from ContainerSpecs. This class has no public API.

Supported API: false

Extendable: false


Nested Class Summary
private static class ContainerSpecHelper.IteratedShareables
           
(package private) static class ContainerSpecHelper.QueryConfig
          Builds and caches the possible descendants of a given container class
 
Field Summary
private static String BRANCH_ID
           
private static String CLASSNAME
           
private static boolean DEBUG
           
private static DebugWriter LOG
           
private static List MEMBER_INCLUDES
           
(package private) static ContainerSpecHelper.QueryConfig queryConfig
           
private static String SHARED_OBJECT
           
private static String SHARED_VERSION
           
private static Map subClassCache
           
private static String TARGET_CONTAINER
           
private static int[] ZERO
           
 
Constructor Summary
(package private) ContainerSpecHelper()
           
 
Method Summary
private static void addHierarchySpecs(ContainerSpec spec, WTContainerRef ref, CompoundQuerySpec comp, boolean select_classname)
           
private static void applySelectState(QuerySpec qs, int select_state)
          Set the selection criteria of the given QuerySpec based on the given ContainerSpec select state
private static WhereExpression getDeleteExpression(ContainerSpec spec)
          Get a search condition for mark for delete based on the spec's delete state
private static StatementSpec getHierarchySpec(ContainerSpec spec, int select_state)
          Get a statement that selects the containers that are descendents of the containers in the spec's search containers property
private static Set getIteratedShareableClasses(boolean clone)
          Get all shareable classes that implement Iterated and that have database tables in this installation.
private static QuerySpec getQuerySpecForResultClasses(ContainerSpec spec)
          Returns a QuerySpec optimized to look in the containers specified in the ContainerSpec's resultClasses Collection.
private static Set getShareableClasses(boolean clone)
          Get all shareable classes in this installation.
(package private) static StatementSpec getStatementForContainersIn(ContainerSpec spec, int select_state)
          Get a statement that selects the containers in the given spec
(package private) static StatementSpec getStatementForSearchClasses(ContainerSpec spec, Class[] search_classes, int select_state)
          Get a statement that selects the WTContained objects contained by a container selected by the given container spec
private static Set getValidSubClasses(Class search_class, boolean clone)
          Get the subclasses of the given search class that have database tables.
private static boolean isResultClass(Class query_class, ContainerSpec spec)
          Determine if the given container class is one that was selected by the spec for retrieval
private static void processTableExpression(ContainerSpec spec, ClassTableExpression cte)
          Update the table expressions excluded classes and included interfaces based on the specifications in the container spec
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSNAME

private static final String CLASSNAME

queryConfig

static final ContainerSpecHelper.QueryConfig queryConfig

subClassCache

private static final Map subClassCache

ZERO

private static final int[] ZERO

DEBUG

private static final boolean DEBUG

LOG

private static final DebugWriter LOG

TARGET_CONTAINER

private static final String TARGET_CONTAINER

SHARED_OBJECT

private static final String SHARED_OBJECT

SHARED_VERSION

private static final String SHARED_VERSION

BRANCH_ID

private static final String BRANCH_ID

MEMBER_INCLUDES

private static final List MEMBER_INCLUDES
Constructor Detail

ContainerSpecHelper

ContainerSpecHelper()
Method Detail

getStatementForSearchClasses

static StatementSpec getStatementForSearchClasses(ContainerSpec spec,
                                                  Class[] search_classes,
                                                  int select_state)
                                           throws WTException
Get a statement that selects the WTContained objects contained by a container selected by the given container spec

Parameters:
spec -
search_classes - The subtypes of WTContained to find
select_state -
Throws:
WTException

getStatementForContainersIn

static StatementSpec getStatementForContainersIn(ContainerSpec spec,
                                                 int select_state)
                                          throws WTException
Get a statement that selects the containers in the given spec

Parameters:
spec -
select_state -
Throws:
WTException

getHierarchySpec

private static StatementSpec getHierarchySpec(ContainerSpec spec,
                                              int select_state)
                                       throws WTException
Get a statement that selects the containers that are descendents of the containers in the spec's search containers property

Parameters:
spec -
select_state -
Throws:
WTException

addHierarchySpecs

private static final void addHierarchySpecs(ContainerSpec spec,
                                            WTContainerRef ref,
                                            CompoundQuerySpec comp,
                                            boolean select_classname)
                                     throws WTException
Throws:
WTException

isResultClass

private static boolean isResultClass(Class query_class,
                                     ContainerSpec spec)
                              throws WTException
Determine if the given container class is one that was selected by the spec for retrieval

Parameters:
query_class -
spec -
Throws:
WTException

getDeleteExpression

private static WhereExpression getDeleteExpression(ContainerSpec spec)
                                            throws WTException
Get a search condition for mark for delete based on the spec's delete state

Parameters:
spec -
Throws:
WTException

getQuerySpecForResultClasses

private static final QuerySpec getQuerySpecForResultClasses(ContainerSpec spec)
                                                     throws WTException
Returns a QuerySpec optimized to look in the containers specified in the ContainerSpec's resultClasses Collection.

Throws:
WTException

processTableExpression

private static final void processTableExpression(ContainerSpec spec,
                                                 ClassTableExpression cte)
                                          throws WTException
Update the table expressions excluded classes and included interfaces based on the specifications in the container spec

Parameters:
spec -
cte -
Throws:
WTException

getValidSubClasses

private static Set getValidSubClasses(Class search_class,
                                      boolean clone)
                               throws WTException
Get the subclasses of the given search class that have database tables. The results are cached.

Parameters:
search_class -
clone - If false, the resulting set is an unmodifiable cached instacne
Returns:
Set
Throws:
WTException

getShareableClasses

private static Set getShareableClasses(boolean clone)
                                throws WTException
Get all shareable classes in this installation. The results are cached.

Parameters:
clone - If false, the resulting set is an unmodifiable cached instacne
Returns:
Set
Throws:
WTException

getIteratedShareableClasses

private static Set getIteratedShareableClasses(boolean clone)
                                        throws WTException
Get all shareable classes that implement Iterated and that have database tables in this installation. The results are cached.

Parameters:
clone - If false, the resulting set is an unmodifiable cached instacne
Returns:
Set
Throws:
WTException

applySelectState

private static final void applySelectState(QuerySpec qs,
                                           int select_state)
                                    throws WTException
Set the selection criteria of the given QuerySpec based on the given ContainerSpec select state

Parameters:
qs -
select_state -
Throws:
WTException