User Defined Relationship Dialog

Closed

This dialog lets you to set up relationships for user defined and predefined objects.

ClosedShow me

User Defined Relationship Dialog

It is displayed when you click the Relationships tab in the User Defined Objects dialog for a selected user defined or predefined object, and when you click Add or Edit in the dialog. To display the User Defined Objects dialog, select Database management | Users defined objects from the File menu.

Note

This dialog will be read-only if there is a network already open in the GeoPlan Window.

If user permissions have been enabled for the database, only Database Owners will be able to create and edit user defined relationships. A warning message, similar to the one below, will be displayed whenever users who are not Database Owners access the dialog:

Warning message displayed for a user who is not a Database Owner

Dialog description

Option

Description

All target objects

List of all the possible target object types for the network that the object selected in the Objects grid of the User Defined Objects dialog is associated with.

The list may contain user-defined object types as well as built-in, predefined, object types.

Related target objects

Target objects

Use the Remove targetand the Add target buttons to select the desired target object types.

Name

The name of the relationship.

Name must start with a letter and cannot contain spaces, characters or uppercase text.

The naming convention is to use the target object(s) first, followed by the source object (e.g. targetobjecttype_sourceobjecttype).

The relationship in the screenshot above is being specified between a user defined survey type (source) defined for Asset networks (see ams__survey in dialog titlebar) and two user-defined object types (targets).

Description

Relationship description.

Naming convention is of the type target - source.

Tip

This field appears in the Object Browser Window and helps identify the relationship.

Relationship purpose

Purpose of the relationship:

  • Association
  • Component
  • Connection

See Object Relationships for more information.

ID Field (Primary) / US ID Field

Field in the source object that the relationship will be based on.

This field usually contains the id of the target type, or the US node ID (for Collection Pipe relationships only).

This dropdown list will contain all the text fields with a minimum of 16 characters that are available for the source object type.

Select a field or type in your own field name.

ID Field (Secondary) / DS ID Field

Enabled for Collection Pipes (cams_pipe) targets only.

Field in the source object that the relationship will be based on. This field usually contains the DS node ID.

This dropdown list will contain all the text fields with a minimum of 16 characters that are available for the source object type.

Select a field or type in your own field name.

Asset Type Field / Link Suffix Field

Enabled for relationships with more than one target object type, such as Asset and Collection Pipe relationships.

Field in the source object that the relationship will be based on. This field usually contains the asset type of the target type (for asset relationship types) and the link suffix for Collection Pipe relationships.

This dropdown list will contain all the text fields with a minimum of 16 characters that are available for the source object type.

Select a field or type in your own field name.

SQL prefix (source -> target)

SQL name for the relationship under the form of an SQL prefix identifying the target(s) (source -> target).

This is useful when querying tables using SQL.

Prefix must start with a letter and cannot contain spaces, characters or uppecase text.

SQL prefix (target -> source)

SQL name for the relationship under the form of an SQL prefix identifying the source (target -> source).

This is useful when querying tables using SQL.

Prefix must start with a letter and cannot contain spaces, characters or uppercase text.

Autofill

Use this button to automatically generate fields for the relationship.

Users can use these suggestions or type their own.

The table below shows the default suggestions.

Let us imagine we are creating a relationship between a user defined survey type called MySurvey (source) which is valid for Asset networks, and two user defined objects, a link object type called MyLink and a node object type called MyNode (target).

The rightmost column of the table contains the suggestions for a worked example.

Field name Suggestion Example

Name

targetobjecttype_sourceobjecttype

link_node_survey

Description

target - source

MyLink\MyNode - MySurvey

Relationship purpose

No suggestion. It is up to the user to select the relationship purpose.

Empty

Select a relationship purpose.

ID Field (Primary) / US ID Field

targettype_id

(For Collection Pipe relationships - pipe_us_id)

node_id or link_id

ID Field (Secondary) / DS ID Field

n/a

(For Collection Pipe relationships - pipe_ds_id)

n/a

Asset Type Field / Link Suffix Field

For Asset relationships - asset_type

For Collection Pipe relationships - link_suffix

asset_type
SQL prefix (source -> target)

targettype_sourcetype_

link_node_survey_
SQL prefix (target -> source)

sourcetypeplural_

surveys_

The plural is used as this will allow us to find the many surveys associated with a node or link.

Minimum number of source objects

The minimum number of user defined objects that can be associated with this relationship.

When deleting an object (using the context menu in the Object Browser Window), an error message will be generated if the deletion would cause the number of user defined objects, associated with this relationship, to fall below the specified minimum.

This field is set to 0 for all predefined object relationships.

Maximum number of source objects

The maximum number of user defined objects that can be associated with this relationship.

When creating a new object (using the context menu in the Object Browser Window), an error message will be generated if the addition will cause the number of user defined objects associated with this relationship to exceed the specified maximum.

This field is set to 0 for all predefined object relationships.

See Managing User Defined Relationships for more information.

User Defined Objects

User Defined Objects Dialog

Object Relationships

Managing User Defined Relationships