Referring to entities outside a partial book.
[Query Object Framework]


Detailed Description

Partial book is a QofBook that lacks at least one of the key elements of a fully structured (complete) book:

Partial books are useful for query results, selective export and data mining but need to be merged back into standard books. It is not supported to construct a partial book and then convert the same book to a standard book.

Different backends have different requirements for a complete book - some (like gnucash) are highly customised to that application - however all complete QofBooks must be self-contained, only a partial book uses QofEntityReference.

To retain the relationships between entities, including between a partial and a complete book, QofEntityReference data is stored in the QofBook. This data should be read by backends that support partial books so that the exported data contains the GUID and QofIdType of the referenced entity. Even if that entity does not then exist within the partial book, it can be located when the partial book is merged back into the original, complete, book. (Remember that given the GUID and QofIdType of any QofEntity it is possible to uniquely identify that entity in another book.)

Entities in partial books may need to refer to the entities that remain within the partial book. Once all the entities you want are in the partial book, call qof_book_set_references to restore as many references as possible. Each object type is checked in turn, each entity of that type and then each parameter that can relate to another entity. Any references that cannot be found are left unset - depending on the object these may be undefined or NULL. (It is advisable to set all QOF parameters to either a default value or NULL in the create: routine for the object but QOF has no way of guaranteeing this.)


Files

file  qofreference.h
 Dealing with relationships between entities in partial books.


Generated on Fri May 12 18:00:36 2006 for QOF by  doxygen 1.4.4