All Packages Class Hierarchy This Package Previous Next Index
Class org.xmlmiddleware.xmldbms.maps.OrderInfo
java.lang.Object
|
+----org.xmlmiddleware.xmldbms.maps.MapBase
|
+----org.xmlmiddleware.xmldbms.maps.OrderInfo
- public class OrderInfo
- extends MapBase
Contains information about ordering child elements, PCDATA, or multiple
attribute values; not for general use.
Order occurs in two places in an XML document: the order of child
elements and PCDATA in a parent element, and the order of values in
multi-valued attributes (IDREFS, NMTOKENS, and ENTITIES).
There are three possible ways to order a given item:
- Use an OrderInfo object with an order column. This stores the order in a special
column in the database and guarantees that the document can be round-tripped
at the elements / attributes / PCDATA level. This method is usually used by
document-centric documents.
- Use an OrderInfo object with a fixed order value. This is useful
only for ordering child elements and cannot be used with all content
models, but is usually sufficient for data-centric documents that need to
be validated.
- Do not use an OrderInfo object. In this case, items are not
ordered. This is usually used by data-centric documents that do not need to
be validated.
OrderInfo objects are stored in PropertyMaps, RelatedClassMaps,
InlineClassMaps, RelatedTableMaps, and ElementInsertionMaps.
- Version:
- 2.0
- Author:
- Ronald Bourret, 1998-1999, 2001
-
UNORDERED
- Special value used to indicate that child is unordered.
-
create()
- Create a new OrderInfo object.
-
generateOrder()
- Get whether the order column value is generated.
-
getFixedOrderValue()
- Get the fixed order value.
-
getOrderColumn()
- Get the order column.
-
isAscending()
- Get whether the order is ascending.
-
orderValueIsFixed()
- Whether a fixed order value or an order column is used.
-
setFixedOrderValue(long)
- Set the fixed order value.
-
setGenerateOrder(boolean)
- Set whether to generate the order column value.
-
setIsAscending(boolean)
- Set whether the order is ascending.
-
setOrderColumn(Column)
- Set the order column.
UNORDERED
public static final long UNORDERED
- Special value used to indicate that child is unordered.
create
public static OrderInfo create()
- Create a new OrderInfo object.
- Returns:
- The OrderInfo object.
isAscending
public final boolean isAscending()
- Get whether the order is ascending.
- Returns:
- Whether the order is ascending.
setIsAscending
public void setIsAscending(boolean ascending)
- Set whether the order is ascending.
- Parameters:
- ascending - Whether the order is ascending.
orderValueIsFixed
public final boolean orderValueIsFixed()
- Whether a fixed order value or an order column is used.
- Returns:
- Whether a fixed order value is used.
getFixedOrderValue
public final long getFixedOrderValue()
- Get the fixed order value.
This method should be called only if a fixed order value is used -- that
is, if orderValueIsFixed() returns true. If orderValueIsFixed() returns false,
the returned value is undefined.
- Returns:
- The fixed order value. This is 0 by default.
setFixedOrderValue
public void setFixedOrderValue(long orderValue)
- Set the fixed order value.
This method sets the order column to null and whether to generate
order to false.
- Parameters:
- orderValue - The fixed order value.
getOrderColumn
public final Column getOrderColumn()
- Get the order column.
This method should be called only if an order column is used -- that
is, if orderValueIsFixed() returns false. If orderValueIsFixed() returns true,
the returned value is undefined.
- Returns:
- The order column.
setOrderColumn
public void setOrderColumn(Column orderColumn)
- Set the order column.
This method sets the fixed order value to 0.
- Parameters:
- orderColumn - The order column.
generateOrder
public boolean generateOrder()
- Get whether the order column value is generated.
This method should be called only if an order column is used -- that
is, if orderValueIsFixed() returns false. If orderValueIsFixed() returns true,
the returned value is undefined.
- Returns:
- Whether the order column value is generated.
setGenerateOrder
public void setGenerateOrder(boolean generateOrder)
- Set whether to generate the order column value.
This method can be called only if an order column is used -- that
is, if orderValueIsFixed() returns false.
- Parameters:
- generateOrder - Whether to generate the order column value. If the
order value is not generated, the order column must also be mapped as
a data column with a PropertyMap or ColumnMap.
All Packages Class Hierarchy This Package Previous Next Index