com.esri.arcgis.geodatabase
Class IRowProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.IRowBufferProxy
          extended by com.esri.arcgis.geodatabase.IRowProxy
All Implemented Interfaces:
IRow, IRowBuffer, Externalizable, Serializable
Direct Known Subclasses:
IObjectProxy

public class IRowProxy
extends IRowBufferProxy
implements IRow, Serializable

Provides access to members that return information about the row, the table the row belongs to and storing and deleting the row.

Description

An instance of the Row object represents a persistent row in a Table. A row object is normally obtained from a cursor on a table (for example, ICursor::NextRow) or fetched directly using its Object ID (for example, ITable::GetRow).

Once retrieved, clients may query the row object for additional interfaces and invoke methods on the row object. The CLSID property of a Table determines the type of row object returned by the Table.

A new persistent row object is created using the ITable::CreateRow method. The act of creating a row assigns it identity.

A row has a set of fields. The set of fields for a row is the same as the set of fields for its table. In particular, the numeric index of a field in a table's fields collection is the same as the numeric index of the field in the row's fields collection. This means that application programs can and should cache field numeric indexes using the FindField method on table, rather than invoking the FindField method for each row returned by a Cursor.

Remarks

The IRow interface inherits from the IRowBuffer interface and includes properties and methods to get and set the row's values, detect whether the row has an Object ID (and retrieve it, if it does has one), get the row's table, delete the row, and persist any changes made to the row.

The OID property returns the unique object identifier for the Row that distinguishes it from other rows in the table. If the HasOID property returns false, then this row was returned from a table lacking a geodatabase-managed Object ID field. This generally occurs when the table is not registered with the geodatabase; see the IClassSchemaEdit::RegisterAsObjectClass method for more information.

The Store method is called by an application once it has modified the values of a Row. Calling the Store method triggers the following actions.

  1. The IRowEvents::OnChanged method is called for the Row being stored (the OnNew method is called if this is a newly created row being stored for the first time). A custom row object can implement the RowEvents::OnChanged method and take some special action when it is called—for example, update a special column in the row.
  2. The IRelatedObjectEvents::RelatedObjectChanged method is called for related objects in related object class if the table for this row is an object class that participates in relationship classes with notification.

Once Store is called on a Row object, all subsequent queries against the table within the same edit session using the geodatabase API will reflect the modified state of the row object.

The Delete method is called by an application to delete a row object from the database. Calling the Delete method triggers the following actions.

  1. The IRowEvents::OnDelete method is called for the Row being deleted. A custom row object can implement the IRowEvents::OnDelete method and take some special action when it is called.
  2. All relationships in which the row object participates are automatically deleted.

Once Delete is called on a Row object, all subsequent queries against the Table within the same edit session using the geodatabase API will reflect the deleted state of the row object.

The changes made to a row object using the Store and Delete methods will be committed to persistent store if the containing edit session is saved and no conflicts are detected. If the changes were made outside of an edit session, then the application program is responsible for directly managing underlying database transactions using the ITransactions interface on the Workspace.

Product Availability

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

See Also:
Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IRowProxy()
           
  IRowProxy(Object obj)
           
protected IRowProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void delete()
          Deletes the row.
 int getOID()
          The OID for the row.
 ITable getTable()
          The Table for the row.
 boolean isHasOID()
          Indicates if the row has an OID.
 void removeListener(String iidStr, Object theListener)
           
 void store()
          Stores the row.
 
Methods inherited from class com.esri.arcgis.geodatabase.IRowBufferProxy
getFields, getValue, setValue
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.geodatabase.IRowBuffer
getFields, getValue, setValue
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IRowProxy

public IRowProxy()

IRowProxy

public IRowProxy(Object obj)
          throws IOException
Throws:
IOException

IRowProxy

protected IRowProxy(Object obj,
                    String iid)
             throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class IRowBufferProxy
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class IRowBufferProxy
Throws:
IOException

isHasOID

public boolean isHasOID()
                 throws IOException,
                        AutomationException
Indicates if the row has an OID.

Remarks

If the table has been registered with the geodatabase it will have unique Object ID, automatically created by the register tool, and the HasOID property will be set to True. Tables not registered with the geodatabase will not have an OID column and the HasOID property will be set to False. See the IClassSchemaEdit::RegisterAsObjectClass method for more information.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
isHasOID in interface IRow
Returns:
The hasOID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOID

public int getOID()
           throws IOException,
                  AutomationException
The OID for the row.

Description

Gets the OID for a row in a table that has a unique Object ID, such as tables registered with the geodatabase.

Example:

if (pRow.isHasOID()) {

        System.out.print(pRow.getOID());

      }

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getOID in interface IRow
Returns:
The oID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getTable

public ITable getTable()
                throws IOException,
                       AutomationException
The Table for the row.

Description

Returns a pointer to the table the row belongs to.

Example:

ITable pTable;

pTable = pRow.getTable();


Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getTable in interface IRow
Returns:
A reference to a com.esri.arcgis.geodatabase.ITable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

store

public void store()
           throws IOException,
                  AutomationException
Stores the row.

Remarks

The Store method is called by an application once it has modified the values of a Row. Once Store is called on a Row object, all subsequent queries within the same edit session, using the Geodatabase API, will reflect the modified state of the Row object.

All edits to features that participate in a Topology or Geometric Network must be performed within an edit session and bracketed within an edit operation.

Calling the Store method triggers the following actions:

- The IRowEvents::OnChanged is called for the row being stored. The OnNew is called if this is a newly created row being stored for the first time. A custom row object can implement the OnChanged method and take some special action when it is called - for example; update a special column in the row

- The IRelatedObjectEvents::RelatedObjectChanged method is called for related objects in a related object class if the table for this row is an object class that participates in relationship classes with notification

Store should not be used for batch operations, such as updates or inserts. For performing a number of inserts or updates using cursors, refer to the ITable::Insert, ITable::Update, ITable::UpdateSearchedRows , IFeatureClass::Update andIFeatureClass::Insert. If an insert or update cursor is used on non-simple features (such as network features), the cursor will revert to using Store.

It is not necessary to explicitly call Connect on network features, this is handled polymorphically when Store is called on the feature. This is also the case with features in a Topology, Dirty Area creation is handled internally when Store is called.

Store should not be called inside of edit events, such as OnCreateFeature, OnChangeFeature or OnDeleteFeature. Even if you are modifying the geometry or other field values, Store will be called once the event is complete.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
store in interface IRow
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

delete

public void delete()
            throws IOException,
                   AutomationException
Deletes the row.

Remarks

All edits to features that participate in a Topology or Geometric Network must be performed within an edit session and bracketed within an edit operation.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
delete in interface IRow
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.