Вы находитесь на странице: 1из 42

PROGRESS

OBJECTSTORE
The ObjectStore Database Viewer
Release 7.2

Using the ObjectStore Database Viewer


ObjectStore Release 7.2 for all platforms 2010 Progress Software Corporation. All rights reserved. Progress software products are copyrighted and all rights are reserved by Progress Software Corporation. This manual is also copyrighted and all rights are reserved. This manual may not, in whole or in part, be copied, photocopied, translated, or reduced to any electronic medium or machine-readable form without prior consent, in writing, from Progress Software Corporation. The information in this manual is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear in this document. The references in this manual to specific platforms supported are subject to change. A (and design), Actional, Actional (and design), Allegrix, Allegrix (and design), Apama, Apama (and Design), Business Empowerment, DataDirect (and design), DataDirect Connect, DataDirect Connect64, DataDirect Technologies, DataDirect XQuery, DataXtend, Dynamic Routing Architecture, EasyAsk, EdgeXtend, Empowerment Center, Fathom, IntelliStream, Mindreef, Neon, Neon New Era of Networks, O (and design), ObjectStore, OpenEdge, PeerDirect, Persistence, POSSENET, Powered by Progress, PowerTier, Progress, Progress DataXtend, Progress Dynamics, Progress Business Empowerment, Progress Empowerment Center, Progress Empowerment Program, Progress OpenEdge, Progress Profiles, Progress Results, Progress Software Developers Network, Progress Sonic, ProVision, PS Select, SequeLink, Shadow, ShadowDirect, Shadow Interface, Shadow Web Interface, SOAPscope, SOAPStation, Sonic, Sonic ESB, SonicMQ, Sonic Orchestration Server, Sonic Software (and design), SonicSynergy, SpeedScript, Stylus Studio, Technical Empowerment, WebSpeed, and Your Software, Our TechnologyExperience the Connection are registered trademarks of Progress Software Corporation or one of its subsidiaries or affiliates in the U.S. and/or other countries. AccelEvent, Apama Dashboard Studio, Apama Event Manager, Apama Event Modeler, Apama Event Store, AppsAlive, AppServer, ASPen, ASP-in-a-Box, BusinessEdge, Cache-Forward, DataDirect Spy, DataDirect SupportLink, DataDirect XML Converters, Future Proof, Ghost Agents, GVAC, Looking Glass, ObjectCache, ObjectStore Inspector, ObjectStore Performance Expert, Pantero, POSSE, ProDataSet, Progress ESP Event Manager, Progress ESP Event Modeler, Progress Event Engine, Progress RFID, PSE Pro, SectorAlliance, SmartBrowser, SmartComponent, SmartDataBrowser, SmartDataObjects, SmartDataView, SmartDialog, SmartFolder, SmartFrame, SmartObjects, SmartPanel, SmartQuery, SmartViewer, SmartWindow, Sonic Business Integration Suite, Sonic Process Manager, Sonic Collaboration Server, Sonic Continuous Availability Architecture, Sonic Database Service, Sonic Workbench, Sonic XML Server, The Brains Behind BAM, WebClient, Who Makes Progress, and Your World. Your SOA. are trademarks or service marks of Progress Software Corporation or one of its subsidiaries or affiliates in the U.S. and other countries. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Any other trademarks or trade names contained herein are the property of their respective owners. ObjectStore includes software developed by the Apache Software Foundation (http://www.apache.org/). Copyright 20002003 The Apache Software Foundation. All rights reserved. The names Ant, Xerces, and Apache Software Foundation must not be used to endorse or promote products derived from the Products without prior written permission. Any product derived from the Products may not be called Apache, nor may Apache appear in their name, without prior written permission. For written permission, please contact apache@apache.org. ObjectStore includes the RSA Data Security, Inc. MD5 Message-Digest Algorithm. Copyright 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. ObjectStore includes 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. Copyright Updated: June 2008

Contents
Preface
Chapter 1
............................................... 3 9

Introduction to the Database Viewer . . . . . . . . . . . . . . . . . . . .

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

Using the Database Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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

Navigating to a Specific Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30


Focus on This . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Focus on Path to This . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Scroll to Target. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 XPath to This . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

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.

How This Book Is Organized


This book contains a the following chapters: Chapter 1, Introduction to the Database Viewer Provides an overview and describes the features of the Database Viewer interface. Chapter 2, Using the Database Viewer Describe the ways you can explore ObjectStore databases with the Database Viewer.

Progress Software on the World Wide Web


The Progress Software ObjectStore Web site (web.progress.com/objectstore) provides a variety of useful information about products, news and events, special programs, support, and training opportunities. Technical support is available to you as part of a valid maintenance contract. There are several ways to obtain information about purchasing maintenance: Through our Web site at web.progress.com/about/contact.html. By sending e-mail - In North America, customerservices-americas@progress.com - In Europe, the Midde East, and Asia, customerservicesemea@progress.com - In Asia Pacific, customerservices-asiapac@progress.com In North America, by calling 1-781-280-4833. After you purchase a maintenance contract, you can: Send questions to ostore-support@progress.com. Remember to include either the phrase "Technical Support Issue"or a valid Progress serial number as part of the subject line or your e-mail cannot be processed. Call the technical support organization to get help resolving problems. If you are in North America, call 1-781-280-4999. If you are outside North America, refer to the Technical Support Web site at web.progress.com/objectstore/contactobjectstore-support.html. File a report or question with technical support by going to
http://web.progress.com/objectstore/objectstore-support.html.

Access the following on the technical support Web site:

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

ActiveX Interface for ObjectStore User Guide

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

ActiveX Interface for ObjectStore User Guide

Chapter 1

Introduction to the Database Viewer


This section presents a conceptual overview of the Database Viewer and a description of its graphical interface. The Database Viewer is a graphical tool for viewing the contents of PSE Pro for Java databases. The Viewer displays database information in three ways: Logical view A logical view displays a selected subset of the persistent objects and classes in the database, showing the values of each objects properties. See Logical Views on page 11. Schema view A schema view displays a selected subset of the persistent classes stored in the database, showing the types of each classs properties. See Schema Views on page 14. Physical view A physical view displays the count and total size of persistent instances of each class. See Physical Views on page 15. In logical and schema views, the properties of the persistent classes consist of what in UML terms are attributes and relationships. You can navigate through the persistent objects in the database starting from a database root, from a class extent, or from the result of an XPath query. When you display a persistent object of interest, you can navigate to related persistent objects. The Database Viewer opens one database at a time, but you can run multiple instances of the Database Viewer.

Starting the Database Viewer


On Windows platforms, you can start the Database Viewer using a shortcut on the Windows Start menu. On all platforms you can start the Viewer from the command line. Before you run the Database Viewer, the JAVA_HOME environment variable must be set. From the Start menu From the Command line To start the Database Viewer from the Windows Start menu, select Programs > ObjectStore PSE Pro for Java 7.2.0 > Database Viewer. To start the Database Viewer from the command line, use the osview command. You can also specify the name of the database to open as an argument to osview. The

Release 7.2

The Database Viewer Interface

osview command is located in the PSEProJ\bin directory of the ObjectStore

installation.

The Database Viewer Interface


The following illustration shows the features of the Database Viewers graphical interface.

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

The ObjectStore Database Viewer

Chapter 1: Introduction to the Database Viewer

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

The ObjectStore Database Viewer

Chapter 1: Introduction to the Database Viewer

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.

Logical Views of Database Roots


A logical view of a database root shows the object associated with the root as well as any other objects related to that object. In order to display the logical view of a database root, double-click the entry in the Database Roots list or right-click the entry and select the Show Root Object item. The object viewing area displays the roots information.

See Exploring Database Roots on page 20 for more information on database roots.

Logical Views of Persistent Classes


A logical view of an entry in the Persistent Classes list displays information about the classs extent. In order to display a logical view of a persistent class, right-click the name of the class in the Persistent Classes list and select Show Class Extent.

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

The ObjectStore Database Viewer

Chapter 1: Introduction to the Database Viewer

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

XPath Query Area

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.

XPath Query Area


In the XPath query area, you can enter XPath queries to be executed against the database. The persistent objects returned by a query are displayed in the object viewing area. The XPath query area also displays the XPath expression that results when you rightclick an object and select the XPath to This from the pop-up menu. This expression can be edited and used for additional queries. Clicking the drop-down arrow at the right side of the XPath query area displays previously entered XPath expressions. See Using XPath Queries on page 31 for information on using XPath queries to explore a database.

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 ObjectStore Database Viewer

Chapter 1: Introduction to the Database Viewer

Database Viewer Options


You can change how the Database Viewer displays information. To change Database Viewer options, select Options > Choose Options from the Database Viewer menu. This displays the Database Viewer Options dialog.

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

Database Schema Information

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.

Database Schema Information


If the database of interest has had schema information prepared for it, you can load this information before opening the database. In this case, when you open the database, its properties will be defined by methods on the persistent classes, rather than simply using the classs raw data fields. For Java databases, the schema information is loaded by selecting File > Load Jar File from the Database Viewer menu. The .jar file contains the persistent classes of the application associated with the database. You can also load the schema information for Java databases by specifying the appropriate .jar files and/or directories containing .class files in the CLASSPATH environment variable. For more information on preparing and loading schema information, see Using Getter Methods on page 38.

18

The ObjectStore Database Viewer

Chapter 2

Using the Database Viewer


This section describes how to explore the structure and contents of a database with the Database Viewer. It describes the different ways you can use the Database Viewer to explore a database. It contains the following topics: Exploring a Database on page 19 Navigating to a Specific Object on page 30 Checking on Indexes on page 31 Using XPath Queries on page 31 Exporting Data in XML Format on page 36 Using Getter Methods on page 38

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.

Exploring Database Roots


Database roots are the entry points to ObjectStore databases; each root is associated with a user-defined object. To display a database root, double-click the name of the root in the Database Roots pane or right-click the name and select the pop-up Show Root Object entry. The object viewing area shows the objects associated with the database root.

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

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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).

