JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server 3.1 Application Development Guide
search filter icon
search icon

Document Information


Part I Development Tasks and Tools

1.  Setting Up a Development Environment

2.  Class Loaders

3.  Debugging Applications

Part II Developing Applications and Application Components

4.  Securing Applications

5.  Developing Web Services

6.  Using the Java Persistence API

7.  Developing Web Applications

8.  Using Enterprise JavaBeans Technology

9.  Using Container-Managed Persistence

GlassFish Server Support for CMP

CMP Mapping

Mapping Capabilities

The Mapping Deployment Descriptor File

Mapping Considerations

Join Tables and Relationships

Automatic Primary Key Generation

Fixed Length CHAR Primary Keys

Managed Fields

BLOB Support

CLOB Support

Automatic Schema Generation for CMP

Supported Data Types for CMP

Generation Options for CMP

Schema Capture

Automatic Database Schema Capture

Using the capture-schema Utility

Configuring the CMP Resource

Performance-Related Features

Version Column Consistency Checking

To Use Version Consistency

Relationship Prefetching

Read-Only Beans

Default Fetch Group Flags

Configuring Queries for 1.1 Finders

About JDOQL Queries

Query Filter Expression

Query Parameters

Query Variables

JDOQL Examples

Example 1

Example 2

Example 3

CMP Restrictions and Optimizations

Disabling ORDER BY Validation

Setting the Heap Size on DB2

Eager Loading of Field State

Restrictions on Remote Interfaces

PostgreSQL Case Insensitivity

No Support for lock-when-loaded on Sybase

Sybase Finder Limitation

Date and Time Fields


MySQL Database Restrictions

10.  Developing Java Clients

11.  Developing Connectors

12.  Developing Lifecycle Listeners

13.  Developing OSGi-enabled Java EE Applications

Part III Using Services and APIs

14.  Using the JDBC API for Database Access

15.  Using the Transaction Service

16.  Using the Java Naming and Directory Interface

17.  Using the Java Message Service

18.  Using the JavaMail API


Schema Capture

The following topics are addressed here:

Automatic Database Schema Capture

You can configure a CMP bean in GlassFish Server to automatically capture the database metadata and save it in a .dbschema file during deployment. If the sun-cmp-mappings.xml file contains an empty <schema/> entry, the cmp-resource entry in the glassfish-ejb-jar.xml file is used to get a connection to the database, and automatic generation of the schema is performed.

Note - Before capturing the database schema automatically, make sure you have a properly configured CMP resource. See Configuring the CMP Resource.

Using the capture-schema Utility

You can use the capture-schema command to manually generate the database metadata (.dbschema) file. For details, see the Oracle GlassFish Server 3.1-3.1.1 Reference Manual.

The capture-schema utility does not modify the schema in any way. Its only purpose is to provide the persistence engine with information about the structure of the database (the schema).

Keep the following in mind when using the capture-schema command: