public interface RowStructure
FullRowStructure for an example of structure that represents the "select all" attempt.
Non-expanded properties are logically part of this structure, but will only affect the hasExtents()
flag. In other words, non-expanded properties will be hydrated only if a non-expanded property is appended,
making hasExtents() return true (or use forceExtents().
Otherwise, non-expanded extents won't be hydrated.| Modifier and Type | Method and Description |
|---|---|
boolean |
addMultiplex(Property multiplex)
Append the multiplex to the row structure.
|
boolean |
addProperty(Property prop)
Append a property to the row structure.
|
boolean |
addRecid(Property recid)
Append the recid to the row structure.
|
void |
forceExtents()
Force the non-expanded extents to be hydrated.
|
int |
getCount()
Retrieve the number of SQL fields that will be interpreted by this row structure.
|
java.lang.Class<? extends DataModelObject> |
getDmoClass()
The DMO class whose properties are included in this structure.
|
DmoMeta |
getDmoMeta()
Retrieve the DMO meta used by the underlying DMO of this structure.
|
java.util.Iterator<Property> |
getProps()
Retrieve an iterator to all properties in this structure, including the recid and multiplex.
|
boolean |
hasExtents()
Check if this structure requires a hydration of non-expanded extent properties.
|
int |
hydrate(Session session,
java.sql.ResultSet resultSet,
int rsOffset,
BaseRecord r)
The core hydration logic based on the row structure.
|
default boolean |
isIncomplete()
Check if the structure is incomplete.
|
java.lang.Class<? extends DataModelObject> getDmoClass()
boolean addRecid(Property recid)
recid - The recid property to be appended to the structure.true if adding the recid to the row structure succeeded
If there is some invariant on the structure, adding props may fail.boolean addMultiplex(Property multiplex)
multiplex - The multiplex property to be appended to the structure.true if adding the multiplex to the row structure succeeded
If there is some invariant on the structure, adding props may fail.boolean addProperty(Property prop)
prop - The property to be appended to the structure.true if adding the prop to the row structure succeeded
If there is some invariant on the structure, adding props may fail.int getCount()
java.util.Iterator<Property> getProps()
boolean hasExtents()
addProperty(com.goldencode.p2j.persist.orm.Property) or forceExtents() was
called.true if this structure will also hydrate non-expanded properties.void forceExtents()
int hydrate(Session session, java.sql.ResultSet resultSet, int rsOffset, BaseRecord r) throws PersistenceException, java.sql.SQLException
session - The underlying session that generated the result-set. It is used only to emit
load SQLs for the non-expanded extents. If this is null, the non-expanded
extents will be skipped.resultSet - The result-set that provides the low-level data that should be hydrated into
the record.rsOffset - The offset where the DMO starts. This is the case for queries that had joins,
so the current record may not start at index 1.r - The record to be hydrated.PersistenceException - thrown when hydrating extents fails (as it requires extra SQL queries to be run).java.sql.SQLException - throw when failing to hydrate from the result-set.DmoMeta getDmoMeta()
default boolean isIncomplete()
FullRowStructure.true by default.