Exploring a Classs Schema


To display a persistent classs schema and the schema of related classes, double-click the name of the class in the Persistent Classes list or right-click the classs name and select Show Class Schema from the pop-up menu. The schema for the class is displayed in the object viewing area:

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 ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

the object viewing area to the left of the class of interest. In the following illustration, the Department class refers to the Employee class.

Showing and Hiding Objects


By default, the Database Viewer shows objects of persistent classes and two levels of related objects. You can display related objects at additional levels by a variety of methods. Similarly if the display becomes too cluttered, the Database Viewer provides several methods to simplify it. Showing objects To display an object that is related to a single property, right-click on the property and select Show Target from the pop-up menu. You can also simply double-click the property.

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.

Changing the default

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

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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.

Zooming In and Out


The Database Viewer tool bar contains Zoom In and Zoom Out icons ( ). Use these icons to adjust the size of the displayed objects and

26

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

therefore the number of objects displayed without scrolling. Here is an illustration of a sample database at the default zoom level (fully zoomed in):

Here is the database zoomed out two levels:

Exploring Class Extents


All the instances of a given class, when considered together, make up the classs extent. To view the extent of a persistent class, in the Persistent Classes list right-click the name of the class and select Show Class Extent from the pop-up menu. The Database Viewer displays all the persistent instances of the class in the object

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.

