Академический Документы
Профессиональный Документы
Культура Документы
OBJECTSTORE
The ObjectStore Database Viewer
Release 7.2
Contents
Preface
Chapter 1
............................................... 3 9
Starting the Database Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 The Database Viewer Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Logical Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Logical Views of Database Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Logical Views of Persistent Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Schema Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Physical Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 XPath Query Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Status Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Database Viewer Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Database Schema Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 2
19
Exploring a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Opening a Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Exploring Database Roots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Exploring a Classs Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Showing and Hiding Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Exploring Aggregates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Following Arrows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Zooming In and Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Exploring Class Extents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Exploring a Physical View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Checking on Indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Release 7.2
Contents
Using XPath Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 Exporting Data in XML Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 Using Getter Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Loading Schema Information for Java Databases . . . . . . . . . . . . . . . . . . 39
Preface
This book describes how to use the ObjectStore Database Viewer, a graphical tool for exploring PSE Pro for Java databases.
Release 7.2
Preface
- A template for submitting a support request. This helps you provide the necessary details, which speeds response time. - Solution Knowledgebase that you can browse and query. - Online documentation for all products. - White papers and short articles about using Progress products. - The latest versions of products, service packs, and publicly available, downloadable patches. - Support matrix that lists platform configurations supported by this release. - Support policies. - Local phone numbers and hours when support personnel can be reached. Technical Support can more quickly resolve your issue when you provide the appropriate information. You should always provide the following information when contacting technical support: Serial number for your software licence Case number (if you are calling about a previous problem) Your name Your company name and location (city, state or province, and country) Contact information Product name and version Operating system The urgency of the issue being reported Detailed problem description including specific symptoms, observations, and any troubleshooting steps you attempted
Education Services
To learn about standard course offerings and custom workshops, use the Progress education services site (web.progress.com/education). If you are in North America, you can call 1-800-477-6473 x4452 to register for classes. Information on current course offerings and pricing is also available by sending an e-mail message to classes@progress.com.
Searchable Documents
In addition to the online documentation that is included with your software distribution, the full set of product documentation is available at the Progress Software Developers Network (PSDN) section of the Progress Communities site at http://communities.progress.com/pcom/docs/DOC-16071. The site provides documentation for the most recent release as well as archived documentation sets from previous releases. Be sure to check this site for new information or documentation clarifications posted between releases.
Your Comments
4 ActiveX Interface for ObjectStore User Guide
Preface
Progress product development welcomes your comments about its documentation. Send any product feedback to ostore-support@progress.com. To expedite your documentation feedback, begin the subject with Technical Support Issue; Doc:. For example:
Subject: Technical Support Issue; Doc: Incorrect message on page 76 of reference manual
Third-Party Acknowledgments
This software makes use of the following third party products: Ant v1.6, Mortbay Jetty v6.1 and JXPath v 1.2. See the Apache License v2.0 in the installation directory in the docs/ThirdPartyLicenses folder for license information. Expat v9.5.1. Copyright 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The Java SE Runtime Environment (JRE) Version 6, developed by and copyright Sun Microsystems. See the Sun Microsystems, Inc. Binary Code License for the Java SE Runtime Environment (JRE) Version 6 and THIRDPARTYLICENSEREADME.txt in the installation directory in the docs/ThirdPartyLicenses folder for license information. Jchart2d v2.2.0. The contents of these files are subject to the GNU Lesser General Public License v.2.1 (the license). You may not use these files except in compliance with the license. You may obtain a copy of the license in the installation directory in the docs/ThirdPartyLicenses folder and a copy of the license and source code of these files can be obtained through www.psdn.com by following the instructions set forth therein. JSON. Copyright 2002 JSON.org. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,
Release 7.2
Preface
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. OpenDMK v 1.0-b2 and Restlet v 1.1m2. The contents of these files are subject to the Common Development and Distribution License (CDDL) Version 1.0 (the "License"). You may not use these files except in compliance with the License. You may obtain a copy of the License in the installation directory in the docs/ThirdPartyLicenses folder and a copy of the license and source code of these files can be obtained through www.psdn.com by following the instructions set forth therein. RSA Data Security, Inc. MD5 Copyright 1991-2 RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. Sun RPC v3.9 - Sun RPC is a product of Sun Microsystems, Inc. and is provided for unrestricted use provided that this legend is included on all tape media and as a part of the software program in whole or part. Users may copy or modify Sun RPC without charge, but are not authorized to license or distribute it to anyone else except as part of a product or program developed by the user. SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. Sun RPC is provided with no support and without any obligation on the part of Sun Microsystems, Inc. to assist in its use, correction, modification or enhancement. SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC OR ANY PART THEREOF. In no event will Sun Microsystems, Inc. be liable for any lost revenue or profits or other special, indirect and consequential damages, even if
Preface
Sun has been advised of the possibility of such damages. Sun Microsystems, Inc., 2550 Garcia Avenue, Mountain View, California 94043. Tanuki Software Java Service Wrapper. See the Tanuki Software, Inc. Development Software License Agreement, Version 1.0 in the installation directory in the docs/ThirdPartyLicenses folder for license information. This product includes software and documentation components developed in part by Silver Egg Technology, Inc.("SET") prior to 2001. All SET components were released under the following license. Copyright 2001 Silver Egg Technology. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub- license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Yahoo! User Interface Library - V 0.12.1. Copyright 2006 Yahoo! Inc. All rights reserved. The name Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this Software and products derived from this software without specific prior written permission of Yahoo! Inc. See the Yahoo! User Interface Library license V 0.12.1 in the installation directory in the docs/ThirdPartyLicenses folder for license information.
Release 7.2
Preface
Chapter 1
Release 7.2
installation.
The interface consists of three main sections for viewing database information: Database Roots list The Database Roots section at the upper left contains all the roots in the database. Persistent Classes list The Persistent Classes section at the lower left contains all the persistent classes in the database including ObjectStore and user-defined classes. Object viewing area The object viewing area to the right displays either a logical or physical view of the database information. A logical view shows information about a database root, persistent class, or a result set of an XPath query. Logical views depict objects as boxes with relationships to other objects shown by arrows. Physical views show a tree listing of objects in the database. The title of the object viewing area changes to reflect what information is being displayed. You can adjust the size of the main sections by dragging the dividers between the panes. In addition, the Database Viewer contains two other areas at the bottom of the window: XPath query entry In this text area, you can enter XPath queries to be executed against the database in order to display specific objects. In addition, an XPath expression is displayed here when you use the XPath to This command on a specific object.
10
Status area When the Database Viewer is carrying out an operation such as fetching objects in a database, the operation is displayed in the Status area. The Database Viewer tool bar contains the following commands: Previous View and Next View These commands step backwards and forwards through the various views you have used during the Database Viewer session. Zoom In and Zoom Out These commands determine the size and number of objects displayed in the object viewing area. When you hover the cursor over various commands and objects, the Database Viewer displays pop-up tool tips describing the commands or providing more information about the objects. Online help for the Database Viewer is available by selecting Help > Help from the Viewers menu. The Database Viewer remembers the settings for options, overall window size, and the size of the individual panes on a per-user basis. When you start the Viewer, the settings will be the same as they were when you last used it.
Logical Views
The Database Viewers logical view shows objects as boxes connected with arrowed lines in a format that resembles UML Class Diagrams. The title area of the box shows the objects class and the main area of the box shows the objects properties.
Objects
The title area displays the name of the objects class and the size and location of the object. The location is specified as database, segment, cluster, and object ID. For database, 1 refers to the currently opened database; subsequent numbers refer to affiliated databases. For PSE Pro databases, segment and cluster are always 0.If you hover the cursor over the size and location information, a pop-up shows more information including the name of the database as shown in the following illustration:
Release 7.2
11
Logical Views
The properties section contains two columns with the name of the property in bold text on the left and its value on the right. If the value of a property is another persistent object, a single arrow ( ) indicates the value is a single object and a multiheaded arrow ( ) indicates the value is an aggregate of some type. In cases where the name of an entry is shortened for legibility, such as the representation of the responsible_engineer property in the following illustration, hovering the cursor over it will display the full name of the entry.
By default, the Database Viewer shows objects along with two levels of related objects. You can navigate to related objects at additional levels by double-clicking or right-clicking the displayed objects; for more information, see Showing and Hiding Objects on page 23. You can also change the default behavior so that more or fewer levels are shown by changing the Auto-Navigation setting in the Database Viewer Options dialog; for more information, see Database Viewer Options on page 17 Arrays and Collections If an object to be displayed is an array or collection (an aggregate), by default the Database Viewer hides the actual array or collection object and indicates the property has multiple values. For example, in the following illustration the children property of the first part object contains several other part objects. You can change this behavior by disabling the Hide Arrays and Collections option at the Database Viewer Options dialog; this will display the array or collection object itself.
12
For information on how to change this option, see Database Viewer Options on page 17. For a comparison of the two ways aggregates can be displayed, see Exploring Aggregates on page 24. Relationships Lines represent the relationship between objects. The shapes of the arrow head and tail denote the type and direction of the relationship. For more information, see Exploring Database Roots on page 20. The title of the object viewing area is itself representative of the information displayed, for example, the name of the database root, or persistent class or XPath expression.
See Exploring Database Roots on page 20 for more information on database roots.
Class Extent
A classs extent consists of all the instances of the class that are stored in the database. When you display a class extent, the instances of the class are shown in the first
Release 7.2
13
Schema Views
column at the left of the view. Objects related to the the instances of the persistent classes are shown in the second and third columns.
By default the Database Viewer shows two levels of related objects. You can navigate to related objects at additional levels by double-clicking or right-clicking the displayed objects; for more information, see Showing and Hiding Objects on page 23. You can change the default behavior to show more or fewer levels by changing the Auto-Navigation setting in the Database Viewer Options dialog; for more information, see Database Viewer Options on page 17.
Schema Views
Schema views describe the layout of persistent objects stored in a database. A classs schema displays the persistent classs property names and their types. If a propertys type is a persistent object, the schema of the related object is also displayed. The
14
following illustration shows the schema of an example Department class as well as the schema of a related Employee class
To display the schema information for a persistent class, double-click the name of the class in the Persistent Class list or right-click the name and select Show Class Schema from the pop-up menu. See Exploring a Classs Schema on page 21 for a description of how to display schema information.
Physical Views
A physical view of a database displays a tree starting with a database. In PSE Pro databases all objects are included in a single segment named segment 0.Each line represents a database, segment, category or object type.
Release 7.2
15
Each entry in a physical view displays the total size of the objects in it. When fully expanded the entries display up to seven categories into which the objects are grouped. A category is listed only if it contains objects. The categories are: User-defined classes Arrays of user-defined classes Primitive types Arrays of primitive types ObjectStore classes (this includes ObjectStore API classes and internal classes) Arrays of ObjectStore classes Free space When you expand a category, the Database Viewer displays the count and total size of each type within the category; for more information, see Exploring a Physical View on page 28.
Status Area
The status area at the bottom of the Database Viewer shows the operation in progress such as fetching persistent objects or exporting information to an XML file.
16
The options you can change are: Box Width Specifies how wide in pixels the boxes in the object viewing area will be. Drag the slider control to the setting you want. Box Spacing Specifies the number of pixels between boxes in the object viewing area. Drag the slider control to the setting you want. Box Proportions Specifies the relative widths of the name and value columns representing the objects properties, as a percentage of the left hand column. Drag the slider control to the setting you want. Arrow Legend Specifies the colors to use for the arrowed lines between objects in the object viewing area. Click an arrows color block control to select the desired color. Page Size Specifies the page size assumed when computing whether two objects are on the same page or nearby pages. Select the desired setting from the drop-down list. Nearby Page Distance Specifies the multiple of the page size that is considered nearby. Select the desired setting from the drop-down list. Show Object Locations Specifies whether boxes that represent objects have a second title line that shows the size in bytes and physical location of a persistent object as database, segment, cluster, and object ID. Note that the number of bytes refers only to the object, not anything it points to.
Release 7.2
17
Auto Navigation Depth Specifies the number of levels of persistent object references to display when displaying logical and schema views. Select the desired setting from the drop-down list. Hide Arrays and Collections Specifies whether arrays and collections are displayed in their own boxes or only the objects they contain are displayed. Auto Refresh Interval Specifies the time interval at which Database Viewer checks for changes to the database. Select the desired setting from the drop-down list.
18
Chapter 2
Exploring a Database
Opening a Database
To open a database select File > Open Database or File > Open Recent from the Database Viewer menu and select the database you want to explore. You can also open a database by running the ObjectStore osview utility with the databases path name as an argument, for example:
osview C:\Development\pse\employees.pro.odb
Release 7.2
19
Exploring a Database
The Database Viewer loads the database, displaying the database roots and the persistent classes in the left-hand panes.
By default, two levels of related objects are also shown. If a property of an object has as a value an object that is hidden, you can display the related object by doubleclicking the name of the property or by right-clicking the property and selecting Show Target. If you double-click the name of the object in the objects title area or
20
right-click the name of the object and select Show All Targets, the Database Viewer displays all the related objects. The arrows on the lines connecting objects represent the type of relationship between the objects: An open arrow head denotes association (one-to-one or many-to-one). This arrow also denotes the direction of navigability. A open arrow with a diamond tail denotes aggregation (one-to-many) such as an array or collection. This arrow also denotes the direction of navigability. A closed, hollow arrow head denotes generalization (class inheritance); the arrow head denotes the superclass end. A dashed line indicates class inheritance when viewing a schema or an embedded relationship when viewing objects. A line with arrow heads at each end denotes a bidirectional relationship (two objects each with a property related to the other).
Release 7.2
21
Exploring a Database
A classs schema displays the names and types of the classs properties rather than its names and values. When you right-click on the schema of a class, the following pop-up menu appears:
Subclasses
You can discover what classes directly inherit from a class. To display the schemas of the classs subclasses, right-click on a class and select Show Subclasses from the pop-up menu. The schemas of the classs subclasses are displayed in the object viewing area to the left of the class. In the following illustration, the dashed line and the hollow arrow head indicate that SuperEmployee is a subclass of Employee.
Referring Classes
For a given class, you can also discover what other classes include properties that refer to the class. To display these referring classes, right-click the class and select Show Referring Classes from the pop-up menu. The referring classes are displayed in
22
the object viewing area to the left of the class of interest. In the following illustration, the Department class refers to the Employee class.
Release 7.2
23
Exploring a Database
To display objects that are related to all of an objects properties, right-click on the objects name in the title area and select Show All Targets from the pop-up menu. You can also simply double-click the objects name.
Hiding objects
If the Database Viewer display becomes too crowded, you can simplify the view by hiding objects you are not interested in. To hide an object that is related to a single property, right-click on the property and select Hide Target from the pop-up menu. To hide the objects that are related to all the objects properties, right-click on the objects name in the title area and select Hide All Targets from the pop-up menu. To hide a specific object, right-click the object and select Hide This from the pop-up menu. To hide all instances of a specific type of object, right-click an object of that type and select Hide All type from the pop-up menu, where type is the class name of the object for example, the Hide All com.progress.dataxtend.ostore.xpath.pojo.Department menu item in the illustrations above hides all instances of the persistent class Department.
You can change the Database Viewers default behavior of showing two levels of related objects as follows. 1 From the Database Viewers menu, select Options > Choose Options to display the Database Viewer Options dialog. 2 On the Database Viewer Options dialog, change the Auto Navigation Depth option to the level you want. 3 Click OK. The next time you view a database root or a persistent classs extent, the object viewing area will show related objects to the level you selected.
Exploring Aggregates
To reduce clutter, by default, collections and arrays (aggregates) are normally not displayed and the relationships between an object with an aggregate-valued property and the member objects of the aggregate are shown directly in the form of a multi-valued property. The persistent object that represents the aggregate is not
24
shown explicitly. In the following illustration of the default behavior, the employees property of the Department class is shown as having multiple values:
You can change this behavior to show arrays and collections if, for example, you are more interested in the physical structure of the database than in the conceptual structure. To show arrays and collections: 1 From the Database Viewer menu, select Options > Choose Options to display the Database Viewer Options dialog. 2 From the Database Viewer Options dialog, uncheck the Hide Arrays and Collections check box and click OK.
Release 7.2
25
Exploring a Database
When you next display the class extent, the employees property of the Department class is shown as having its actual value, an OSSmallSet as shown in the following illustration.
When first displayed, for clarity, only the first member of the aggregate is displayed. To display the rest of the members, double-click the name of the aggregate in the boxs title area; to display a single member, double-click in an individual line. Note: When an object representing an aggregate is displayed, such as the OSSmallSet shown above, the number of bytes listed is the number of bytes of the object itself not the total number of bytes of the objects it points to. If you hover the cursor over the name of the aggregate, a tool tip displays the number of members in it as size.
Following Arrows
In order to make it easier to follow an arrow to a related object, you can click the line, which then turns green.
26
therefore the number of objects displayed without scrolling. Here is an illustration of a sample database at the default zoom level (fully zoomed in):
Release 7.2
27
Exploring a Database
viewing area. The following illustration shows all the instances of a sample databases Trade class.
In many cases you need to scroll the display to view all instances in the classs extent. To display more instances of the extent in the object viewing area, use the Zoom Out command.
28
objects it contains. The following illustration shows the categories from an example database.
The available categories include user-defined classes, primitive types, ObjectStore classes, and so on; for the complete listing of categories, see Physical Views on page 15. When a category is expanded, the Database Viewer displays all the types in the category, along with the number of instances of the type and their total size. The following illustration shows four of a clusters categories fully expanded.
Release 7.2
29
Focus on This
When you right-click on an object and select Focus on This, the Database Viewer redraws the object viewing area and displays only the object of interest and its related objects. The object of interest becomes the top-most object displayed, no matter where in the path it actually exists.
Note: In the illustration above, the Hide Arrays and Collections option is disabled.
Scroll to Target
When you right-click a property of an object and select Scroll to Target, the display in the object viewing area is shifted so that it shows the target object. In cases where the property has multiple values, you may need to scroll or zoom the display to view all the targets. If you right-click an object name in the title area (instead of an object property) and select Scroll to Target, the Database Viewer redraws the display to show the targets of all the objects properties. In this case, also, you may need to scroll or zoom the display.
30
XPath to This
When you right-click an object and select XPath to This, the Database Viewer constructs the XPath expression leading to the object and places the expression in the XPath query area. If you execute this XPath query, the Database Viewer redraws the object viewing area and shows the object of interest as the top-most object at the upper left along with its related objects. You can also edit the XPath expression before you execute the query. For more information on using XPath queries to explore a database, see Using XPath Queries on page 31.
Checking on Indexes
When you right-click on a multi-valued property or on the title area of a collection object and select Show Indexes from the pop-up menu, the object viewing area displays a box labeled Indexes that contains the names of the indexes defined on the collection that holds the values of the property.
If you hover the cursor over the name of an index, a tool-tip appears with the options for the index and a full path if the path is too long to fit in the space in the Indexes box.
Note: In order to use the Show Indexes command for a collection that is a value of a database root, you need to disable the Hide Arrays and Collections option; see Database Viewer Options on page 17 and Exploring Aggregates on page 24 for more information.
Release 7.2
31
A common way to use XPath queries is to navigate from a database root whose value is an array or collection. For example, consider a sample database with a database root named departmentMap whose value is an OSHashMap as in the following illustration.
You can create an XPath query using a key, for example, departmentMap/Administration; the following illustration shows a section of the results from that query.
32
The following illustration shows a section of the results from the XPath expression
departmentMap/Administration/manager.
You can use predicates specified within square brackets in the XPath query. Predicates can use the comparison operators =, <, <=, >, and >=. The following illustration shows a section of the results from the XPath expression /employees[name="John Wyatt"].
Note: In the illustration above, the Auto Navigation Depth option is set to 1.
Release 7.2
33
Predicates can use subscripts to retrieve specified elements; the following illustration displays the results of an XPath query departmentMap/Administration/employees[6].
When the Database Viewer evaluates a predicate, whenever possible it uses database indexes to optimize retrieval speed. A query can use the XPath count() function. The argument to count() is an XPath expression and its return value is the number of data elements in the result set.
34
The following illustration shows an example of the result using the XPath count() function in the expression count(employees[department/name="Administration"]).
A dynamic extent is a set of all the objects of a particular persistent class. You can retrieve dynamic extents using an XPath expression with the following syntax: ObjectStore:extent("fully-qualified-class-name"). For example, the following illustration shows the results of the XPath query
Release 7.2
35
ObjectStore:extent("com.progress.dataxtend.ostore.xpath.pojo.SuperEm ployee")
For more information on the XPath syntax to use with the Database Viewer, see Interactive Exploration with osdbxml in the XPath Facility User Guide. XPath to This When you right click on an object and select XPath to This from the pop-up menu, the Database Viewer puts the XPath expression that will retrieve that object in the XPath query area. If you execute the query, the object viewing area redraws the display with the selected object as the top-level object at the upper left. In addition, you can also edit the XPath expression and execute the modified query.
36
- XPath By default, this is set to the XPath expression that represents the objects displayed in the object viewing area. - Maximum Number of XPath Results Specifies the maximum number of top-level objects for which to generate XML output. If set lower than the number of toplevel objects, the XML code contains a comment to this effect, such as <!--** excessively large result set terminated**-->. - Maximum Collection Size Specifies how many members of a collection to generate XML output for. If set lower than the actual number of members in a collection, the XML code contains a comment to this effect, such as <!--Omitted remaining 7 elements-->. - Maximum Nesting Level Specifies how many levels of related objects to generate XM output. If set lower than the actual number of levels of related objects in the collection, the XML code contains a comment to this effect, such as <!--Deeply nested properties employees, manager omitted.-->. 3 Click OK to generate the XML output. The following XML code shows sections of a data set exported with the Maximum Nesting Level set to 3.
<?xml version="1.0" encoding="UTF-8"?> <!-- departmentMap/Administration in C:\Development\pse\employees.pro.odb --> <result> <Department> <color>green</color> <colour>green</colour> <employees> <b>2</b> <ba>0102030204</ba> <bb>2</bb> <bbool>true</bbool> <bi>2251799813685248</bi> <bool>false</bool> <ca>abc</ca> <d>2.0</d> <date>2004-02-06T12:30:00.000-05:00</date> <dd>1.0</dd> <f>2.0</f> <ff>1.0</ff> <id>13</id> <ii>102</ii> <l>2</l> <ll>1002</ll> <name>Billy Rohr</name> <s>2</s> <salary>85600</salary> <ss>3</ss> <!--Recursive property department omitted.--> </employees> ... ... <manager> <b>0</b> <ba>0102030004</ba> <bb>0</bb>
Release 7.2
37
<bbool>true</bbool> <bi>0</bi> <bool>false</bool> <ca>abc</ca> <d>0.0</d> <date>2004-02-06T12:30:00.000-05:00</date> <dd>0.0</dd> <f>0.0</f> <ff>0.0</ff> <id>1</id> <ii>100</ii> <l>0</l> <ll>1000</ll> <name>Gary Bell</name> <s>0</s> <salary>215200</salary> <ss>1</ss> <!--Recursive property department omitted.--> </manager> <name>Administration</name> </Department> </result>
The Database Viewer exports data to XML in the same manner as does the ObjectStore osdbxml command line utility and the ObjectStore XPathAccess.printXPath() API. For more information on these, see Chapter 3, Tools Reference and Chapter 4, API Reference in the XPath Facility User Guide.
38
Release 7.2
39
40