Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.javatools.db.ora
Class TablePartition

java.lang.Object
  extended by oracle.javatools.db.AbstractDBObject
      extended by oracle.javatools.db.AbstractChildDBObject
          extended by oracle.javatools.db.ora.TablePartition
All Implemented Interfaces:
ChildDBObject, DBObject, Copyable, DynamicPropertySet

public class TablePartition
extends AbstractChildDBObject

TablePartition encapsulate the properties of an individual partition or subpartition. TablePartition objects are held by an OracleTablePartitions object. For an overview of the table partitioning api see OracleTablePartitions.

The following DDL describes 3 partitions (P100, P500, PMAX), 2 partition level subpartitions (RANGE_HASH2_SP3, RANGE_HASH2_SP4), and 2 subpartition templates (RANGE_HASH2_SP1, RANGE_HASH2_SP2).

      create table RANGE_HASH2
      ( C1 number
      , C2 number
      )
      partition by range(C1)
      subpartition by hash(C2) subpartition template
      ( subpartition RANGE_HASH2_SP1
       ,subpartition RANGE_HASH2_SP2
      )
      ( partition P100 values less than(100)
        ( subpartition RANGE_HASH2_SP3
         ,subpartition RANGE_HASH2_SP4
        )
       ,partition P500 values less than(500)
       ,partition PMAX values less than(maxvalue)
      )
 

Each partition, partition level subpartition, and subpartition template is represented by a TablePartition object. A TablePartition defines

  1. PARTITION_TYPE : the type of partition {RANGE, LIST, HASH} or subpartition {LIST, HASH}.
  2. OBJECT_TYPE : the usage of an object of this class {PARTITION, SUBPARTITION_TEMPLATE, PARTITION_LEVEL_SUBPARTITION}.
  3. NAME : the name of the (sub)partition. Mandatory for a subpartition template otherwise optional.
  4. SEGMENT_ATTRIBUTES : a reference to an OracleStorageProperties object that defines the segment attribute properties. Only the TABLESPACE property is valid for a subpartition template, partition level subpartition, or hash partition.
  5. COMPRESSION : the key or data segment compression {COMPRESS, NOCOMPRESS, positive_integer}. Only valid for a range or list partition.
  6. LOB_DESCRIPTORS : a collection of LOBDescriptor objects defining the partitioning properties of LOB and VARRAY columns. May be empty.
  7. VALUES : an ordered collection of range partition or list (sub)partition values. Must be empty for a hash (sub)partition.
  8. PARTITION_LEVEL_SUBPARTITIONS : a reference to an OracleTablePartitions object that defines the partition level subpartitions of a composite range partition. It must be null for all other partition and object types.
