About Oracle ADF Domains

A domain is a special datatype used for Oracle ADF Business Components attributes. Oracle ADF Business Components attributes must be objects; they can't be primitive Java types. Attributes can be of standard Java objects, such as java.lang.String or they can be special Oracle ADF BC components called domains. The Oracle typemap maps all SQL types except VARCHAR2 to domains by default (VARCHAR2 is mapped to String).

Unlike most business components, domain implementation classes exist on the client tier as well as the business logic tier. The predefined domains, except interMedia domains (which reside in oracle.ord.im), reside in oracle.jbo.domain, and custom domains reside in the common subpackage of the business components package. Both packages are available on the client tier.

There are three types of domains:

Predefined Domains

Predefined domains are wrappers for SQL types such as NUMBER or BLOB. Predefined domains can all be created using constructors that take standard Java types, for example, you can pass an int to the Number() constructor. The predefined domains also have methods to convert them to standard Java classes, as well as methods that allow you to perform certain operations on them. For example you can use Number.intValue() to convert a Number domain to an int, or you can use methods like Number.add() to manipulate it directly.

Validation Domains

A validation domain's class is based on another class, either another domain or another Java class. Validation domains add business logic to every attribute that uses them as its type. Domain validation occurs when an object of that domain type is created. The data object can then be passed between the tiers without the need for reconstruction or revalidation.

Validation domains can have the same settings as entity attributes. When an entity attribute has a domain as its type, the attribute inherits the domain's settings. Attributes may further restrict domain settings, but may not make them less restrictive. For example, a domain could be marked Persistent, meaning no transient attribute can be of that domain type.

To create a validation domain, see Creating a Validation Domain.

Oracle Object Type Domains

Oracle object type domains are used exclusively for wrapping Oracle Object Types. These domains do not have a validate() method.

To create an Oracle object type domain, see Representing Column Objects as Business Components.


About Oracle ADF Business Components
About Business Domain Components, Data Model Components, and Organizational Components
About Oracle ADF Entity Objects
About Oracle ADF View Objects
About Entity Object Attributes
Implementing Type-Level Validation
Representing Oracle Object Types
About interMedia Types

 

Copyright © 1997, 2004, Oracle. All rights reserved.