|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.geodatabase.IRelationshipClassEventsProxy
public class IRelationshipClassEventsProxy
Provides access to events that occur with a relationship class.
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.
RelationshipClass
,
IRelationshipClassEvents
,
esriRelRole
,
Serialized FormField Summary | |
---|---|
boolean |
noncastable
|
Fields inherited from class com.esri.arcgis.interop.Dispatch |
---|
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef |
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 |
removeListener(String iidStr,
Object theListener)
|
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 |
Field Detail |
---|
public boolean noncastable
Constructor Detail |
---|
public IRelationshipClassEventsProxy()
public IRelationshipClassEventsProxy(Object obj) throws IOException
IOException
protected IRelationshipClassEventsProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void onCreate(IRelationshipClassEventsOnCreateEvent theEvent) throws IOException, AutomationException
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).
onCreate
in interface IRelationshipClassEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void onDelete(IRelationshipClassEventsOnDeleteEvent theEvent) throws IOException, AutomationException
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).
onDelete
in interface IRelationshipClassEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void onChange(IRelationshipClassEventsOnChangeEvent theEvent) throws IOException, AutomationException
OnChange is fired if you do any of the following:
onChange
in interface IRelationshipClassEvents
theEvent
- The event
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |