Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
36
Добавлен:
16.04.2013
Размер:
896.13 Кб
Скачать

&KDSWHU 8VLQJ 5HIHUHQWLDO ,QWHJULW\ 7ULJJHUV

6 Select the 6725( table checkbox.

7Click 2..

Rebuild triggers automatically creates referential integrity triggers for the STORE table based on the trigger referential integrity defined for the reference linking STORE and DISCOUNT.

8Double-click the 6725( table. The table property sheet appears.

9Click the 7ULJJHUV tab.

PDM Getting Started

 

$XWRPDWLF FUHDWLRQ RI WULJJHUV

The Triggers page appears. It shows that two triggers (AfterDeleteTrigger and BeforeUpdate Trigger) have been created. These two triggers correspond to the trigger referential integrity defined for the reference linking the STORE and DISCOUNT tables.

10Click &DQFHO.

You return to the PDM diagram.

 

PowerDesigner

&KDSWHU 8VLQJ 5HIHUHQWLDO ,QWHJULW\ 7ULJJHUV

3UHYLHZLQJ D WULJJHU

You will preview the trigger script for the AfterDeleteTrigger trigger created for the table STORE.

1Double-click the 6725( table. The table property sheet appears.

2Click the 7ULJJHUV tab. The Triggers page appears.

3Click the 7'$B6725( line. This is the AfterDeleteTrigger trigger created in the last lesson.

An arrow appears at the start of the line.

4Click the 3URSHUWLHV tool.

RU

Double-click the arrow at the start of the line. The trigger property sheet appears.

5Click the 3UHYLHZ tab.

PDM Getting Started

 

3UHYLHZLQJ D WULJJHU

The Preview page appears. It shows the trigger script with trigger template variables instantiated with the values for the STORE table.

6Click &DQFHO in each of the dialog boxes. You return to the PDM diagram.

What you learned In this section, you learned how to:

Define trigger implementation for referential integrity for a reference

Use Rebuild Triggers to automatically create triggers for a selected table

Preview the trigger script

 

PowerDesigner

&KDSWHU 8VLQJ 5HIHUHQWLDO ,QWHJULW\ 7ULJJHUV

*HQHUDWH D VFULSW IRU WULJJHUV

You will define parameters to generate the script for the triggers and procedures you defined.

1Select 'DWDEDVH*HQHUDWH 7ULJJHUV DQG 3URFHGXUHV from the menu bar. A dialog box containing the generation parameters appears.

2Type 787B75,* 64/ in the File Name box.

3In the 'LUHFWRU\ box, type or browse to the (;$03/(6 directory in the PowerDesigner path.

4Select the 6FULSW *HQHUDWLRQ radio button.

5Make sure all JHQHUDWLRQ SDUDPHWHUV are selected except for the following:

*URXSER[ 'HVHOHFWHG LWHPV

Triggers

Drop Trigger

 

 

Procedures Permission

These parameters generate all triggers.

For a complete description of generation parameters, see the

3K\VLFDO 'DWD 0RGHO 8VHU V *XLGH.

6Click the 2SWLRQV tab.

The Options page appears. It lists script generation options.

7Keep the default RSWLRQV.

8Click the 6HOHFWLRQ tab. The Selection page appears.

9Click the 'HVHOHFW $OO tool from the tool bar at the top of the page.

All the Checkboxes are cleared.

PDM Getting Started

 

*HQHUDWH D VFULSW IRU WULJJHUV

10 Select the 6725( table checkbox as shown below.

11Click 2..

A result box appears showing the file path of the generated trigger script file.

12 Click the ILOH SDWK to select it, and then click the (GLW button.

 

PowerDesigner

&KDSWHU 8VLQJ 5HIHUHQWLDO ,QWHJULW\ 7ULJJHUV

The generated trigger script appears in a text editor.

13Select )LOH([LW to close the text editor. If you are prompted to save the file, click the No button.

14Click &ORVH to close the Result window.

15Close the Result List window. This is the Check Model result window. You return to the PDM diagram.

What you learned In this section, you learned how to:

Select options that will generate triggers

Generate a script for triggers

PDM Getting Started

 

*HQHUDWH D VFULSW IRU WULJJHUV

 

PowerDesigner

C H A P T E R 7

8VLQJ DEVWUDFW GDWD W\SHV

<RX PXVW KDYH DQ 2EMHFW 2ULHQWHG 0RGHO IRU WKLV OHVVRQ

This lesson can only be done if you have access to the PowerDesigner Object-Oriented Model (OOM). Certain versions of the PowerDesigner Physical Data Model (PDM) may not be bundled with the OOM. If you do not have access to the PowerDesigner Object-Oriented Model, you can skip this lesson and go directly to the next lesson

An DEVWUDFW GDWD W\SH $'7 is a user-defined data type which encapsulates a range of data values and functions. The functions can be both defined on, and operate on the set of values.

Depending on the current DBMS, PowerDesigner supports the following types of abstract data types:

 

Arrays

 

Lists

 

Java classes

 

Objects

 

Structured

 

You can specify and reverse engineer the definition for abstract data types

 

into a PDM. Once an abstract data type has been specified in the PDM, it can

 

be used by columns and domains in the same way as standard data types. In

 

this tutorial you will work with Java classes.

Java classes

In a PDM, abstract data types of the type -DYD class can be linked to Java

 

classes in the PowerDesigner Object-Oriented Model (OOM). This allows

 

you to access the property sheet of linked Java classes from the PDM.

 

To access Java class properties from the PDM, the Java class must exist in

 

the OOM. A Java class can be created directly, or reverse engineered into an

 

OOM.

PDM Getting Started

 

 

6SHFLI\LQJ DQ DEVWUDFW GDWD W\SH DV D -DYD FODVV

Why access a Java You can reverse engineer a database that contains Java classes that are used class? as data types for columns and domains into a PDM. These Java classes often

contain much more complex information than the length and precision properties of standard data types. You may need to have more information about the operations that the Java classes contains to understand the actions that it performs in the database.

You can access this information by reverse engineering the Java classes that are used in the PDM into an OOM. The Java classes in the PDM can be linked to the corresponding Java classes in the OOM. You can then access the property sheet for a Java class. You can study its operations and get a much more complete understanding of how a Java class operates as a column data type for a table in the database.

In this lesson you will:

Specify an abstract data type of type Java class in the PDM

Open an Object-Oriented Model (OOM)

Create a link between the Java class specified in the PDM and the corresponding Java class in the OOM

+RZ ORQJ ZLOO LW WDNH"

About 5 minutes.

 

PowerDesigner

Тут вы можете оставить комментарий к выбранному абзацу или сообщить об ошибке.

Оставленные комментарии видны всем.

Соседние файлы в папке PowerDesigner 9