The PARTITION_TYPE and OBJECT_TYPE must be the same as the OracleTablePartitions that contains the TablePartition object. To guarantee this create a TablePartition object using OracleTablePartitions.createPartition().`

DDL clauses when OBJECT_TYPE = PARTITION and PARTITION_TYPE = HASH

  1. partition [NAME] [SEGMENT_ATTRIBUTES.TABLESPACE] [LOB_DESCRIPTORS]
DDL clauses when OBJECT_TYPE = PARTITION and PARTITION_TYPE = LIST
  1. partition [NAME] values (VALUES) [SEGMENT_ATTRIBUTES] [COMPRESSION] [LOB_DESCRIPTORS]
DDL clauses when OBJECT_TYPE = PARTITION and PARTITION_TYPE = RANGE
  1. partition [NAME] values less than( VALUES) [SEGMENT_ATTRIBUTES] [COMPRESSION] [LOB_DESCRIPTORS] [PARTITION_LEVEL_SUBPARTITIONS]
DDL clauses when OBJECT_TYPE = SUBPARTITION_TEMPLATE and PARTITION_TYPE = HASH
  1. subpartition NAME [tablespace SEGMENT_ATTRIBUTES.TABLESPACE] [LOB_DESCRIPTORS]
DDL clauses when OBJECT_TYPE = SUBPARTITION_TEMPLATE and PARTITION_TYPE = LIST
  1. subpartition NAME values (VALUES) [tablespace SEGMENT_ATTRIBUTES.TABLESPACE] [LOB_DESCRIPTORS]
DDL clauses when OBJECT_TYPE = PARTITION_LEVEL_SUBPARTITION and PARTITION_TYPE = HASH
  1. subpartition [NAME] [tablespace SEGMENT_ATTRIBUTES.TABLESPACE] [LOB_DESCRIPTORS]
DDL clauses when OBJECT_TYPE = PARTITION_LEVEL_SUBPARTITION and PARTITION_TYPE = LIST
  1. subpartition [NAME] values (VALUES) [tablespace SEGMENT_ATTRIBUTES.TABLESPACE] [LOB_DESCRIPTORS]

Since:
11.0
See Also:
OracleTablePartitions, LOBDescriptor

Nested Class Summary
static class TablePartition.ListValue
           
static class TablePartition.RangeValue
           
 
Nested classes/interfaces inherited from class oracle.javatools.db.AbstractDBObject
AbstractDBObject.ChildSupport
 
Field Summary
static java.lang.String COMPRESS
           
static java.lang.String NOCOMPRESS
           
static java.lang.String TYPE
           
 
Fields inherited from interface oracle.javatools.db.DBObject
COMMENT
 
Constructor Summary
TablePartition()
           
TablePartition(OracleTablePartitions.PartitionType partitionType, OracleTablePartitions.ObjectType objectType)
           
TablePartition(java.lang.String name)
           
TablePartition(java.lang.String name, OracleTablePartitions.PartitionType partitionType, OracleTablePartitions.ObjectType objectType)
           
 
Method Summary
 void addLOBDescriptor(LOBDescriptor lobDescriptor)
          Add a LOBDescriptor object that defines the (sub)partitioning properties of a LOB or VARRAY column for this (sub)partition.
 void addValue(java.lang.Object value)
          Add a value to the ordered list of values that define a range partition or list (sub)partition.
 void addValue(java.lang.Object value, int atIndex)
          Add a value to the ordered list of values that define a range partition or list (sub)partition.
 java.lang.String getCompression()
          Return the key (index-organized tables) or data segment compression of a RANGE or LIST PARTITION.
 LOBDescriptor[] getLOBDescriptors()
          Return an array of LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB or VARRAY columns for this (sub)partition.
 OracleTablePartitions.ObjectType getObjectType()
           
 OracleTablePartitions getPartitionLevelSubpartitions()
          Get the OracleTablePartitions object that represents the partition level subpartitions of a composite range partition or range subpartition template.
 OracleTablePartitions.PartitionType getPartitionType()
           
 OracleStorageProperties getSegmentAttributes()
           
 java.lang.String getType()
          Returns the type of this object.
 java.lang.Object[] getValues()
          Return an array of values that define a range partition or list (sub)partition.
 int hashCode()
           
 void removeAllLOBDescriptors()
          Remove all LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB or VARRAY columns for this (sub)partition.
 void removeLOBDescriptor(LOBDescriptor lobDescriptor)
          Remove a LOBDescriptor object that defines the (sub)partitioning properties of a LOB or VARRAY column for this (sub)partition.
 void removeValue(java.lang.Object value)
          Remove a value from the ordered list of values that define a range partition or list (sub)partition.
 void setCompression(java.lang.String compression)
          Set the key (index-organized tables) or data segment compression.
 void setLOBDescriptors(LOBDescriptor[] lobDescriptors)
          Replace the LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB and VARRAY columns for this (sub)partition.
 void setName(java.lang.String name)
          Set the NAME of the (sub)partition.
 void setObjectType(OracleTablePartitions.ObjectType objectType)
          Set OBJECT_TYPE as one of PARTITION, SUBPARTITION_TEMPLATE, PARTITION_LEVEL_SUBPARTITION.
 void setPartitionLevelSubpartitions(OracleTablePartitions partitionLevelSubpartitions)
          Set the OracleTablePartitions object that represents the partition level subpartitions of a composite range partition or range subpartition template.
 void setPartitionType(OracleTablePartitions.PartitionType partitionType)
          Set PARTITION_TYPE as one of RANGE, HASH, LIST.
 void setSegmentAttributes(OracleStorageProperties segmentAttributes)
          Set the OracleStorageProperties object defining the (sub)partition segment attribute properties.
 void setValues(java.lang.Object[] values)
          Replace the ordered list of values that define a range partition or list (sub)partition.
 void setValues(java.lang.String values)
          Replace the ordered list of values that define a range partition or list (sub)partition with the values extracted from a comma separated list.
static java.util.List<java.lang.String> splitValues(java.lang.String string)
          Returns an ordered list of values extracted from a comma separated string ignoring commas within single and double quotes and round brackets () .
 java.lang.String toString()
           
 
Methods inherited from class oracle.javatools.db.AbstractChildDBObject
copyToImpl, findParent, getParent, getProperty, setParent, setProperty
 
Methods inherited from class oracle.javatools.db.AbstractDBObject
changeParent, compareToImpl, copyObject, copyTo, copyTo, copyTo, copyTo, equals, equalsImpl, findOwnedObject, findOwnedObject, findOwnedObject, getChildSupport, getID, getName, getOwnedObjects, getOwnedObjects, getOwnedObjectsImpl, getProperties, getProperty, getReferenceIDs, getReferenceIDsImpl, includeOwnedObject, includesType, includesType, removeThisAsParent, replaceReferenceIDs, setID, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.javatools.db.DBObject
copyTo, copyTo, copyTo, findOwnedObject, findOwnedObject, getID, getName, getOwnedObjects, getOwnedObjects, getReferenceIDs, replaceReferenceIDs, setID
 
Methods inherited from interface oracle.javatools.util.DynamicPropertySet
getProperties, getProperty, setProperties
 

Field Detail

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

COMPRESS

public static final java.lang.String COMPRESS
See Also:
Constant Field Values

NOCOMPRESS

public static final java.lang.String NOCOMPRESS
See Also:
Constant Field Values
Constructor Detail

TablePartition

public TablePartition()

TablePartition

public TablePartition(java.lang.String name)

TablePartition

public TablePartition(OracleTablePartitions.PartitionType partitionType,
                      OracleTablePartitions.ObjectType objectType)

TablePartition

public TablePartition(java.lang.String name,
                      OracleTablePartitions.PartitionType partitionType,
                      OracleTablePartitions.ObjectType objectType)
Method Detail

getType

public java.lang.String getType()
Description copied from interface: DBObject
Returns the type of this object. Valid types include things like tables, views, synonyms, and columns.

Returns:
a string describing the type of object.

setPartitionType

public void setPartitionType(OracleTablePartitions.PartitionType partitionType)
Set PARTITION_TYPE as one of RANGE, HASH, LIST.

Parameters:
partitionType -

getPartitionType

public OracleTablePartitions.PartitionType getPartitionType()

setObjectType

public void setObjectType(OracleTablePartitions.ObjectType objectType)
Set OBJECT_TYPE as one of PARTITION, SUBPARTITION_TEMPLATE, PARTITION_LEVEL_SUBPARTITION.

Parameters:
objectType -

getObjectType

public OracleTablePartitions.ObjectType getObjectType()

setName

public void setName(java.lang.String name)
Set the NAME of the (sub)partition. Mandatory for a subpartition template.

Specified by:
setName in interface DBObject
Overrides:
setName in class AbstractDBObject
Parameters:
name -

setSegmentAttributes

public void setSegmentAttributes(OracleStorageProperties segmentAttributes)
Set the OracleStorageProperties object defining the (sub)partition segment attribute properties. Only the TABLESPACE property is valid for a subpartition template, partition level subpartition, or HASH PARTITION.

Parameters:
segmentAttributes -

getSegmentAttributes

public OracleStorageProperties getSegmentAttributes()

setCompression

public void setCompression(java.lang.String compression)
Set the key (index-organized tables) or data segment compression. Only valid for a RANGE or LIST PARTITION.

Parameters:
compression -

getCompression

public java.lang.String getCompression()
Return the key (index-organized tables) or data segment compression of a RANGE or LIST PARTITION.

Returns:

setLOBDescriptors

public void setLOBDescriptors(LOBDescriptor[] lobDescriptors)
Replace the LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB and VARRAY columns for this (sub)partition.

Parameters:
lobDescriptors -

addLOBDescriptor

public void addLOBDescriptor(LOBDescriptor lobDescriptor)
Add a LOBDescriptor object that defines the (sub)partitioning properties of a LOB or VARRAY column for this (sub)partition.

Parameters:
lobDescriptor -

removeLOBDescriptor

public void removeLOBDescriptor(LOBDescriptor lobDescriptor)
Remove a LOBDescriptor object that defines the (sub)partitioning properties of a LOB or VARRAY column for this (sub)partition.

Parameters:
lobDescriptor -

removeAllLOBDescriptors

public void removeAllLOBDescriptors()
Remove all LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB or VARRAY columns for this (sub)partition.


getLOBDescriptors

public LOBDescriptor[] getLOBDescriptors()
Return an array of LOBDescriptor objects that define the (sub)partitioning properties of a table's LOB or VARRAY columns for this (sub)partition. The array may be empty.

Returns:

setValues

public void setValues(java.lang.Object[] values)
Replace the ordered list of values that define a range partition or list (sub)partition. Not valid for hash (sub)partitions.

Parameters:
values -

setValues

public void setValues(java.lang.String values)
Replace the ordered list of values that define a range partition or list (sub)partition with the values extracted from a comma separated list.

Parameters:
values - : Comma separated list of values

getValues

public java.lang.Object[] getValues()
Return an array of values that define a range partition or list (sub)partition. Not valid for hash (sub)partitions.

Returns:

addValue

public void addValue(java.lang.Object value)
Add a value to the ordered list of values that define a range partition or list (sub)partition. Not valid for hash (sub)partitions.

Parameters:
value -

addValue

public void addValue(java.lang.Object value,
                     int atIndex)
Add a value to the ordered list of values that define a range partition or list (sub)partition. Not valid for hash (sub)partitions.

Parameters:
value -

removeValue

public void removeValue(java.lang.Object value)
Remove a value from the ordered list of values that define a range partition or list (sub)partition. Not valid for hash (sub)partitions.

Parameters:
value -

setPartitionLevelSubpartitions

public void setPartitionLevelSubpartitions(OracleTablePartitions partitionLevelSubpartitions)
Set the OracleTablePartitions object that represents the partition level subpartitions of a composite range partition or range subpartition template. Not valid for hash or list (sub)partitions or any individual partition level subpartition.

Parameters:
partitionLevelSubpartitions -

getPartitionLevelSubpartitions

public OracleTablePartitions getPartitionLevelSubpartitions()
Get the OracleTablePartitions object that represents the partition level subpartitions of a composite range partition or range subpartition template. Not valid for hash or list (sub)partitions or any individual partition level subpartition.

Returns:

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractDBObject

splitValues

public static java.util.List<java.lang.String> splitValues(java.lang.String string)
Returns an ordered list of values extracted from a comma separated string ignoring commas within single and double quotes and round brackets () .

Parameters:
string -
Returns:

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.