All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.xmlmiddleware.xmldbms.maps.InlineClassMap

java.lang.Object
   |
   +----org.xmlmiddleware.xmldbms.maps.MapBase
           |
           +----org.xmlmiddleware.xmldbms.maps.ClassMapBase
                   |
                   +----org.xmlmiddleware.xmldbms.maps.InlineClassMap

public class InlineClassMap
extends ClassMapBase
Inlines an element type that might otherwise be mapped as a class; not for general use.

InlineClassMap is a cross between a ClassMap and a PropertyMap. It is similar to a ClassMap in that it contains lists of PropertyMaps, RelatedClassMaps, and InlineClassMaps for child elements, PCDATA, and attributes. It differs in that it doesn't have a table or base class property. Instead, its children are mapped to columns in the table of its parent class. This effectively "inlines" the element, treating it as if it didn't exist and its child elements, PCDATA, and attributes belonged to its parent.

An InlineClassMap is similar to a PropertyMap in that it contains order information. This allows inlined elements to be placed in the correct order in their parent.

For example, consider the following Book element:

    <Book>
       <Title>Programming with XML-DBMS</Title>
       <Author>
          <LastName>Bourret</LastName>
          <FirstName>Ronald</FirstName>
       </Author>
    </Book>
 

Normally, the Author element type would be mapped to its own table. If the Author element type is inlined, the references to the LastName and FirstName element types are mapped to columns in the Books table, as if the Author element did not exist.

Inlined element types can be nested arbitrarily deep. That is, an inlined element type may have inlined child elements. However, there can be at most one inlined element of a given type in any parent. If more than one inlined element of the same type were allowed in a given parent, extra information (which XML-DBMS does not store) would need to be stored in the database to reconstruct the inlined elements. (A single inlined element can be reconstructed without such information.) This restriction is unlikely to cause problems for most data-centric documents.

InlineClassMap inherits from ClassMapBase, which provides accessors element type name and accessors and mutators for attribute, PCDATA, and child element type maps. It adds accessors and mutators for order information.

InlineClassMaps are stored in ClassMaps and InlineClassMaps.

Version:
2.0
Author:
Ronald Bourret, 2001

Method Index

 o create(String, String)
Create a new InlineClassMap.
 o create(XMLName)
Create a new InlineClassMap.
 o getOrderInfo()
Get the information used to order the inlined element in its parent.
 o setOrderInfo(OrderInfo)
Set the information used to order the inlined element in its parent.

Methods

 o create
 public static InlineClassMap create(String uri,
                                     String localName)
Create a new InlineClassMap.

Parameters:
uri - Namespace URI of the element type being mapped. May be null.
localName - Local name of the element type being mapped.
Returns:
The InlineClassMap.
 o create
 public static InlineClassMap create(XMLName elementTypeName)
Create a new InlineClassMap.

Parameters:
elementTypeName - The element type name.
Returns:
The InlineClassMap.
 o getOrderInfo
 public final OrderInfo getOrderInfo()
Get the information used to order the inlined element in its parent.

Returns:
The order information. Null if the inlined element is not ordered.
 o setOrderInfo
 public void setOrderInfo(OrderInfo orderInfo)
Set the information used to order the inlined element in its parent.

Parameters:
orderInfo - The order information. Null if the inlined element is not ordered.

All Packages  Class Hierarchy  This Package  Previous  Next  Index