com.esri.arcgis.geodatabase
Interface IQueryName2

All Superinterfaces:
IQueryName, Serializable
All Known Implementing Classes:
FeatureQueryName, TableQueryName

public interface IQueryName2
extends IQueryName, Serializable

Provides access to the associated query definition.

Remarks

This interface extends the IQueryName interface to allow Objects in tables created from a QueryDef. The table used in the QueryDef does not need to be registered with the geodatabase in order for the table generated from the QueryDef to have Object ID's. An Object ID column is required for a table to support selections. If the QueryDef includes a geometry column, a FeatureClass is created when the name object is opened.

How the PrimaryKey and CopyLocally properties are set determines whether or not the table will have an Object ID column. The following describes the various scenarios:

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
IQueryName2.getPrimaryKey(),

There are three ways in which Object ID's are assigned to a table:


Direct - The values from the primary key field are used directly as Object ID's. Here the primary key must be a single field and of integer type.

Wrapped - The primary key values are mapped to unique integer values which are used as the Object ID's. The primary key in this case is set to a list of fields (i.e. composite keys) or a single non-integer field. Two mapping tables are created in memory (Object ID-> PrimaryKey, PrimaryKey-> Object ID). If the tables are too large to fit in memory, virtual memory will be used.


Copy - No primary key is set and CopyLocally is set to True. In this case, the table is copied into the scratch workspace and an Object ID field is appended. The scratch workspace is usually under your system temp directory in a file named mx<n>.mdb.


With copy tables, the fields are renamed (A.field1-> A_field1), but the qualified name is still the alias name.


If you are working with feature classes use FeatureQueryName rather than TableQueryName.

The following diagram illustrates how the criteria described above is used to generate tables from TableQueryNames and FeatureQueryNames:


Method Summary
 String getPrimaryKey()
          The primary key field names.
 boolean isCopyLocally()
          Indicates if the data must be copied locally.
 void setCopyLocally(boolean copyLocally)
          Indicates if the data must be copied locally.
 void setPrimaryKey(String fieldNames)
          The primary key field names.
 
Methods inherited from interface com.esri.arcgis.geodatabase.IQueryName
getQueryDef, setQueryDef
 

Method Detail

setCopyLocally

void setCopyLocally(boolean copyLocally)
                    throws IOException,
                           AutomationException
Indicates if the data must be copied locally.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
copyLocally - The copyLocally (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IQueryName2.getPrimaryKey(), IQueryName2

isCopyLocally

boolean isCopyLocally()
                      throws IOException,
                             AutomationException
Indicates if the data must be copied locally.

Remarks

By default, CopyLocally is set to False.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The copyLocally
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPrimaryKey

void setPrimaryKey(String fieldNames)
                   throws IOException,
                          AutomationException
The primary key field names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
fieldNames - The fieldNames (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrimaryKey

String getPrimaryKey()
                     throws IOException,
                            AutomationException
The primary key field names.

Remarks

The name of the field or fields to use for assigning Object ID's to the rows in the QueryDef. Provide a comma delimited string of field names for cases where more than one field is needed to provide a unique value for each row (i.e. composite keys)

Always provide fully qualified field names.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The fieldNames
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.