autoPartitionIndex

autoPartitionIndex(): Integer partitionMethod;

The autoPartitionIndex method of the Object class returns the partition index of the database file partition in which an object is stored on creation. The method is automatically called when an instance of a partitioned class is created.

A partition index value of zero (0) refers to the latest partition created, a partition index value of one (1) to the second latest, and so on.

The autoPartitionIndex method returns the value zero, so objects are created by default in the latest partition. However, you can reimplement the method in user classes to override the default behavior. For more details, see "partitionMethod Option", in Chapter 1 of the JADE Developer’s Reference.

The autoPartitionIndex method cannot be used if the database file for that object is encrypted, as the database cannot invoke the autoPartitionIndex method using an encrypted buffer. If this occurs, exception 3009 (File encrypted and partition unspecified) is raised.

If the file is encrypted, use the Object class setPartitionID or setPartitionIndex method to explicitly set the partition in the created object.