org.apache.openjpa.jdbc.meta.strats
Class ContainerFieldStrategy

java.lang.Object
  extended by org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
      extended by org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
          extended by org.apache.openjpa.jdbc.meta.strats.ContainerFieldStrategy
All Implemented Interfaces:
Serializable, FieldStrategy, Strategy
Direct Known Subclasses:
MapTableFieldStrategy, StoreCollectionFieldStrategy

public abstract class ContainerFieldStrategy
extends AbstractFieldStrategy

An abstract container mapping that handles traversing the join to examine the size of the relation.

Author:
Marc Prud'hommeaux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
field
 
Constructor Summary
ContainerFieldStrategy()
           
 
Method Summary
 void appendIsEmpty(SQLBuffer sql, Select sel, Joins joins)
          Append a where clause to the given statement checking if this value is empty.
 void appendIsNotEmpty(SQLBuffer sql, Select sel, Joins joins)
          Append a where clause to the given statement checking if this value is not empty.
 void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins)
          Append a where clause to the given statement checking if this value is not null.
 void appendIsNull(SQLBuffer sql, Select sel, Joins joins)
          Append a where clause to the given statement checking if this value is null.
protected static void appendJoinCount(SQLBuffer sql, Select sel, Joins joins, DBDictionary dict, FieldMapping field, ForeignKey fk)
           
 void appendSize(SQLBuffer sql, Select sel, Joins joins)
          Append a where clause to the given statement checking the size of the value.
static void appendUnaliasedJoin(SQLBuffer sql, Select sel, Joins joins, DBDictionary dict, FieldMapping field, ForeignKey fk)
           
protected abstract  ClassMapping[] getIndependentElementMappings(boolean traverse)
          Return all independent mappings to which this strategy must join in order to access collection elements, or empty array if none.
protected abstract  ForeignKey getJoinForeignKey()
           
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractFieldStrategy
assertNotMappedBy, isEagerSelectToMany, isVersionable, join, joinKey, joinKeyRelation, joinRelation, load, load, loadEagerJoin, loadEagerParallel, loadKeyProjection, loadProjection, select, selectEagerJoin, selectEagerParallel, setFieldMapping, supportsSelect, toDataStoreValue, toKeyDataStoreValue, where
 
Methods inherited from class org.apache.openjpa.jdbc.meta.strats.AbstractStrategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.jdbc.meta.Strategy
customDelete, customInsert, customUpdate, delete, getAlias, initialize, insert, isCustomDelete, isCustomInsert, isCustomUpdate, map, update
 

Constructor Detail

ContainerFieldStrategy

public ContainerFieldStrategy()
Method Detail

getIndependentElementMappings

protected abstract ClassMapping[] getIndependentElementMappings(boolean traverse)
Return all independent mappings to which this strategy must join in order to access collection elements, or empty array if none.

Parameters:
traverse - whether we're traversing through to the related type
See Also:
ValueMapping.getIndependentTypeMappings(), ClassMapping.EMPTY_MAPPINGS

appendIsEmpty

public void appendIsEmpty(SQLBuffer sql,
                          Select sel,
                          Joins joins)
Description copied from interface: FieldStrategy
Append a where clause to the given statement checking if this value is empty. Appends impossible-to-satisfy SQL by default.

Specified by:
appendIsEmpty in interface FieldStrategy
Overrides:
appendIsEmpty in class AbstractFieldStrategy

appendIsNotEmpty

public void appendIsNotEmpty(SQLBuffer sql,
                             Select sel,
                             Joins joins)
Description copied from interface: FieldStrategy
Append a where clause to the given statement checking if this value is not empty. Appends always-satisfied SQL by default.

Specified by:
appendIsNotEmpty in interface FieldStrategy
Overrides:
appendIsNotEmpty in class AbstractFieldStrategy

appendIsNull

public void appendIsNull(SQLBuffer sql,
                         Select sel,
                         Joins joins)
Description copied from interface: FieldStrategy
Append a where clause to the given statement checking if this value is null.

Specified by:
appendIsNull in interface FieldStrategy
Overrides:
appendIsNull in class AbstractFieldStrategy

appendIsNotNull

public void appendIsNotNull(SQLBuffer sql,
                            Select sel,
                            Joins joins)
Description copied from interface: FieldStrategy
Append a where clause to the given statement checking if this value is not null.

Specified by:
appendIsNotNull in interface FieldStrategy
Overrides:
appendIsNotNull in class AbstractFieldStrategy

getJoinForeignKey

protected abstract ForeignKey getJoinForeignKey()

appendSize

public void appendSize(SQLBuffer sql,
                       Select sel,
                       Joins joins)
Description copied from interface: FieldStrategy
Append a where clause to the given statement checking the size of the value.

Specified by:
appendSize in interface FieldStrategy
Overrides:
appendSize in class AbstractFieldStrategy

appendJoinCount

protected static void appendJoinCount(SQLBuffer sql,
                                      Select sel,
                                      Joins joins,
                                      DBDictionary dict,
                                      FieldMapping field,
                                      ForeignKey fk)

appendUnaliasedJoin

public static void appendUnaliasedJoin(SQLBuffer sql,
                                       Select sel,
                                       Joins joins,
                                       DBDictionary dict,
                                       FieldMapping field,
                                       ForeignKey fk)


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.