com.esri.arcgis.geodatabase
Class IRelationshipClassEventsProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.IRelationshipClassEventsProxy
All Implemented Interfaces:
IRelationshipClassEvents, Externalizable, Serializable, EventListener

public class IRelationshipClassEventsProxy
extends com.esri.arcgis.interop.Dispatch
implements IRelationshipClassEvents, Serializable

Provides access to events that occur with a relationship class.

Description

Both the RelationshipClass and AttributedRelationshipClass object support IRelationshipClassEvents as an outoing interface to provide events when Relationship objects are created, deleted and changed. A Relationship object supporting IRelationship is passed in to allow you to identify the origin and destination objects as well as the RelationshipClass itself.

Appropriate places to begin listening to IRelationshipClassEvents on a RelationshipClass include from within an Editor Extension or within a Class Extension. You must specifically identify the RelationshipClass that you wish to listen to events on.

OnCreate is fired if you create a new simple or attributed relationship in one of the following ways :

Note that if you call IRelationshipClass.CreateRelationship on a simple relationship this changes the foreign key inside the destination object to point to the new origin object: i.e the old relationship is deleted in creating the new relationship. No OnDelete event will be fired corresponding to this implicit deletion. An application may be interested in the details of the relationship that was implicitly deleted. This can be achieved by getting the ISimpleRelationshipChanges interface on the Relationship object passed in to the OnCreate event. This interface has a single property OldOriginKey that the application can use to get the key of the origin object. Any further fetching of the old origin object is up to the application using this key.

OnDelete is fired if you delete a simple or attributed relationship in one of the following ways:

OnChange is fired if you do any of the following:

Note that one can also create and delete relationships implicitly by directly using put_Value to set the origin foreign key field inside the destination object in the case of a simple relationship class. However, no events in IRelationshipClassEvents will be fired if the user does this (for eg. uses the Table document to directly set foreign key values in the destination object).

An application wishing to track such changes must listen to IObjectClassEvents.OnChange on the destination object class and track changes to the foreign key using IRowChanges. Note that IObjectClassEvents.OnChange will not be fired on the destination object class in a simple relationship class if the user changes the foreign key value using IRelationshipClass.CreateRelationship or IRelationshipClass.DeleteRelationship

It is important to note that retrieving the origin object or the destination object will issue queries against the database to retrieve the object requrested. This can slow down the process of creating/modifying relationships - This is specially true for attributed relationships.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
RelationshipClass, IRelationshipClassEvents, esriRelRole, Serialized Form

Field Summary
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, E
 
Constructor Summary
  IRelationshipClassEventsProxy()
           
  IRelationshipClassEventsProxy(Object obj)
           
protected IRelationshipClassEventsProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void onChange(IRelationshipClassEventsOnChangeEvent theEvent)
          This event is fired when a relationship's attributes are updated.
 void onCreate(IRelationshipClassEventsOnCreateEvent theEvent)
          This event is fired when a new relationship is created in the relationship class.
 void onDelete(IRelationshipClassEventsOnDeleteEvent theEvent)
          This event is fired when an relationship is deleted from the relationship class.
 void readExternal(ObjectInput in)
           
 void removeListener(String iidStr, Object theListener)
           
 void writeExternal(ObjectOutput out)
           
 
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, queryInterface, release, setNativeMode, setPropertyByName, toString, vtblInvoke
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IRelationshipClassEventsProxy

public IRelationshipClassEventsProxy()

IRelationshipClassEventsProxy

public IRelationshipClassEventsProxy(Object obj)
                              throws IOException
Throws:
IOException

IRelationshipClassEventsProxy

protected IRelationshipClassEventsProxy(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 com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

onCreate

public void onCreate(IRelationshipClassEventsOnCreateEvent theEvent)
              throws IOException,
                     AutomationException
This event is fired when a new relationship is created in the relationship class.

Description

OnCreate is fired if you create a new simple or attributed relationship in one of the following ways :

Note that if you call IRelationshipClass::CreateRelationship on a simple relationship this changes the foreign key inside the destination object to point to the new origin object : i.e the old relationship is deleted in creating the new relationship. No OnDelete event will be fired corresponding to this implicit deletion. An application may be interested in the details of the relationship that was implicitly deleted. This can be achieved by getting the ISimpleRelationshipChanges interface on the Relationship object passed in to the OnCreate event. This interface has a single property OldOriginKey that the application can use to get the key of the origin object. Any further fetching of the old origin object is up to the application using this key.

Note that one can also create and delete relationships implicitly by directly using put_Value to set the origin foreign key field inside the destination object in the case of a simple relationship class. However, no events in IRelationshipClassEvents will be fired if the user does this (for eg. uses the Table document to directly set foreign key values in the destination object).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
onCreate in interface IRelationshipClassEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onDelete

public void onDelete(IRelationshipClassEventsOnDeleteEvent theEvent)
              throws IOException,
                     AutomationException
This event is fired when an relationship is deleted from the relationship class.

Description

OnDelete is fired if you delete a simple or attributed relationship in one of the following ways:

Note that one can also create and delete relationships implicitly by directly using put_Value to set the origin foreign key field inside the destination object in the case of a simple relationship class. However, no events in IRelationshipClassEvents will be fired if the user does this (for eg. uses the Table document to directly set foreign key values in the destination object).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
onDelete in interface IRelationshipClassEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

onChange

public void onChange(IRelationshipClassEventsOnChangeEvent theEvent)
              throws IOException,
                     AutomationException
This event is fired when a relationship's attributes are updated.

Description

OnChange is fired if you do any of the following:

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
onChange in interface IRelationshipClassEvents
Parameters:
theEvent - The event
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class com.esri.arcgis.interop.Dispatch
Throws:
IOException
ClassNotFoundException