Exploring a Physical View


The Database Viewer can show physical views of the database that display how objects are grouped into various categories and the total size of objects in those categories. In PSE Pro databases, all objects are shown in segment 0. When a PSE Pro databases segment 0 is expanded, the Database Viewer displays entries for the different categories into which objects can be grouped. Only categories that contain objects are shown. The entry for each category lists the total size of the

28

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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

Navigating to a Specific Object

Navigating to a Specific Object


Navigation to a specific object typically starts at a database root and follows a path along a series of objects. Several features of the Database Viewer assist this kind of navigation and are available on a pop-up menu when you right-click an object. These features include:
Focus on This Focus on Path to This Scroll to Target XPath to This

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.

Focus on Path to This


When you right-click on an object and select Focus on Path to This, the Database Viewer redraws the object viewing area and displays only the object of interest along with the complete path to the object. The following illustration shows the path to an Employee object starting from a database root named departmentRoot.

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

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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.

Using XPath Queries


You can use XPath queries to display a specific set of objects or a specific object in a database. When you execute an XPath query, the object viewing area displays the results. In many cases you will need to scroll the display or use the Zoom Out command to see more of the result set. To execute a query: 1 Enter an XPath expression in the XPath query area. 2 Press Enter or Return. The result set is displayed in the object viewing area.

Release 7.2

31

Using XPath Queries

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 ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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

Using XPath Queries

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 ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

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

Exporting Data in XML Format

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.

Exporting Data in XML Format


You can export the information that is displayed in the object viewing area to an XML file. The XML file will include the information that is currently displayed in the object viewing area plus all the information that is available by scrolling the display. 1 Select File > Export as XML from the Database Viewer menu. The Export as XML dialog is displayed. 2 Specify the file name and modify any of the following settings:

36

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

- 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

Using Getter Methods

<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.

Using Getter Methods


When you open a database in the Database Viewer without first loading the databases schema information, the named properties of persistent classes are based on the objects fields in Java databases. However, if you load the databases schema information before opening the database, each getter method in applications associated with the database defines a named property in the persistent class. In cases where a getter method defines a property with the same name as a field or data member, the Database Viewer uses the property defined by the getter method. In many cases using the getter methods may provide more usable information, for example, a field may store a date as a long, but a getter method may return a java.util.Date. Another reason for loading the schema information for Java databases is to make the full generic types for property names available. Without schema information, the generic type parameters are discarded, so, for example, Set<Employee> becomes Set and the type of the property becomes Object. When the schema information is loaded, the full generic types of fields and getter methods are used. For Java databases, getter methods take no arguments, return non-void results, and have names that begin with get or is, followed by the property name with its first letter capitalized.

38

The ObjectStore Database Viewer

Chapter 2: Using the Database Viewer

Loading Schema Information for Java Databases


Making use of schema information for Java databases is straight forward. All that is required is a .jar file that contains all the persistent classes in the database. To load the schema information: 1 Create a .jar file with all of the persistent classes in the application associated with the database if one does not exist. 2 From the Database Viewer menu select File > Load JAR File and load the .jar file from step 1. If the persistent classes in the database are in different .jar files, load them all before opening the database. 3 From the Database Viewer menu select File > Open and open the database. You can also make the schema information for Java databases available by specifying the .jar files and/or directories containing .class files in the CLASSPATH environment variable. In this case, you do not need to explicitly load the schema .jar files in the Database Viewer.

Release 7.2

39

Using Getter Methods

40

The ObjectStore Database Viewer

Вам также может понравиться