Interface to be implemented for any class wishing to be registered to provide extra validation in the offlinedb.
Factory class with methods for creating DBObjects for use in the offline API.
use IdentifierBasedID if a subclass of DBObjectID is *really* needed.
Extension of DBObjectProvider for the offline projects.
Manager that can be used to extend the offline databases's update logic.
Utility class for the offline database project.
Manager that can be used to extend the offline databases's validation logic.
If an attempt is made to update or delete an object that exists in a dependent offline provider, rather than the current provider then this exception is thrown.
Since JDeveloper 9.0.5 you have been able to store database object definitions in a Project using XML files. This support started as just Tables, and has now grown to support many database objects. It is known as the "Offline Database" (offlinedb). The reason for the name is to avoid user confusion with a live database connection (to a running database) in the database navigator.
The offlinedb is built on top of the underlying JDeveloper database metadata
API which from 10.1.3 is found in the
(The examples in this document contain code that does no error handling. This makes it easier to read for the purposes of this document but proper error handling should be included in real code.)
The starting point for using the
oracle.javatools.db api is
Once you have a
DBObjectProvider (provider) you can list,
create, update and delete object definitions in that provider, be it a live
Database or a Project containing xml files.
An offline database exists as an XML file within a project with the
extension ".offlinedb". To retrieve the
that file you use the
DBOBjectProviderFactory and pass the URL
in as the identifier.
import java.net.URL; import oracle.javatools.db.DBObjectProviderFactory; import oracle.jdeveloper.offlinedb.OfflineDBObjectProvider; ... URL url = ... OfflineDBObjectProvider provider = (OfflineDBObjectProvider)DBObjectProviderFactory.findOrCreateProvider( url );
To list the providers in a given project, there are static methods on
OfflineDBObjectProvider for searching the project's content set:
java.util.Iterator<OfflineDBObjectProvider> getProviderIterator(Project p)
java.util.List<OfflineDBObjectProvider> listDBObjectProviders(Project p)
Any database object xml file in an Offline Database should be a
DBObjectNode from which you can also access the
For examples of using a DBObjectProvider see the
DBObjectProvider documentation from the core
In the offlinedb specifically you can also do:
URL url = ... // url to fred.table xml file Table fred = (Table)( (OfflineDBObjectProvider)provider ).getObject( url );
provides the ability to fire create/edit/chooser dialogs for the user to
OfflineDBObjectProvider instances. These can be
used by an extension to prompt the user.
For example the following code will prompt the user to choose (or create) a provider in the given project and return you the result:
final OfflineDBObjectProvider provider = ProviderWizard.chooseProvider( project, true );
To provide this choice as part of a wizard process, the panel to use is
All objects in the API extend the
DBObject interface which
includes the method
getID(). This returns a
which is used to uniquely identify objects. The
DBObjectID returns the original object. All objects
that reference other objects in the API (FKConstraints, Synonyms, etc) use
DBObjectIDs to store the reference.