BSchemaRowIDJoin Class Reference
[CoreDataManagerProvider]

#include <dmprovider/SchemaRowIDJoin.h>

Inheritance diagram for BSchemaRowIDJoin:

BMetaDataNode BGenericIterable BGenericNode BnIterable SSQLBuilder BnNode IIterable BBinder INode BBinder IInterface IBinder IInterface IBinder SAtom SAtom SAtom SAtom List of all members.

Detailed Description

Join operation between two BSchemaTableNode objects based on row ID.

This class provides a simple client-side join of two schema tables. It results in a new table node with an entry for each of the entries in the join table, which are then mapped back to a corresponding row id in the primary through joinIDCol. In other words, it supports a 1:N relationship between the primary:join, using Data Manager row IDs to map between them.

There are a number of limitations with the current implementation:

Note:
These classes are not a part of the OpenBinder build, but included as an example for other similar implementations.


Bookkeeping

Creation, destruction, locking, etc.

 BSchemaRowIDJoin (const SContext &context, const sptr< BSchemaTableNode > &primary, const sptr< BSchemaTableNode > &join, const SString &joinIDCol, const SString &primaryColumnName=SString())
 Create a new node containing a join between two BSchemaTableNode objects.
SContext Context ()
 Disambiguate.
virtual SValue Inspect (const sptr< IBinder > &caller, const SValue &which, uint32_t flags)
 Make INode and IIterable accessible.
virtual lock_status_t Lock () const
 Disambiguate.
status_t StatusCheck () const
 Return initialization status -- B_OK if all is well, else an error code.
virtual void Unlock () const
 Disambiguate.
virtual ~BSchemaRowIDJoin ()
 Clean up all resources.

Public Member Functions

Data Model Implementation
Provide default implementation based on new capabilities.

virtual status_t LookupEntry (const SString &entry, uint32_t flags, SValue *node)
 Implement by parsing name into primary and join row names and then calling NodeForLocked().
sptr< RowNodeNodeForLocked (const sptr< BSchemaTableNode::RowNode > &priNode, const sptr< BSchemaTableNode::RowNode > &joinNode)
 Return INode object for a particular table row ID.
Object Generation
virtual sptr< GenericIterator > NewGenericIterator (const SValue &args)
 Create and return a new iterator object.
virtual sptr< RowNodeNewRowNodeLocked (const sptr< BSchemaTableNode::RowNode > &priNode, const sptr< BSchemaTableNode::RowNode > &joinNode)
 Called when a new row object needs to be created.
Configuration
Functions for customizing how the join is exposed.

SString RowMimeTypeLocked () const
 Retrieve the MIME type of entries (row nodes).
virtual void SetMimeType (const SString &value)
 By default, clients are not allowed to modify the MIME type.
status_t StoreRowMimeTypeLocked (const SString &mimeType)
 Set the MIME type that all entries (row nodes) will report.

Friends

class JoinIterator
class RowNode

Classes

class  JoinIterator
 Iterator over a BSchemaTableNode. More...
struct  node_key
class  RowNode
 Node object generated for a row in a BSchemaRowIDJoin. More...


Constructor & Destructor Documentation

BSchemaRowIDJoin const SContext context,
const sptr< BSchemaTableNode > &  primary,
const sptr< BSchemaTableNode > &  join,
const SString joinIDCol,
const SString primaryColumnName = SString()
 

Create a new node containing a join between two BSchemaTableNode objects.

Parameters:
[in] context Hosting context (not needed by this class).
[in] primary The primary table of the join, containing the uniqueRecords.
[in] join The join table, which will be mapped back to the primary table through:
[in] joinIDCol Column in the join table that has the row ID of the entry in the corresponding primary table.
[in] primaryColumnName If set, the original primary table node will be available through a column with this name. If not set (the default) all primary columns will be joined directly into the new join table.

~BSchemaRowIDJoin  )  [protected, virtual]
 

Clean up all resources.


Member Function Documentation

SContext Context  )  [inline]
 

Disambiguate.

SValue Inspect const sptr< IBinder > &  caller,
const SValue which,
uint32_t  flags
[virtual]
 

Make INode and IIterable accessible.

Reimplemented from BnIterable.

lock_status_t Lock  )  const [virtual]
 

Disambiguate.

Reimplemented from BGenericIterable.

status_t LookupEntry const SString entry,
uint32_t  flags,
SValue node
[virtual]
 

Implement by parsing name into primary and join row names and then calling NodeForLocked().

Implements BGenericNode.

sptr< BGenericIterable::GenericIterator > NewGenericIterator const SValue args  )  [virtual]
 

Create and return a new iterator object.

Derived classes need to implement this to return their own GenericIterator subclass.

Implements BGenericIterable.

sptr< BSchemaRowIDJoin::RowNode > NewRowNodeLocked const sptr< BSchemaTableNode::RowNode > &  priNode,
const sptr< BSchemaTableNode::RowNode > &  joinNode
[virtual]
 

Called when a new row object needs to be created.

The default implementation instantiates and returns a new IndexedDatum object.

sptr< BSchemaRowIDJoin::RowNode > NodeForLocked const sptr< BSchemaTableNode::RowNode > &  priNode,
const sptr< BSchemaTableNode::RowNode > &  joinNode
 

Return INode object for a particular table row ID.

SString RowMimeTypeLocked  )  const
 

Retrieve the MIME type of entries (row nodes).

void SetMimeType const SString value  )  [virtual]
 

By default, clients are not allowed to modify the MIME type.

To use the normal BMetaDataNode implementation, override this to call directly to BGenericNode::SetMimeType(). To change the MIME type yourself, you can call SetMimeTypeLocked().

Reimplemented from BGenericNode.

status_t StatusCheck  )  const
 

Return initialization status -- B_OK if all is well, else an error code.

status_t StoreRowMimeTypeLocked const SString mimeType  ) 
 

Set the MIME type that all entries (row nodes) will report.

void Unlock  )  const [virtual]
 

Disambiguate.

Reimplemented from BGenericIterable.


Friends And Related Function Documentation

friend class JoinIterator [friend]
 

friend class RowNode [friend]
 


The documentation for this class was generated from the following files: