Class COM.odi.coll.Path

java.lang.Object
   |
   +----COM.odi.jcpp.CPlusPlus
           |
           +----COM.odi.coll.Path

public class Path
extends CPlusPlus
A Path specifies an order in which a collection should be traversed, and/or a particular index that can be added to a collection.

A Path object is a transient Java peer object. When you are finished with a Path object, call ObjectStore.destroy() on it to free the C++ transient storage. The application accesses the Path object through a Java peer object and the associated C++ object is not automatically garbage collected. You must explicitly delete it.


Variable Index

 o ALLOW_DUPLICATES
This flag is the same as the default, and means that the duplicates should be allowed.
 o ORDERED
When the Path is used to specify an index to be added to a collection, this flag controls whether the index is unordered or ordered.
 o SIGNAL_DUPLICATES
When the Path is used to specify an index to be added to a collection, and this flag is used, you are asserting that no two elements of the collection will ever have the same key value.
 o UNORDERED
This flag is the same as the default, and means that the index should be unordered.

Constructor Index

 o Path(ClassInfo)
Create a hollow Path object

Method Index

 o create(String, String, Database)
Creates a new Path in the transient heap.

Variables

 o ORDERED
  public final static int ORDERED
When the Path is used to specify an index to be added to a collection, this flag controls whether the index is unordered or ordered. By default, an unordered index is created. If this flag is specified, an ordered index is created. An ordered index has the advantage that it can speed up inequality queries, as well as equality queries. Inequality queries involve the comparison operators <, >, <=, and >=. An unordered index can only speed up equality queries. However, if you are performing an equality query, looking up an element using an ordered index, while faster than using no index, is not quite as fast as using an unordered index. Internally, an unordered index is implemented using a type of hash table, while an ordered index is implemented using a B-tree.

 o UNORDERED
  public final static int UNORDERED
This flag is the same as the default, and means that the index should be unordered.

 o SIGNAL_DUPLICATES
  public final static int SIGNAL_DUPLICATES
When the Path is used to specify an index to be added to a collection, and this flag is used, you are asserting that no two elements of the collection will ever have the same key value. Any attempt to insert an element into the collection with the same key value as some other element already in the collection, ObjectStore throws COM.odi.coll.DuplicateKeyException This exception is also thrown if the index is added to a collection that already has two or more elements with the same key value. Note: this flag corresponds to both the no_duplicates flag and the signal_duplicates flag in the C++ interface; it is not meaningful for these flags to have different values from each other.

 o ALLOW_DUPLICATES
  public final static int ALLOW_DUPLICATES
This flag is the same as the default, and means that the duplicates should be allowed.

Constructors

 o Path
  protected Path(ClassInfo c)
Create a hollow Path object

Methods

 o create
  public static Path create(String elementType,
                            String pathString,
                            Database database)
Creates a new Path in the transient heap. You must be inside a transaction when you call this, even though it is making a transient object, because ObjectStore needs to examine the database schema.

Parameters:
elementType - The fully-qualified class name for a type. When you add an index to a collection and specify this Path object, the collection must contain only this type of element.

pathString - The name of a field of the elementType class. You must have previously made this field indexable when you ran the postprocessor. This field must be of type int long, java.lang.String, or an object reference. If you use a multistep string to identify the field, each field must be indexable. For example, in dept.manager.salary, dept, manager, and salary must all be indexable. Also, each field except the last field must be an object reference. The last field can also be an object reference, but it is not required.

database - A database specification. The schema of the specified database must describe the class specified for elementType. You must not specify the transient database. Note that the Path object itself is transient; it is not created in this database.

Throws: SegmentException
If you specify the transient database or the transient segment.

Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.