r15773 - gnucash/gobject-engine-dev-warlord - * Merge QofEntity into QofInstance

Derek Atkins warlord at cvs.gnucash.org
Sun Apr 1 18:19:00 EDT 2007


Author: warlord
Date: 2007-04-01 18:18:50 -0400 (Sun, 01 Apr 2007)
New Revision: 15773
Trac: http://svn.gnucash.org/trac/changeset/15773

Modified:
   gnucash/gobject-engine-dev-warlord/
   gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qof-backend-qsf.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-backend.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook-p.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofclass.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent-p.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofgobj.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid-p.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquery.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquerycore.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession-p.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.h
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.c
   gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.h
   gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-component-manager.c
   gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-sx-instance-model.c
   gnucash/gobject-engine-dev-warlord/src/backend/dwi/qofmap.c
   gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-backend-file.c
   gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-book-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-budget-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v2.c
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/PostgresBackend.c
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/book.c
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/events.c
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/putil.h
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/table.m4
   gnucash/gobject-engine-dev-warlord/src/backend/postgres/txn.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-bill-term-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-customer-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-employee-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-entry-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-invoice-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-job-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-order-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-tax-table-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-vendor-xml-v2.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddressP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTermP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomerP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployeeP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntryP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoiceP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJob.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJobP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrderP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTableP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c
   gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendorP.h
   gnucash/gobject-engine-dev-warlord/src/business/business-core/test/test-address.c
   gnucash/gobject-engine-dev-warlord/src/business/business-gnome/business-urls.c
   gnucash/gobject-engine-dev-warlord/src/business/business-gnome/gnc-plugin-business.c
   gnucash/gobject-engine-dev-warlord/src/doc/backend-api.txt
   gnucash/gobject-engine-dev-warlord/src/engine/Account.c
   gnucash/gobject-engine-dev-warlord/src/engine/Account.h
   gnucash/gobject-engine-dev-warlord/src/engine/FreqSpec.c
   gnucash/gobject-engine-dev-warlord/src/engine/FreqSpecP.h
   gnucash/gobject-engine-dev-warlord/src/engine/GNCId.h
   gnucash/gobject-engine-dev-warlord/src/engine/Period.c
   gnucash/gobject-engine-dev-warlord/src/engine/SX-book.c
   gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.c
   gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.h
   gnucash/gobject-engine-dev-warlord/src/engine/Scrub2.c
   gnucash/gobject-engine-dev-warlord/src/engine/Split.c
   gnucash/gobject-engine-dev-warlord/src/engine/Split.h
   gnucash/gobject-engine-dev-warlord/src/engine/SplitP.h
   gnucash/gobject-engine-dev-warlord/src/engine/Transaction.c
   gnucash/gobject-engine-dev-warlord/src/engine/Transaction.h
   gnucash/gobject-engine-dev-warlord/src/engine/TransactionP.h
   gnucash/gobject-engine-dev-warlord/src/engine/cap-gains.c
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.c
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.h
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-commodity.c
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot-p.h
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.c
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.h
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
   gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h
   gnucash/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c
   gnucash/gobject-engine-dev-warlord/src/engine/test/test-guid.c
   gnucash/gobject-engine-dev-warlord/src/engine/test/test-object.c
   gnucash/gobject-engine-dev-warlord/src/engine/test/test-recursive.c
   gnucash/gobject-engine-dev-warlord/src/engine/xlate.pl
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/account-quickfill.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-account-sel.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-main-window.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-account.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-budget.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-commodity.c
   gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c
   gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.c
   gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.h
   gnucash/gobject-engine-dev-warlord/src/gnome/dialog-sx-editor.c
   gnucash/gobject-engine-dev-warlord/src/gnome/druid-hierarchy.c
   gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.c
   gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.h
   gnucash/gobject-engine-dev-warlord/src/gnome/gnc-plugin-page-register.c
   gnucash/gobject-engine-dev-warlord/src/gnome/top-level.c
Log:
* Merge QofEntity into QofInstance
  - QofEntity -> QofInstance
  - qof_entity -> qof_instance
  - QOF_ENTITY -> QOF_INSTANCE
* remove references to instance.entity
* keep qof_entity_init() and qof_entity_release() for now



Property changes on: gnucash/gobject-engine-dev-warlord
___________________________________________________________________
Name: svk:merge
   - 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14364
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:1037
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/branches/gobject-engine-dev-warlord:14365
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:14282
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qof-backend-qsf.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qof-backend-qsf.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qof-backend-qsf.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -80,7 +80,7 @@
 written out, the reference can be included. When the file is imported back in, a
 little extra code then rebuilds those references during the merge.
 
-Copying entites from an existing QofBook using the qof_entity_copy routines will 
+Copying entites from an existing QofBook using the qof_instance_copy routines will 
 automatically create the reference table. If your QOF objects use references to other
 entities, books that are created manually also need to create a reference table.
 

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-backend.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-backend.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-backend.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -295,12 +295,12 @@
 }
 
 static void
-ent_ref_cb (QofEntity* ent, gpointer user_data)
+ent_ref_cb (QofInstance* ent, gpointer user_data)
 {
 	qsf_param *params;
-	QofEntityReference *ref;
-	void (*reference_setter) (QofEntity*, QofEntity*);
-	QofEntity *reference;
+	QofInstanceReference *ref;
+	void (*reference_setter) (QofInstance*, QofInstance*);
+	QofInstance *reference;
 	QofCollection *coll;
 	QofIdType type;
 
@@ -308,12 +308,12 @@
 	g_return_if_fail(params);
 	while(params->referenceList)
 	{
-		ref = (QofEntityReference*)params->referenceList->data;
+		ref = (QofInstanceReference*)params->referenceList->data;
 		if(qof_object_is_choice(ent->e_type)) { type = ref->choice_type; }
 		else { type = ref->type; }
 		coll = qof_book_get_collection(params->book, type);
 		reference = qof_collection_lookup_entity(coll, ref->ref_guid);
-		reference_setter = (void(*)(QofEntity*, QofEntity*))ref->param->param_setfcn;
+		reference_setter = (void(*)(QofInstance*, QofInstance*))ref->param->param_setfcn;
 		if(reference_setter != NULL)
 		{
 			qof_begin_edit((QofInstance*)ent);
@@ -337,7 +337,7 @@
 }
 
 /*================================================
-	Load QofEntity into QofBook from XML in memory
+	Load QofInstance into QofBook from XML in memory
 ==================================================*/
 
 static gboolean
@@ -370,7 +370,7 @@
 		if(!qof_class_is_registered(params->object_set->object_type)) { continue; }
 		inst = (QofInstance*)qof_object_new_instance(params->object_set->object_type, book);
 		g_return_val_if_fail(inst != NULL, FALSE);
-		params->qsf_ent = &inst->entity;
+		params->qsf_ent = inst;
 		qof_begin_edit(inst);
 		g_hash_table_foreach(params->qsf_parameter_hash, qsf_object_commitCB, params);
 		qof_commit_edit(inst);
@@ -644,7 +644,7 @@
 }
 
 static void
-qsf_from_coll_cb (QofEntity *ent, gpointer user_data)
+qsf_from_coll_cb (QofInstance *ent, gpointer user_data)
 {
 	qsf_param *params;
 	QofParam *qof_param;
@@ -654,7 +654,7 @@
 	params = (qsf_param*)user_data;
 	if(!ent || !params) { return; }
 	qof_param = params->qof_param;
-	guid_to_string_buff(qof_entity_get_guid(ent), qsf_guid);
+	guid_to_string_buff(qof_instance_get_guid(ent), qsf_guid);
 	node = xmlAddChild(params->output_node, xmlNewNode(params->qsf_ns,
 		BAD_CAST qof_param->param_type));
 	xmlNodeAddContent(node, BAD_CAST qsf_guid);
@@ -666,11 +666,11 @@
 static gint
 qof_reference_list_cb(gconstpointer a, gconstpointer b)
 {
-	const QofEntityReference *aa;
-	const QofEntityReference *bb;
+	const QofInstanceReference *aa;
+	const QofInstanceReference *bb;
 
-	aa = (QofEntityReference*) a;
-	bb = (QofEntityReference*) b;
+	aa = (QofInstanceReference*) a;
+	bb = (QofInstanceReference*) b;
 	if(aa == NULL) { return 1; }
 	g_return_val_if_fail((bb != NULL), 1);
 	g_return_val_if_fail((aa->type != NULL), 1);
@@ -683,11 +683,11 @@
 	return 1;
 }
 
-static QofEntityReference*
-qof_reference_lookup(GList *referenceList, QofEntityReference *find)
+static QofInstanceReference*
+qof_reference_lookup(GList *referenceList, QofInstanceReference *find)
 {
 	GList *single_ref;
-	QofEntityReference *ent_ref;
+	QofInstanceReference *ent_ref;
 
 	if(referenceList == NULL) { return NULL; }
 	g_return_val_if_fail(find != NULL, NULL);
@@ -695,7 +695,7 @@
 	ent_ref = NULL;
 	single_ref = g_list_find_custom(referenceList, find, qof_reference_list_cb);
 	if(single_ref == NULL) { return ent_ref; }
-	ent_ref = (QofEntityReference*)single_ref->data;
+	ent_ref = (QofInstanceReference*)single_ref->data;
 	g_list_free(single_ref);
 	return ent_ref;
 }
@@ -703,9 +703,9 @@
 static void
 reference_list_lookup(gpointer data, gpointer user_data)
 {
-	QofEntity *ent;
+	QofInstance *ent;
 	QofParam *ref_param;
-	QofEntityReference *reference, *starter;
+	QofInstanceReference *reference, *starter;
 	qsf_param  *params;
 	const GUID *guid;
 	xmlNodePtr node, object_node;
@@ -718,8 +718,8 @@
 	object_node = params->output_node;
 	ent = params->qsf_ent;
 	ns = params->qsf_ns;
-	starter = g_new(QofEntityReference, 1);
-	starter->ent_guid = qof_entity_get_guid(ent);
+	starter = g_new(QofInstanceReference, 1);
+	starter->ent_guid = qof_instance_get_guid(ent);
 	starter->type = g_strdup(ent->e_type);
 	starter->param = ref_param;
 	starter->ref_guid = NULL;
@@ -739,13 +739,13 @@
 		g_free(ref_name);
 	}
 	else {
-		ent = QOF_ENTITY(ref_param->param_getfcn(ent, ref_param));
+		ent = QOF_INSTANCE(ref_param->param_getfcn(ent, ref_param));
 		if(!ent) { return; }
 		if((0 == safe_strcmp(ref_param->param_type, QOF_TYPE_COLLECT)) ||
 			(0 == safe_strcmp(ref_param->param_type, QOF_TYPE_CHOICE)))
 		{ return; }
 		node = xmlAddChild(object_node, xmlNewNode(ns, BAD_CAST QOF_TYPE_GUID));
-		guid = qof_entity_get_guid(ent);
+		guid = qof_instance_get_guid(ent);
 		guid_to_string_buff(guid, qsf_guid);
 		xmlNodeAddContent(node, BAD_CAST qsf_guid);
 		xmlNewProp(node, BAD_CAST QSF_OBJECT_TYPE, BAD_CAST ref_param->param_name);
@@ -753,11 +753,11 @@
 }
 
 /*=====================================
-	Convert QofEntity to QSF XML node
+	Convert QofInstance to QSF XML node
 qof_param holds the parameter sequence.
 =======================================*/
 static void
-qsf_entity_foreach(QofEntity *ent, gpointer data)
+qsf_entity_foreach(QofInstance *ent, gpointer data)
 {
 	qsf_param  *params;
 	GSList     *param_list, *supported;
@@ -766,7 +766,7 @@
 	xmlNsPtr   ns;
 	gchar      *string_buffer;
 	QofParam   *qof_param;
-	QofEntity  *choice_ent;
+	QofInstance  *choice_ent;
 	KvpFrame   *qsf_kvp;
 	QofCollection *qsf_coll;
 	gint        param_count;
@@ -795,7 +795,7 @@
 		{
 			if(!own_guid)
 			{
-				cm_guid = qof_entity_get_guid(ent);
+				cm_guid = qof_instance_get_guid(ent);
 				node = xmlAddChild(object_node, xmlNewNode(ns, BAD_CAST QOF_TYPE_GUID));
 				guid_to_string_buff(cm_guid, cm_sa);
 				string_buffer = g_strdup(cm_sa);
@@ -827,13 +827,13 @@
 		if(0 == safe_strcmp(qof_param->param_type, QOF_TYPE_CHOICE))
 		{
 			/** \todo use the reference list here. */
-			choice_ent = QOF_ENTITY(qof_param->param_getfcn(ent, qof_param));
+			choice_ent = QOF_INSTANCE(qof_param->param_getfcn(ent, qof_param));
 			if(!choice_ent) {
 				param_list = g_slist_next(param_list);
 				continue;
 			}
 			node = xmlAddChild(object_node, xmlNewNode(ns, BAD_CAST qof_param->param_type));
-			cm_guid = qof_entity_get_guid(choice_ent);
+			cm_guid = qof_instance_get_guid(choice_ent);
 			guid_to_string_buff(cm_guid, cm_sa);
 			string_buffer = g_strdup(cm_sa);
 			xmlNodeAddContent(node, BAD_CAST string_buffer);
@@ -1047,7 +1047,7 @@
 }
 
 /* ======================================================
-	Commit XML data from file to QofEntity in a QofBook
+	Commit XML data from file to QofInstance in a QofBook
 ========================================================= */
 void
 qsf_object_commitCB(gpointer key, gpointer value, gpointer data)
@@ -1055,8 +1055,8 @@
 	qsf_param          *params;
 	qsf_objects        *object_set;
 	xmlNodePtr         node;
-	QofEntityReference *reference;
-	QofEntity          *qsf_ent;
+	QofInstanceReference *reference;
+	QofInstance          *qsf_ent;
 	QofBook            *targetBook;
 	const char         *qof_type, *parameter_name, *timechk;
 	QofIdType          obj_type, reference_type;
@@ -1077,14 +1077,14 @@
 	KvpValueType   cm_type;
 	QofSetterFunc  cm_setter;
 	const QofParam *cm_param;
-	void (*string_setter)    (QofEntity*, const gchar*);
-	void (*date_setter)      (QofEntity*, Timespec);
-	void (*numeric_setter)   (QofEntity*, gnc_numeric);
-	void (*double_setter)    (QofEntity*, double);
-	void (*boolean_setter)   (QofEntity*, gboolean);
-	void (*i32_setter)       (QofEntity*, gint32);
-	void (*i64_setter)       (QofEntity*, gint64);
-	void (*char_setter)      (QofEntity*, gchar);
+	void (*string_setter)    (QofInstance*, const gchar*);
+	void (*date_setter)      (QofInstance*, Timespec);
+	void (*numeric_setter)   (QofInstance*, gnc_numeric);
+	void (*double_setter)    (QofInstance*, double);
+	void (*boolean_setter)   (QofInstance*, gboolean);
+	void (*i32_setter)       (QofInstance*, gint32);
+	void (*i64_setter)       (QofInstance*, gint64);
+	void (*char_setter)      (QofInstance*, gchar);
 
 	g_return_if_fail(data && value && key);
 	params = (qsf_param*)data;
@@ -1102,11 +1102,11 @@
 	cm_param = qof_class_get_parameter(obj_type, parameter_name);
 	object_set = params->object_set;
 	if(safe_strcmp(qof_type, QOF_TYPE_STRING) == 0)  {
-		string_setter = (void(*)(QofEntity*, const gchar*))cm_setter;
+		string_setter = (void(*)(QofInstance*, const gchar*))cm_setter;
 		if(string_setter != NULL) { string_setter(qsf_ent, (gchar*)xmlNodeGetContent(node)); }
 	}
 	if(safe_strcmp(qof_type, QOF_TYPE_DATE) == 0) {
-		date_setter = (void(*)(QofEntity*, Timespec))cm_setter;
+		date_setter = (void(*)(QofInstance*, Timespec))cm_setter;
 		timechk = NULL;
 		timechk = strptime((char*)xmlNodeGetContent(node), QSF_XSD_TIME, &qsf_time);
 		g_return_if_fail(timechk != NULL);
@@ -1119,7 +1119,7 @@
 	}
 	if((safe_strcmp(qof_type, QOF_TYPE_NUMERIC) == 0)  ||
 	(safe_strcmp(qof_type, QOF_TYPE_DEBCRED) == 0)) {
-		numeric_setter = (void(*)(QofEntity*, gnc_numeric))cm_setter;
+		numeric_setter = (void(*)(QofInstance*, gnc_numeric))cm_setter;
 		string_to_gnc_numeric((char*)xmlNodeGetContent(node), &cm_numeric);
 		if(numeric_setter != NULL) { numeric_setter(qsf_ent, cm_numeric); }
 	}
@@ -1135,10 +1135,10 @@
 		reference_type = (char*)xmlGetProp(node, BAD_CAST QSF_OBJECT_TYPE);
 		if(0 == safe_strcmp(QOF_PARAM_GUID, reference_type))
 		{
-			qof_entity_set_guid(qsf_ent, cm_guid);
+			qof_instance_set_guid(qsf_ent, cm_guid);
 		}
 		else {
-			reference = qof_entity_get_reference_from(qsf_ent, cm_param);
+			reference = qof_instance_get_reference_from(qsf_ent, cm_param);
 			if(reference) {
 				params->referenceList = g_list_append(params->referenceList, reference);
 			}
@@ -1148,7 +1148,7 @@
 		errno = 0;
 		cm_i32 = (gint32)strtol ((char*)xmlNodeGetContent(node), &tail, 0);
 		if(errno == 0) {
-			i32_setter = (void(*)(QofEntity*, gint32))cm_setter;
+			i32_setter = (void(*)(QofInstance*, gint32))cm_setter;
 			if(i32_setter != NULL) { i32_setter(qsf_ent, cm_i32); }
 		}
 		else { qof_backend_set_error(params->be, ERR_QSF_OVERFLOW); }
@@ -1157,7 +1157,7 @@
 		errno = 0;
 		cm_i64 = strtoll((gchar*)xmlNodeGetContent(node), &tail, 0);
 		if(errno == 0) {
-			i64_setter = (void(*)(QofEntity*, gint64))cm_setter;
+			i64_setter = (void(*)(QofInstance*, gint64))cm_setter;
 			if(i64_setter != NULL) { i64_setter(qsf_ent, cm_i64); }
 		}
 		else { qof_backend_set_error(params->be, ERR_QSF_OVERFLOW); }
@@ -1166,7 +1166,7 @@
 		errno = 0;
 		cm_double = strtod((gchar*)xmlNodeGetContent(node), &tail);
 		if(errno == 0) {
-			double_setter = (void(*)(QofEntity*, double))cm_setter;
+			double_setter = (void(*)(QofInstance*, double))cm_setter;
 			if(double_setter != NULL) { double_setter(qsf_ent, cm_double); }
 		}
 	}
@@ -1176,7 +1176,7 @@
 			cm_boolean = TRUE;
 		}
 		else { cm_boolean = FALSE; }
-		boolean_setter = (void(*)(QofEntity*, gboolean))cm_setter;
+		boolean_setter = (void(*)(QofInstance*, gboolean))cm_setter;
 		if(boolean_setter != NULL) { boolean_setter(qsf_ent, cm_boolean); }
 	}
 	if(safe_strcmp(qof_type, QOF_TYPE_KVP) == 0) {
@@ -1190,7 +1190,7 @@
 	if(safe_strcmp(qof_type, QOF_TYPE_COLLECT) == 0) {
 		QofCollection *qsf_coll;
 		QofIdType type;
-		QofEntityReference *reference;
+		QofInstanceReference *reference;
 		QofParam *copy_param;
 		/* retrieve the *type* of the collection, ignore any contents. */
 		qsf_coll = cm_param->param_getfcn(qsf_ent, cm_param);
@@ -1202,11 +1202,11 @@
 			PINFO (" string to guid collect failed for %s", xmlNodeGetContent(node));
 			return;
 		}
-		/* create a QofEntityReference with this type and GUID.
+		/* create a QofInstanceReference with this type and GUID.
 		 there is only one entity each time.
 		 cm_guid contains the GUID of the reference.
 		 type is the type of the reference. */
-		reference = g_new0(QofEntityReference, 1);
+		reference = g_new0(QofInstanceReference, 1);
 		reference->type = g_strdup(qsf_ent->e_type);
 		reference->ref_guid = cm_guid;
 		reference->ent_guid = &qsf_ent->guid;
@@ -1219,7 +1219,7 @@
 	if(safe_strcmp(qof_type, QOF_TYPE_CHAR) == 0) {
 		char_getter = (gchar (*)(xmlNodePtr))xmlNodeGetContent;
 		cm_char = char_getter(node);
-		char_setter = (void(*)(QofEntity*, gchar))cm_setter;
+		char_setter = (void(*)(QofInstance*, gchar))cm_setter;
 		if(char_setter != NULL) { char_setter(qsf_ent, cm_char); }
 	}
 }

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -355,7 +355,7 @@
 			DEBUG (" trying to set book GUID");
 			buffer = g_strdup((gchar*)xmlNodeGetContent(child_node));
 			g_return_if_fail(TRUE == string_to_guid(buffer, &book_guid));
-			qof_entity_set_guid(QOF_ENTITY(params->book), &book_guid);
+			qof_instance_set_guid(QOF_INSTANCE(params->book), &book_guid);
 			xmlNewChild(params->output_node, params->qsf_ns, 
 			BAD_CAST QSF_BOOK_GUID, BAD_CAST buffer);
 			g_free(buffer);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/backend/file/qsf-xml.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -344,7 +344,7 @@
 	gint count;                  /**< sequential counter for each object in the book */
 	GList *qsf_object_list;      /**< list of qsf_objects */
 	GSList *qsf_sequence;        /**< Parameter list sorted into QSF order */
-	GList *referenceList;        /**< Table of references, ::QofEntityReference. */
+	GList *referenceList;        /**< Table of references, ::QofInstanceReference. */
 	GHashTable *qsf_parameter_hash; /**< Hashtable of parameters for each object */
 	GHashTable *qsf_calculate_hash, *qsf_default_hash, *qsf_define_hash;
 	GSList *supported_types;     /**< The list of QOF types currently supported, in QSF order. */
@@ -362,7 +362,7 @@
 	QofIdType qof_obj_type;	     /**< current QofObject type (e_type) for the parameters. */
 	QofIdType qof_foreach;       /**< How to iterate over hierarchical entities. */
 	gint foreach_limit;          /**< How many iterations are found in the QSF */
-	QofEntity *qsf_ent;          /**< Current entity in the book. */
+	QofInstance *qsf_ent;          /**< Current entity in the book. */
 	QofBackend *be;              /**< the current QofBackend for this operation. */
 	gboolean knowntype;          /**< detect references by comparing with known QOF types. */
 	QofParam *qof_param;         /**< used by kvp to handle the frame hash table */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -57,7 +57,7 @@
 {
 	qof_event_resume();
 }
-void gnc_engine_gen_event (QofEntity *entity, GNCEngineEventType event_type)
+void gnc_engine_gen_event (QofInstance *entity, GNCEngineEventType event_type)
 {
 	qof_event_gen(entity, event_type, NULL);
 }

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/deprecated.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -104,7 +104,7 @@
 /** \deprecated use qof_event_unregister_handler instead. */
 void gnc_engine_unregister_event_handler (gint handler_id);
 /** \deprecated use qof_event_gen instead. */
-void gnc_engine_gen_event (QofEntity *entity, GNCEngineEventType event_type);
+void gnc_engine_gen_event (QofInstance *entity, GNCEngineEventType event_type);
 /** \deprecated use qof_event_suspend instead. */
 void gnc_engine_suspend_events (void);
 /** \deprecated use qof_event_resume instead. */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -115,10 +115,10 @@
 /* Register books with the engine */
 gboolean qof_book_register (void);
 
-/** @deprecated use qof_entity_set_guid instead but only in
+/** @deprecated use qof_instance_set_guid instead but only in
 backends (when reading the GUID from the data source). */
 #define qof_book_set_guid(book,guid)    \
-         qof_entity_set_guid(QOF_ENTITY(book), guid)
+         qof_instance_set_guid(QOF_INSTANCE(book), guid)
 
 /* @} */
 /* @} */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -86,7 +86,7 @@
   qof_book_init(book);
   qof_object_book_begin (book);
 
-  qof_event_gen (&book->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&book->inst, QOF_EVENT_CREATE, NULL);
   LEAVE ("book=%p", book);
   return book;
 }
@@ -108,7 +108,7 @@
   ENTER ("book=%p", book);
 
   book->shutting_down = TRUE;
-  qof_event_force (&book->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_force (&book->inst, QOF_EVENT_DESTROY, NULL);
 
   /* Call the list of finalizers, let them do their thing. 
    * Do this before tearing into the rest of the book.
@@ -411,7 +411,7 @@
 gboolean qof_book_register (void)
 {
   static QofParam params[] = {
-    { QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_entity_get_guid, NULL },
+    { QOF_PARAM_GUID, QOF_TYPE_GUID, (QofAccessFunc)qof_instance_get_guid, NULL },
     { QOF_PARAM_KVP,  QOF_TYPE_KVP,  (QofAccessFunc)qof_instance_get_slots, NULL },
     { NULL },
   };

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbook.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -50,7 +50,7 @@
 
 /** Lookup an entity by guid, returning pointer to the entity */
 #define QOF_BOOK_LOOKUP_ENTITY(book,guid,e_type,c_type) ({  \
-  QofEntity *val = NULL;                                    \
+  QofInstance *val = NULL;                                    \
   if (guid && book) {                                       \
     QofCollection *col;                                     \
     col = qof_book_get_collection (book, e_type);           \
@@ -191,7 +191,7 @@
 gint64 qof_book_get_counter (QofBook *book, const char *counter_name);
 
 /** deprecated */
-#define qof_book_get_guid(X) qof_entity_get_guid (QOF_ENTITY(X))
+#define qof_book_get_guid(X) qof_instance_get_guid (QOF_INSTANCE(X))
 
 #endif /* QOF_BOOK_H */
 /** @} */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -74,7 +74,7 @@
 };
 
 static void
-collect_reference_cb (QofEntity *ent, gpointer user_data)
+collect_reference_cb (QofInstance *ent, gpointer user_data)
 {
 	struct collect_list_s *s;
 
@@ -89,7 +89,7 @@
 	QofBookMergeRule *currentRule;
 	QofCollection *mergeColl, *targetColl;
 	gchar      *stringImport, *stringTarget;
-	QofEntity  *mergeEnt, *targetEnt, *referenceEnt;
+	QofInstance  *mergeEnt, *targetEnt, *referenceEnt;
 	const GUID *guidImport, *guidTarget;
 	QofParam   *qtparam;
 	KvpFrame   *kvpImport, *kvpTarget;
@@ -97,13 +97,13 @@
 	QofType    mergeType;
 	GSList    *paramList;
 	gboolean  absolute, mergeError, knowntype, mergeMatch, booleanImport, booleanTarget,
-                                                 (*boolean_getter) (QofEntity*, QofParam*);
-	Timespec      tsImport, tsTarget,            (*date_getter)    (QofEntity*, QofParam*);
-	gnc_numeric   numericImport, numericTarget,  (*numeric_getter) (QofEntity*, QofParam*);
-	double        doubleImport, doubleTarget,    (*double_getter)  (QofEntity*, QofParam*);
-	gint32        i32Import, i32Target,          (*int32_getter)   (QofEntity*, QofParam*);
-	gint64        i64Import, i64Target,          (*int64_getter)   (QofEntity*, QofParam*);
-	gchar         charImport, charTarget,        (*char_getter)    (QofEntity*, QofParam*);
+                                                 (*boolean_getter) (QofInstance*, QofParam*);
+	Timespec      tsImport, tsTarget,            (*date_getter)    (QofInstance*, QofParam*);
+	gnc_numeric   numericImport, numericTarget,  (*numeric_getter) (QofInstance*, QofParam*);
+	double        doubleImport, doubleTarget,    (*double_getter)  (QofInstance*, QofParam*);
+	gint32        i32Import, i32Target,          (*int32_getter)   (QofInstance*, QofParam*);
+	gint64        i64Import, i64Target,          (*int64_getter)   (QofInstance*, QofParam*);
+	gchar         charImport, charTarget,        (*char_getter)    (QofInstance*, QofParam*);
 
 	g_return_val_if_fail((mergeData != NULL), -1);
 	currentRule = mergeData->currentRule;
@@ -140,7 +140,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_DATE) == 0) {
-			date_getter = (Timespec (*)(QofEntity*, QofParam*))qtparam->param_getfcn;
+			date_getter = (Timespec (*)(QofInstance*, QofParam*))qtparam->param_getfcn;
 			tsImport = date_getter(mergeEnt, qtparam);
 			tsTarget = date_getter(targetEnt, qtparam);
 			if(timespec_cmp(&tsImport, &tsTarget) == 0) { mergeMatch = TRUE; }
@@ -150,7 +150,7 @@
 		}
 		if((safe_strcmp(mergeType, QOF_TYPE_NUMERIC) == 0)  ||
 		(safe_strcmp(mergeType, QOF_TYPE_DEBCRED) == 0)) { 
-			numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			numericImport = numeric_getter(mergeEnt,qtparam);
 			numericTarget = numeric_getter(targetEnt,qtparam);
 			if(gnc_numeric_compare (numericImport, numericTarget) == 0) { mergeMatch = TRUE; }
@@ -167,7 +167,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_INT32) == 0) { 
-			int32_getter = (gint32 (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			int32_getter = (gint32 (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			i32Import = int32_getter(mergeEnt, qtparam);
 			i32Target = int32_getter(targetEnt, qtparam);
 			if(i32Target == i32Import) { mergeMatch = TRUE; }
@@ -176,7 +176,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_INT64) == 0) { 
-			int64_getter = (gint64 (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			int64_getter = (gint64 (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			i64Import = int64_getter(mergeEnt, qtparam);
 			i64Target = int64_getter(targetEnt, qtparam);
 			if(i64Target == i64Import) { mergeMatch = TRUE; }
@@ -185,7 +185,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_DOUBLE) == 0) { 
-			double_getter = (double (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			double_getter = (double (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			doubleImport = double_getter(mergeEnt, qtparam);
 			doubleTarget = double_getter(mergeEnt, qtparam);
 			if(doubleImport == doubleTarget) { mergeMatch = TRUE; }
@@ -194,7 +194,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_BOOLEAN) == 0){ 
-			boolean_getter = (gboolean (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			boolean_getter = (gboolean (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			booleanImport = boolean_getter(mergeEnt, qtparam);
 			booleanTarget = boolean_getter(targetEnt, qtparam);
 			if(booleanImport != FALSE && booleanImport != TRUE) { booleanImport = FALSE; }
@@ -213,7 +213,7 @@
 			knowntype= TRUE;
 		}
 		if(safe_strcmp(mergeType, QOF_TYPE_CHAR) == 0) { 
-			char_getter = (gchar (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			char_getter = (gchar (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			charImport = char_getter(mergeEnt, qtparam);
 			charTarget = char_getter(targetEnt, qtparam);
 			if(charImport == charTarget) { mergeMatch = TRUE; }
@@ -325,7 +325,7 @@
 is designed to solve the issues that result from this conflict. The previous match
 must be re-assigned because if two mergeEnt's are matched with only one targetEnt,
 data loss \b WILL follow. Equally, the current mergeEnt must replace the previous
-one as it is a better match. qof_entity_rating holds the details required to identify
+one as it is a better match. qof_instance_rating holds the details required to identify
 the correct mergeEnt to be re-assigned and these mergeEnt entities are therefore
 orphaned - to be re-matched later.
 
@@ -372,7 +372,7 @@
 {
 	GSList *orphans, *targets;
 	QofBookMergeRule *rule, *currentRule;
-	QofEntity *best_matchEnt;
+	QofInstance *best_matchEnt;
 	double difference;
 
 	g_return_if_fail(mergeData != NULL);
@@ -409,7 +409,7 @@
 }
 
 static void 
-qof_book_merge_foreach_target (QofEntity* targetEnt, gpointer user_data)
+qof_book_merge_foreach_target (QofInstance* targetEnt, gpointer user_data)
 {
 	QofBookMergeData *mergeData;
 
@@ -437,11 +437,11 @@
 }
 
 static void 
-qof_book_merge_foreach ( QofEntity* mergeEnt, gpointer user_data) 
+qof_book_merge_foreach ( QofInstance* mergeEnt, gpointer user_data) 
 {
 	QofBookMergeRule *mergeRule, *currentRule;
 	QofBookMergeData *mergeData;
-	QofEntity *targetEnt, *best_matchEnt;
+	QofInstance *targetEnt, *best_matchEnt;
 	GUID *g;
 	double difference;
 	GSList *c;
@@ -592,7 +592,7 @@
 { 
 	QofInstance *inst;
 	gboolean    registered_type;
-	QofEntity   *referenceEnt;
+	QofInstance   *referenceEnt;
 	/* cm_ prefix used for variables that hold the data to commit */
 	QofCollection *cm_coll;
 	QofParam    *cm_param;
@@ -600,26 +600,26 @@
 	const GUID  *cm_guid;
 	KvpFrame    *cm_kvp;
 	/* function pointers and variables for parameter getters that don't use pointers normally */
-	gnc_numeric  cm_numeric, (*numeric_getter)  (QofEntity*, QofParam*);
-	double       cm_double,  (*double_getter)   (QofEntity*, QofParam*);
-	gboolean     cm_boolean, (*boolean_getter)  (QofEntity*, QofParam*);
-	gint32       cm_i32,     (*int32_getter)    (QofEntity*, QofParam*);
-	gint64       cm_i64,     (*int64_getter)    (QofEntity*, QofParam*);
-	Timespec     cm_date,    (*date_getter)     (QofEntity*, QofParam*);
-	gchar        cm_char,    (*char_getter)     (QofEntity*, QofParam*);
+	gnc_numeric  cm_numeric, (*numeric_getter)  (QofInstance*, QofParam*);
+	double       cm_double,  (*double_getter)   (QofInstance*, QofParam*);
+	gboolean     cm_boolean, (*boolean_getter)  (QofInstance*, QofParam*);
+	gint32       cm_i32,     (*int32_getter)    (QofInstance*, QofParam*);
+	gint64       cm_i64,     (*int64_getter)    (QofInstance*, QofParam*);
+	Timespec     cm_date,    (*date_getter)     (QofInstance*, QofParam*);
+	gchar        cm_char,    (*char_getter)     (QofInstance*, QofParam*);
 	/* function pointers to the parameter setters */
-	void (*string_setter)    (QofEntity*, const gchar*);
-	void (*date_setter)      (QofEntity*, Timespec);
-	void (*numeric_setter)   (QofEntity*, gnc_numeric);
-	void (*guid_setter)      (QofEntity*, const GUID*);
-	void (*double_setter)    (QofEntity*, double);
-	void (*boolean_setter)   (QofEntity*, gboolean);
-	void (*i32_setter)       (QofEntity*, gint32);
-	void (*i64_setter)       (QofEntity*, gint64);
-	void (*char_setter)      (QofEntity*, gchar);
-	void (*kvp_frame_setter) (QofEntity*, KvpFrame*);
-	void (*reference_setter) (QofEntity*, QofEntity*);
-	void (*collection_setter)(QofEntity*, QofCollection*);
+	void (*string_setter)    (QofInstance*, const gchar*);
+	void (*date_setter)      (QofInstance*, Timespec);
+	void (*numeric_setter)   (QofInstance*, gnc_numeric);
+	void (*guid_setter)      (QofInstance*, const GUID*);
+	void (*double_setter)    (QofInstance*, double);
+	void (*boolean_setter)   (QofInstance*, gboolean);
+	void (*i32_setter)       (QofInstance*, gint32);
+	void (*i64_setter)       (QofInstance*, gint64);
+	void (*char_setter)      (QofInstance*, gchar);
+	void (*kvp_frame_setter) (QofInstance*, KvpFrame*);
+	void (*reference_setter) (QofInstance*, QofInstance*);
+	void (*collection_setter)(QofInstance*, QofCollection*);
 
 	g_return_if_fail(rule != NULL);
 	g_return_if_fail(mergeData != NULL);
@@ -630,8 +630,8 @@
 	if(rule->mergeResult == MERGE_NEW) {
 		inst = (QofInstance*)qof_object_new_instance(rule->importEnt->e_type, mergeData->targetBook);
 		g_return_if_fail(inst != NULL);
-		rule->targetEnt = &inst->entity;
-		qof_entity_set_guid(rule->targetEnt, qof_entity_get_guid(rule->importEnt));
+		rule->targetEnt = inst;
+		qof_instance_set_guid(rule->targetEnt, qof_instance_get_guid(rule->importEnt));
 	}
 	/* currentRule->targetEnt is now set,
 		1. by an absolute GUID match or
@@ -645,81 +645,81 @@
 		rule->mergeType = cm_param->param_type;
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_STRING) == 0)  { 
 			cm_string = cm_param->param_getfcn(rule->importEnt, cm_param);
-			string_setter = (void(*)(QofEntity*, const gchar*))cm_param->param_setfcn;
+			string_setter = (void(*)(QofInstance*, const gchar*))cm_param->param_setfcn;
 			if(string_setter != NULL) { string_setter(rule->targetEnt, cm_string); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_DATE) == 0) { 
-			date_getter = (Timespec (*)(QofEntity*, QofParam*))cm_param->param_getfcn;
+			date_getter = (Timespec (*)(QofInstance*, QofParam*))cm_param->param_getfcn;
 			cm_date = date_getter(rule->importEnt, cm_param);
-			date_setter = (void(*)(QofEntity*, Timespec))cm_param->param_setfcn;
+			date_setter = (void(*)(QofInstance*, Timespec))cm_param->param_setfcn;
 			if(date_setter != NULL) { date_setter(rule->targetEnt, cm_date); }
 			registered_type = TRUE;
 		}
 		if((safe_strcmp(rule->mergeType, QOF_TYPE_NUMERIC) == 0)  ||
 		(safe_strcmp(rule->mergeType, QOF_TYPE_DEBCRED) == 0)) { 
-			numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*))cm_param->param_getfcn;
+			numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*))cm_param->param_getfcn;
 			cm_numeric = numeric_getter(rule->importEnt, cm_param);
-			numeric_setter = (void(*)(QofEntity*, gnc_numeric))cm_param->param_setfcn;
+			numeric_setter = (void(*)(QofInstance*, gnc_numeric))cm_param->param_setfcn;
 			if(numeric_setter != NULL) { numeric_setter(rule->targetEnt, cm_numeric); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_GUID) == 0) { 
 			cm_guid = cm_param->param_getfcn(rule->importEnt, cm_param);
-			guid_setter = (void(*)(QofEntity*, const GUID*))cm_param->param_setfcn;
+			guid_setter = (void(*)(QofInstance*, const GUID*))cm_param->param_setfcn;
 			if(guid_setter != NULL) { guid_setter(rule->targetEnt, cm_guid); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_INT32) == 0) { 
-			int32_getter = (gint32 (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+			int32_getter = (gint32 (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 			cm_i32 = int32_getter(rule->importEnt, cm_param);
-			i32_setter = (void(*)(QofEntity*, gint32))cm_param->param_setfcn;
+			i32_setter = (void(*)(QofInstance*, gint32))cm_param->param_setfcn;
 			if(i32_setter != NULL) { i32_setter(rule->targetEnt, cm_i32); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_INT64) == 0) { 
-			int64_getter = (gint64 (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+			int64_getter = (gint64 (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 			cm_i64 = int64_getter(rule->importEnt, cm_param);
-			i64_setter = (void(*)(QofEntity*, gint64))cm_param->param_setfcn;
+			i64_setter = (void(*)(QofInstance*, gint64))cm_param->param_setfcn;
 			if(i64_setter != NULL) { i64_setter(rule->targetEnt, cm_i64); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_DOUBLE) == 0) { 
-			double_getter = (double (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+			double_getter = (double (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 			cm_double = double_getter(rule->importEnt, cm_param);
-			double_setter = (void(*)(QofEntity*, double))cm_param->param_setfcn;
+			double_setter = (void(*)(QofInstance*, double))cm_param->param_setfcn;
 			if(double_setter != NULL) { double_setter(rule->targetEnt, cm_double); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_BOOLEAN) == 0){ 
-			boolean_getter = (gboolean (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+			boolean_getter = (gboolean (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 			cm_boolean = boolean_getter(rule->importEnt, cm_param);
-			boolean_setter = (void(*)(QofEntity*, gboolean))cm_param->param_setfcn;
+			boolean_setter = (void(*)(QofInstance*, gboolean))cm_param->param_setfcn;
 			if(boolean_setter != NULL) { boolean_setter(rule->targetEnt, cm_boolean); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_KVP) == 0) { 
 			cm_kvp = kvp_frame_copy(cm_param->param_getfcn(rule->importEnt,cm_param));
-			kvp_frame_setter = (void(*)(QofEntity*, KvpFrame*))cm_param->param_setfcn;
+			kvp_frame_setter = (void(*)(QofInstance*, KvpFrame*))cm_param->param_setfcn;
 			if(kvp_frame_setter != NULL) { kvp_frame_setter(rule->targetEnt, cm_kvp); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_CHAR) == 0) { 
-			char_getter = (gchar (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+			char_getter = (gchar (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 			cm_char = char_getter(rule->importEnt,cm_param);
-			char_setter = (void(*)(QofEntity*, gchar))cm_param->param_setfcn;
+			char_setter = (void(*)(QofInstance*, gchar))cm_param->param_setfcn;
 			if(char_setter != NULL) { char_setter(rule->targetEnt, cm_char); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_COLLECT) == 0) {
 			cm_coll = cm_param->param_getfcn(rule->importEnt, cm_param);
-			collection_setter = (void(*)(QofEntity*, QofCollection*))cm_param->param_setfcn;
+			collection_setter = (void(*)(QofInstance*, QofCollection*))cm_param->param_setfcn;
 			if(collection_setter != NULL) { collection_setter(rule->targetEnt, cm_coll); }
 			registered_type = TRUE;
 		}
 		if(safe_strcmp(rule->mergeType, QOF_TYPE_CHOICE) == 0) {
 			referenceEnt = cm_param->param_getfcn(rule->importEnt, cm_param);
-			reference_setter = (void(*)(QofEntity*, QofEntity*))cm_param->param_setfcn;
+			reference_setter = (void(*)(QofInstance*, QofInstance*))cm_param->param_setfcn;
 			if(reference_setter != NULL) 
 			{ 
 				reference_setter(rule->targetEnt, referenceEnt); 
@@ -729,7 +729,7 @@
 		if(registered_type == FALSE) {
 			referenceEnt = cm_param->param_getfcn(rule->importEnt, cm_param);
 			if(referenceEnt) {
-				reference_setter = (void(*)(QofEntity*, QofEntity*))cm_param->param_setfcn;
+				reference_setter = (void(*)(QofInstance*, QofInstance*))cm_param->param_setfcn;
 				if(reference_setter != NULL) 
 				{ 
 					reference_setter(rule->targetEnt, referenceEnt); 
@@ -819,20 +819,20 @@
 gchar* qof_class_get_param_as_string(QofIdTypeConst, QofInstance*); ?
 */
 gchar*
-qof_book_merge_param_as_string(QofParam *qtparam, QofEntity *qtEnt)
+qof_book_merge_param_as_string(QofParam *qtparam, QofInstance *qtEnt)
 {
 	gchar       *param_string, param_date[QOF_DATE_STRING_LENGTH];
 	gchar       param_sa[GUID_ENCODING_LENGTH + 1];
 	QofType     paramType;
 	const GUID *param_guid;
 	time_t      param_t;
-	gnc_numeric param_numeric,  (*numeric_getter) (QofEntity*, QofParam*);
-	Timespec    param_ts,       (*date_getter)    (QofEntity*, QofParam*);
-	double      param_double,   (*double_getter)  (QofEntity*, QofParam*);
-	gboolean    param_boolean,  (*boolean_getter) (QofEntity*, QofParam*);
-	gint32      param_i32,      (*int32_getter)   (QofEntity*, QofParam*);
-	gint64      param_i64,      (*int64_getter)   (QofEntity*, QofParam*);
-	gchar       param_char,     (*char_getter)    (QofEntity*, QofParam*);
+	gnc_numeric param_numeric,  (*numeric_getter) (QofInstance*, QofParam*);
+	Timespec    param_ts,       (*date_getter)    (QofInstance*, QofParam*);
+	double      param_double,   (*double_getter)  (QofInstance*, QofParam*);
+	gboolean    param_boolean,  (*boolean_getter) (QofInstance*, QofParam*);
+	gint32      param_i32,      (*int32_getter)   (QofInstance*, QofParam*);
+	gint64      param_i64,      (*int64_getter)   (QofInstance*, QofParam*);
+	gchar       param_char,     (*char_getter)    (QofInstance*, QofParam*);
 
 	param_string = NULL;
 	paramType = qtparam->param_type;
@@ -842,7 +842,7 @@
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_DATE) == 0) { 
-			date_getter = (Timespec (*)(QofEntity*, QofParam*))qtparam->param_getfcn;
+			date_getter = (Timespec (*)(QofInstance*, QofParam*))qtparam->param_getfcn;
 			param_ts = date_getter(qtEnt, qtparam);
 			param_t = timespecToTime_t(param_ts);
 			strftime(param_date, QOF_DATE_STRING_LENGTH, QOF_UTC_DATE_FORMAT, gmtime(&param_t));
@@ -851,7 +851,7 @@
 		}
 		if((safe_strcmp(paramType, QOF_TYPE_NUMERIC) == 0)  ||
 		(safe_strcmp(paramType, QOF_TYPE_DEBCRED) == 0)) { 
-			numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_numeric = numeric_getter(qtEnt,qtparam);
 			param_string = g_strdup(gnc_numeric_to_string(param_numeric));
 			return param_string;
@@ -863,25 +863,25 @@
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_INT32) == 0) { 
-			int32_getter = (gint32 (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			int32_getter = (gint32 (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_i32 = int32_getter(qtEnt, qtparam);
 			param_string = g_strdup_printf("%d", param_i32);
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_INT64) == 0) { 
-			int64_getter = (gint64 (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			int64_getter = (gint64 (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_i64 = int64_getter(qtEnt, qtparam);
 			param_string = g_strdup_printf("%" G_GINT64_FORMAT, param_i64);
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_DOUBLE) == 0) { 
-			double_getter = (double (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			double_getter = (double (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_double = double_getter(qtEnt, qtparam);
 			param_string = g_strdup_printf("%f", param_double);
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_BOOLEAN) == 0){ 
-			boolean_getter = (gboolean (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			boolean_getter = (gboolean (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_boolean = boolean_getter(qtEnt, qtparam);
 			/* Boolean values need to be lowercase for QSF validation. */
 			if(param_boolean == TRUE) { param_string = g_strdup("true"); }
@@ -891,7 +891,7 @@
 		/* "kvp" contains repeating values, cannot be a single string for the frame. */
 		if(safe_strcmp(paramType, QOF_TYPE_KVP) == 0) { return param_string; }
 		if(safe_strcmp(paramType, QOF_TYPE_CHAR) == 0) { 
-			char_getter = (gchar (*)(QofEntity*, QofParam*)) qtparam->param_getfcn;
+			char_getter = (gchar (*)(QofInstance*, QofParam*)) qtparam->param_getfcn;
 			param_char = char_getter(qtEnt, qtparam);
 			param_string = g_strdup_printf("%c", param_char);
 			return param_string;

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofbookmerge.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -175,7 +175,7 @@
 	GSList *mergeParam;      /**< list of usable parameters for the object type */
 	GSList *linkedEntList;   /**< list of complex data types included in this object. 
 
-	linkedEntList contains an ::QofEntity reference to any parameter that is not
+	linkedEntList contains an ::QofInstance reference to any parameter that is not
 	one of the core QOF_TYPE data types. This entity must be already
     registered with QOF and the results of the comparison for the linked entity
     will modulate the mergeResult of this object. e.g. if an invoice is the
@@ -183,8 +183,8 @@
     MERGE_REPORT and the customer as MERGE_NEW.
 	*/
 	QofBookMergeResult mergeResult; /**< result of comparison with main ::QofBook */
-	QofEntity *importEnt;    /**< pointer to the current entity in the import book. */
-	QofEntity *targetEnt;    /**< pointer to the corresponding entity in the
+	QofInstance *importEnt;    /**< pointer to the current entity in the import book. */
+	QofInstance *targetEnt;    /**< pointer to the corresponding entity in the
                                 target book, if any. */
 }QofBookMergeRule;
 
@@ -194,7 +194,7 @@
 Used to dictate what to merge, how to merge it, where to get the new data and
 where to put the amended data. 
 
-Combines lists of \a ::QofParam, \a ::QofEntity and \a ::QofBookMergeRule
+Combines lists of \a ::QofParam, \a ::QofInstance and \a ::QofBookMergeRule
 into one struct that can be easily passed between callbacks. Also holds the
 pointers to the import and target ::QofBook structures.
 	
@@ -209,7 +209,7 @@
                                     parameter in the current object. */
 	GList 	*mergeList;          /**< GList of all ::qof_book_mergeRule rules
                                     for the merge operation. */
-	GSList 	*targetList;         /**< GSList of ::QofEntity * for each object
+	GSList 	*targetList;         /**< GSList of ::QofInstance * for each object
                                     of this type in the target book */
 	QofBook *mergeBook;          /**< pointer to the import book for this
                                     merge operation. */
@@ -218,16 +218,16 @@
 	gboolean abort;	             /**< set to TRUE if MERGE_INVALID is set. */
 	QofBookMergeRule *currentRule; /**< placeholder for the rule currently
                                     being tested or applied. */
-	GSList *orphan_list;         /**< List of QofEntity's that need to be rematched.
+	GSList *orphan_list;         /**< List of QofInstance's that need to be rematched.
 
-	When one QofEntity has a lower difference to the targetEnt than the
+	When one QofInstance has a lower difference to the targetEnt than the
     previous best_match, the new match takes precedence. This list holds those
     orphaned entities that are not a good enough match so that these can be
-    rematched later. The ranking is handled using the private QofEntityRating
+    rematched later. The ranking is handled using the private QofInstanceRating
     struct and the GHashTable ::QofBookMergeData::target_table.
 	*/
 	GHashTable *target_table;    /**< The GHashTable to hold the
-                                    QofEntityRating values.  */
+                                    QofInstanceRating values.  */
 
 }QofBookMergeData;
 
@@ -335,7 +335,7 @@
 routines for the target entity. The import entity is available for display.
 
 Uses ::qof_book_get_collection with the QofBookMergeRule::mergeType object
-type to return a collection of ::QofEntity entities from either the
+type to return a collection of ::QofInstance entities from either the
 QofBookMergeData::mergeBook or QofBookMergeData::targetBook. Then
 uses ::qof_collection_lookup_entity to lookup the QofBookMergeRule::importEnt
 and again the qof_book_mergeRule::targetEnt to return the two specific entities.
@@ -359,7 +359,7 @@
 parameter data.
 
 */
-gchar* qof_book_merge_param_as_string(QofParam *qtparam, QofEntity *qtEnt);
+gchar* qof_book_merge_param_as_string(QofParam *qtparam, QofInstance *qtEnt);
 
 /** \brief called by dialogue callback to set the result of user intervention
 

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofclass.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofclass.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofclass.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -267,7 +267,7 @@
 
 Simple check to return a GList of all parameters
 of this object type that are not known QOF data types.
-Used for partial QofBook support, see ::QofEntityReference
+Used for partial QofBook support, see ::QofInstanceReference
 */
 GList* qof_class_get_referenceList(QofIdTypeConst type);
 

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -48,6 +48,6 @@
 					QofEventId event_id);
 
 /* generates an event even when events are suspended! */
-void qof_event_force (QofEntity *entity, QofEventId event_id, gpointer event_data);
+void qof_event_force (QofInstance *entity, QofEventId event_id, gpointer event_data);
 
 #endif

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -203,7 +203,7 @@
 }
 
 static void
-qof_event_generate_internal (QofEntity *entity, QofEventId event_id, 
+qof_event_generate_internal (QofInstance *entity, QofEventId event_id, 
                             gpointer event_data)
 {
   GList *node;
@@ -275,7 +275,7 @@
 }
 
 void
-qof_event_force (QofEntity *entity, QofEventId event_id, gpointer event_data)
+qof_event_force (QofInstance *entity, QofEventId event_id, gpointer event_data)
 {
   if (!entity)
     return;
@@ -284,7 +284,7 @@
 }
 
 void
-qof_event_gen (QofEntity *entity, QofEventId event_id, gpointer event_data)
+qof_event_gen (QofInstance *entity, QofEventId event_id, gpointer event_data)
 {
   if (!entity)
     return;
@@ -300,7 +300,7 @@
 qof_event_generate (const GUID *guid, QofIdType e_type, 
 					QofEventId event_id)
 {
-  QofEntity ent;
+  QofInstance ent;
   ent.guid = *guid;
   ent.e_type = e_type;
   if (suspend_counter) return;

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofevent.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -81,7 +81,7 @@
  * @param handler_data:   data supplied when handler was registered.
  * @param event_data:   data to be supplied when handler is invoked.
  */
-typedef void (*QofEventHandler) (QofEntity *ent,  QofEventId event_type,
+typedef void (*QofEventHandler) (QofInstance *ent,  QofEventId event_type,
                                gpointer handler_data, gpointer event_data);
 
 /** \brief Register a handler for events.
@@ -113,14 +113,14 @@
    Any other events are entirely the concern of the application.
 
  \note QofEventHandler routines do \b NOT support generating
- events from a GUID and QofIdType - you must specify a genuine QofEntity.
+ events from a GUID and QofIdType - you must specify a genuine QofInstance.
 
  @param entity:     the entity generating the event
  @param event_type: the name of the event.
  @param event_data: Data to be passed to the event handler just for
  this one event. Can be NULL.
 */
-void qof_event_gen (QofEntity *entity, QofEventId event_type, 
+void qof_event_gen (QofInstance *entity, QofEventId event_type, 
                     gpointer event_data);
 
 /** \brief  Suspend all engine events.

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofgobj.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofgobj.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofgobj.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -202,7 +202,7 @@
  * of instances that we have on hand.
  */
 static void
-qof_gobject_foreach (QofCollection *coll, QofEntityForeachCB cb, gpointer ud)
+qof_gobject_foreach (QofCollection *coll, QofInstanceForeachCB cb, gpointer ud)
 {
   GSList *n;
   n = qof_collection_get_data (coll);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -38,13 +38,13 @@
 /** Set the ID of the entity, over-riding the previous ID. 
  *  Very dangerous, use only for file i/o work. 
  */
-void qof_entity_set_guid (QofEntity *ent, const GUID *guid);
+void qof_instance_set_guid (QofInstance *ent, const GUID *guid);
 
 /** Take entity, remove it from whatever collection its currently
  *  in, and place it in a new collection.  To be used only for
  *  moving entity from one book to another.
  */
-void qof_collection_insert_entity (QofCollection *, QofEntity *);
+void qof_collection_insert_entity (QofCollection *, QofInstance *);
 
 /** reset value of dirty flag */
 void qof_collection_mark_clean (QofCollection *);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -58,6 +58,58 @@
 
 /* =============================================================== */
 
+void
+qof_entity_init (QofInstance *ent, QofIdType type, QofCollection * tab)
+{
+  g_return_if_fail (NULL != tab);
+  
+  /* XXX We passed redundant info to this routine ... but I think that's
+   * OK, it might eliminate programming errors. */
+  if (safe_strcmp(tab->e_type, type))
+  {
+    PERR ("attempt to insert \"%s\" into \"%s\"", type, tab->e_type);
+    return;
+  }
+  ent->e_type = CACHE_INSERT (type);
+
+  do
+   {
+    guid_new(&ent->guid);
+
+    if (NULL == qof_collection_lookup_entity (tab, &ent->guid)) break;
+
+    PWARN("duplicate id created, trying again");
+  } while(1);
+ 
+  ent->collection = tab;
+
+  qof_collection_insert_entity (tab, ent);
+}
+
+void
+qof_entity_release (QofInstance *ent)
+{
+  if (!ent->collection) return;
+  qof_collection_remove_entity (ent);
+  CACHE_REMOVE (ent->e_type);
+  ent->e_type = NULL;
+}
+
+
+/* This is a restricted function, should be used only during 
+ * read from file */
+void
+qof_instance_set_guid (QofInstance *ent, const GUID *guid)
+{
+  QofCollection *col;
+  if (guid_equal (guid, &ent->guid)) return;
+
+  col = ent->collection;
+  qof_collection_remove_entity (ent);
+  ent->guid = *guid;
+  qof_collection_insert_entity (col, ent);
+}
+
 /* =============================================================== */
 
 static guint
@@ -129,7 +181,7 @@
 /* =============================================================== */
 
 void
-qof_collection_remove_entity (QofEntity *ent)
+qof_collection_remove_entity (QofInstance *ent)
 {
   QofCollection *col;
   if (!ent) return;
@@ -142,7 +194,7 @@
 }
 
 void
-qof_collection_insert_entity (QofCollection *col, QofEntity *ent)
+qof_collection_insert_entity (QofCollection *col, QofInstance *ent)
 {
   if (!col || !ent) return;
   if (guid_equal(&ent->guid, guid_null())) return;
@@ -155,9 +207,9 @@
 }
 
 gboolean
-qof_collection_add_entity (QofCollection *coll, QofEntity *ent)
+qof_collection_add_entity (QofCollection *coll, QofInstance *ent)
 {
-	QofEntity *e;
+	QofInstance *e;
 
 	e = NULL;
 	if (!coll || !ent) { return FALSE; }
@@ -172,7 +224,7 @@
 }
 
 static void
-collection_merge_cb (QofEntity *ent, gpointer data)
+collection_merge_cb (QofInstance *ent, gpointer data)
 {
 	QofCollection *target;
 
@@ -190,10 +242,10 @@
 }
 
 static void
-collection_compare_cb (QofEntity *ent, gpointer user_data)
+collection_compare_cb (QofInstance *ent, gpointer user_data)
 {
 	QofCollection *target;
-	QofEntity *e;
+	QofInstance *e;
 	gint value;
 
 	e = NULL;
@@ -241,10 +293,10 @@
 	return value;
 }
 
-QofEntity *
+QofInstance *
 qof_collection_lookup_entity (const QofCollection *col, const GUID * guid)
 {
-  QofEntity *ent;
+  QofInstance *ent;
   g_return_val_if_fail (col, NULL);
   if (guid == NULL) return NULL;
   ent = g_hash_table_lookup (col->hash_of_entities, guid);
@@ -255,13 +307,13 @@
 qof_collection_from_glist (QofIdType type, GList *glist)
 {
 	QofCollection *coll;
-	QofEntity *ent;
+	QofInstance *ent;
 	GList *list;
 
 	coll = qof_collection_new(type);
 	for(list = glist; list != NULL; list = list->next)
 	{
-		ent = QOF_ENTITY(list->data);
+		ent = QOF_INSTANCE(list->data);
 		if(FALSE == qof_collection_add_entity(coll, ent))
 		{
 			return NULL;
@@ -304,7 +356,7 @@
 {
   if (col->is_dirty)
     printf("%s collection is dirty.\n", col->e_type);
-  qof_collection_foreach(col, (QofEntityForeachCB)qof_instance_print_dirty, NULL);
+  qof_collection_foreach(col, (QofInstanceForeachCB)qof_instance_print_dirty, NULL);
 }
 
 /* =============================================================== */
@@ -324,20 +376,20 @@
 /* =============================================================== */
 
 struct _iterate {
-  QofEntityForeachCB      fcn;
+  QofInstanceForeachCB      fcn;
   gpointer                data;
 };
 
 static void foreach_cb (gpointer key, gpointer item, gpointer arg)
 {
   struct _iterate *iter = arg;
-  QofEntity *ent = item;
+  QofInstance *ent = item;
 
   iter->fcn (ent, iter->data);
 }
 
 void
-qof_collection_foreach (const QofCollection *col, QofEntityForeachCB cb_func, 
+qof_collection_foreach (const QofCollection *col, QofInstanceForeachCB cb_func, 
                         gpointer user_data)
 {
   struct _iterate iter;

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofid.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -111,7 +111,7 @@
 
 /** return TRUE if object is of the given type */
 #define QOF_CHECK_TYPE(obj,type) (((obj) != NULL) && \
-  (0 == QSTRCMP((type),(((QofEntity *)(obj))->e_type))))
+  (0 == QSTRCMP((type),(((QofInstance *)(obj))->e_type))))
 
 /** cast object to the indicated type,
 print error message if its bad  */
@@ -120,10 +120,11 @@
   (c_type *) (obj) :                                          \
   (c_type *) ({                                               \
      g_log (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,               \
-       "Error: Bad QofEntity at %s:%d", __FILE__, __LINE__);  \
+       "Error: Bad QofInstance at %s:%d", __FILE__, __LINE__);  \
      (obj);                                                   \
   }))
 
+
 /** QofCollection declaration 
 
 @param e_type QofIdType
@@ -134,15 +135,9 @@
 */
 typedef struct QofCollection_s QofCollection;
 
-/** @name QOF Entity Initialization & Shutdown 
- @{ */
-/** Initialise the memory associated with an entity */
-void qof_entity_init (QofEntity *, QofIdType, QofCollection *);
-                                                                                
-/** Release the data associated with this entity. Dont actually free
- * the memory associated with the instance. */
-void qof_entity_release (QofEntity *);
-/** @} */
+void qof_entity_init (QofInstance *ent, QofIdType type, QofCollection * tab);
+void qof_entity_release (QofInstance *ent);
+void qof_instance_set_guid (QofInstance *ent, const GUID *guid);
 
 /** Is QOF operating in "alternate" dirty mode.  In normal mode,
  *  whenever an instance is dirtied, the collection (and therefore the
@@ -162,7 +157,7 @@
 void qof_set_alt_dirty_mode (gboolean enabled);
 
 /** Return the GUID of this entity */
-const GUID * qof_entity_get_guid (const QofEntity *);
+const GUID * qof_instance_get_guid (const QofInstance *);
 
 /** @name Collections of Entities 
  @{ */
@@ -180,13 +175,13 @@
 QofIdType qof_collection_get_type (const QofCollection *);
 
 /** Find the entity going only from its guid */
-QofEntity * qof_collection_lookup_entity (const QofCollection *, const GUID *);
+QofInstance * qof_collection_lookup_entity (const QofCollection *, const GUID *);
 
 /** Callback type for qof_collection_foreach */
-typedef void (*QofEntityForeachCB) (QofEntity *, gpointer user_data);
+typedef void (*QofInstanceForeachCB) (QofInstance *, gpointer user_data);
 
 /** Call the callback for each entity in the collection. */
-void qof_collection_foreach (const QofCollection *, QofEntityForeachCB, 
+void qof_collection_foreach (const QofCollection *, QofInstanceForeachCB, 
                              gpointer user_data);
 
 /** Store and retreive arbitrary object-defined data 
@@ -218,13 +213,13 @@
 Entities can be
 freely added and merged across these secondary collections, they
 will not be removed from the original collection as they would
-by using ::qof_entity_insert_entity or ::qof_entity_remove_entity. 
+by using ::qof_instance_insert_entity or ::qof_instance_remove_entity. 
 
 */
 gboolean
-qof_collection_add_entity (QofCollection *coll, QofEntity *ent);
+qof_collection_add_entity (QofCollection *coll, QofInstance *ent);
 
-void qof_collection_remove_entity (QofEntity *ent);
+void qof_collection_remove_entity (QofInstance *ent);
 
 /** \brief Merge two QOF_TYPE_COLLECT of the same type.
 
@@ -232,8 +227,8 @@
 
 QOF_TYPE_COLLECT uses a secondary collection, independent of
 those in the book. Entities will not be removed from the
-original collection as when using ::qof_entity_insert_entity
-or ::qof_entity_remove_entity.
+original collection as when using ::qof_instance_insert_entity
+or ::qof_instance_remove_entity.
 
 */
 gboolean
@@ -241,7 +236,7 @@
 
 /** \brief Compare two secondary collections.
 
-Performs a deep comparision of the collections. Each QofEntity in
+Performs a deep comparision of the collections. Each QofInstance in
 each collection is looked up in the other collection, via the GUID.
 
 \return 0 if the collections are identical or both are NULL

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -39,67 +39,6 @@
 
 /* ========================================================== */
 
-static void
-qof_int_entity_init (QofEntity *ent, QofIdType type, QofCollection * tab)
-{
-  g_return_if_fail (NULL != tab);
-  
-  /* XXX We passed redundant info to this routine ... but I think that's
-   * OK, it might eliminate programming errors. */
-  if (safe_strcmp(tab->e_type, type))
-  {
-    PERR ("attempt to insert \"%s\" into \"%s\"", type, tab->e_type);
-    return;
-  }
-  ent->e_type = CACHE_INSERT (type);
-
-  do
-   {
-    guid_new(&ent->guid);
-
-    if (NULL == qof_collection_lookup_entity (tab, &ent->guid)) break;
-
-    PWARN("duplicate id created, trying again");
-  } while(1);
- 
-  ent->collection = tab;
-
-  qof_collection_insert_entity (tab, ent);
-}
-
-void
-qof_int_entity_release (QofEntity *ent)
-{
-  if (!ent->collection) return;
-  qof_collection_remove_entity (ent);
-  CACHE_REMOVE (ent->e_type);
-  ent->e_type = NULL;
-}
-
-
-/* This is a restricted function, should be used only during 
- * read from file */
-void
-qof_entity_set_guid (QofEntity *ent, const GUID *guid)
-{
-  QofCollection *col;
-  if (guid_equal (guid, &ent->guid)) return;
-
-  col = ent->collection;
-  qof_collection_remove_entity (ent);
-  ent->guid = *guid;
-  qof_collection_insert_entity (col, ent);
-}
-
-const GUID *
-qof_entity_get_guid (const QofEntity *ent)
-{
-  if (!ent) return guid_null();
-  return &ent->guid;
-}
-
-/* ========================================================== */
-
 QofInstance*
 qof_instance_create (QofIdType type, QofBook *book)
 {
@@ -127,7 +66,7 @@
 	inst->infant = TRUE;
 
 	col = qof_book_get_collection (book, type);
-	qof_int_entity_init (&inst->entity, type, col);
+	qof_entity_init (inst, type, col);
 }
 
 void
@@ -138,14 +77,14 @@
 	inst->editlevel = 0;
 	inst->do_free = FALSE;
 	inst->dirty = FALSE;
-	qof_int_entity_release (&inst->entity);
+	qof_entity_release (inst);
 }
 
 const GUID *
 qof_instance_get_guid (const QofInstance *inst)
 {
-	if (!inst) return NULL;
-	return &inst->entity.guid;
+    if (!inst) return guid_null();
+	return &(inst->guid);
 }
 
 QofBook *
@@ -187,13 +126,13 @@
 }
 
 void
-qof_instance_print_dirty (const QofEntity *entity, gpointer dummy)
+qof_instance_print_dirty (const QofInstance *entity, gpointer dummy)
 {
   QofInstance *inst = QOF_INSTANCE(entity);
 
   if (inst->dirty)
-    printf("%s instance %s is dirty.\n", inst->entity.e_type,
-	   guid_to_string(&inst->entity.guid));
+    printf("%s instance %s is dirty.\n", inst->e_type,
+	   guid_to_string(&inst->guid));
 }
 
 gboolean
@@ -204,7 +143,7 @@
 	if (!inst) { return FALSE; }
 	if (qof_get_alt_dirty_mode())
 	  return inst->dirty;
-	coll = inst->entity.collection;
+	coll = inst->collection;
 	if(qof_collection_is_dirty(coll)) { return inst->dirty; }
 	inst->dirty = FALSE;
 	return FALSE;
@@ -217,7 +156,7 @@
 
 	inst->dirty = TRUE;
 	if (!qof_get_alt_dirty_mode()) {
-	  coll = inst->entity.collection;
+	  coll = inst->collection;
 	  qof_collection_mark_dirty(coll);
 	}
 }
@@ -285,12 +224,12 @@
 
   /* Make a note of where the copy came from */
   gnc_kvp_bag_add (to->kvp_data, "gemini", now,
-                                  "inst_guid", &from->entity.guid,
-                                  "book_guid", &from->book->inst.entity.guid,
+                                  "inst_guid", &from->guid,
+                                  "book_guid", &from->book->inst.guid,
                                   NULL);
   gnc_kvp_bag_add (from->kvp_data, "gemini", now,
-                                  "inst_guid", &to->entity.guid,
-                                  "book_guid", &to->book->inst.entity.guid,
+                                  "inst_guid", &to->guid,
+                                  "book_guid", &to->book->inst.guid,
                                   NULL);
 
   to->dirty = TRUE;
@@ -308,11 +247,11 @@
 	ENTER (" ");
 
 	fr = gnc_kvp_bag_find_by_guid (src->kvp_data, "gemini",
-	                             "book_guid", &target_book->inst.entity.guid);
+	                             "book_guid", &target_book->inst.guid);
 
 	twin_guid = kvp_frame_get_guid (fr, "inst_guid");
 
-	col = qof_book_get_collection (target_book, src->entity.e_type);
+	col = qof_book_get_collection (target_book, src->e_type);
 	twin = (QofInstance *) qof_collection_lookup_entity (col, twin_guid);
 
 	LEAVE (" found twin=%p", twin);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofinstance.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -22,7 +22,7 @@
 /** @addtogroup Entity
     @{ */
 /** @addtogroup Instance
-    Qof Instances are a derived type of QofEntity.  The Instance
+    Qof Instances are a derived type of QofInstance.  The Instance
     adds some common features and functions that most objects
     will want to use.
 
@@ -47,7 +47,7 @@
  * thunks, etc.  */
 #define QOF_INSTANCE(object) ((QofInstance *)(object))
 
-typedef struct QofInstance_s QofInstance;
+/*typedef struct QofInstance_s QofInstance;*/
 
 /** Initialise the memory associated with an instance */
 void qof_instance_init (QofInstance *, QofIdType, QofBook *);
@@ -81,7 +81,7 @@
  */
 int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right);
 
-void qof_instance_print_dirty (const QofEntity *entity, gpointer dummy);
+void qof_instance_print_dirty (const QofInstance *entity, gpointer dummy);
 
 /** Return value of is_dirty flag */
 gboolean qof_instance_is_dirty (QofInstance *);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -156,7 +156,7 @@
 
 void 
 qof_object_foreach (QofIdTypeConst type_name, QofBook *book, 
-                    QofEntityForeachCB cb, gpointer user_data)
+                    QofInstanceForeachCB cb, gpointer user_data)
 {
   QofCollection *col;
   const QofObject *obj;

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofobject.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -104,7 +104,7 @@
    *  provide this routine, as without it, little of interest can 
     * be done.
    */
-  void                (*foreach)(const QofCollection *, QofEntityForeachCB, gpointer);
+  void                (*foreach)(const QofCollection *, QofInstanceForeachCB, gpointer);
 
   /** Given a particular item of this type, return a printable string. 
    */
@@ -160,7 +160,7 @@
  *  be invoked only for those instances stored in the book.
  */
 void qof_object_foreach (QofIdTypeConst type_name, QofBook *book, 
-                         QofEntityForeachCB cb, gpointer user_data);
+                         QofInstanceForeachCB cb, gpointer user_data);
 
 /** Register and lookup backend-specific data for this particular object */
 gboolean qof_object_register_backend (QofIdTypeConst type_name,

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquery.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquery.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -809,7 +809,7 @@
 
     /* And then iterate over all the objects */
     qof_object_foreach (qcb->query->search_for, book,
-			(QofEntityForeachCB) check_item_cb, qcb);
+			(QofInstanceForeachCB) check_item_cb, qcb);
   }
 }
 

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquerycore.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofquerycore.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -1450,13 +1450,13 @@
 }
 
 static void
-query_collect_cb(QofEntity* ent, gpointer user_data)
+query_collect_cb(QofInstance* ent, gpointer user_data)
 {
 	query_coll_t pdata;
 	GUID *guid;
 
 	guid = guid_malloc();
-	guid = (GUID*)qof_entity_get_guid(ent);
+	guid = (GUID*)qof_instance_get_guid(ent);
 	pdata = (query_coll_t)user_data;
 	pdata->guids = g_list_append(pdata->guids, guid);
 }

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -26,16 +26,16 @@
 #include "qofreference.h"
 
 static void
-entity_set_reference_cb(QofEntity *ent, gpointer user_data)
+entity_set_reference_cb(QofInstance *ent, gpointer user_data)
 {
-	void (*reference_setter) (QofEntity*, QofEntity*);
-	void (*choice_setter) (QofEntity*, QofEntity*);
-	void (*collect_setter)(QofEntity*, QofCollection*);
-	QofEntityReference *ref;
+	void (*reference_setter) (QofInstance*, QofInstance*);
+	void (*choice_setter) (QofInstance*, QofInstance*);
+	void (*collect_setter)(QofInstance*, QofCollection*);
+	QofInstanceReference *ref;
 	GList *book_ref_list;
 	QofCollection *coll;
 	QofIdType type;
-	QofEntity *reference;
+	QofInstance *reference;
 	QofBook *partial_book;
 	
 	partial_book = (QofBook*)user_data;
@@ -45,8 +45,8 @@
 	book_ref_list = qof_book_get_data(partial_book, ENTITYREFERENCE);
 	while(book_ref_list)
 	{
-		ref = (QofEntityReference*)book_ref_list->data;
-		if(0 == guid_compare(ref->ref_guid, qof_entity_get_guid(ent)))
+		ref = (QofInstanceReference*)book_ref_list->data;
+		if(0 == guid_compare(ref->ref_guid, qof_instance_get_guid(ent)))
 		{
 			/* avoid setting the entity's own guid as a reference. */
 			book_ref_list = g_list_next(book_ref_list);
@@ -56,7 +56,7 @@
 		type = ref->param->param_type;
 		coll = qof_book_get_collection(partial_book, type);
 		reference = qof_collection_lookup_entity(coll, ref->ref_guid);
-		reference_setter = (void(*)(QofEntity*, QofEntity*))ref->param->param_setfcn;
+		reference_setter = (void(*)(QofInstance*, QofInstance*))ref->param->param_setfcn;
 		if((reference) && (reference_setter))
 		{
 			qof_begin_edit((QofInstance*)ent);
@@ -66,10 +66,10 @@
 			qof_commit_edit((QofInstance*)reference);
 		}
 		/* collect and choice handling */
-		collect_setter = (void(*)(QofEntity*, QofCollection*))ref->param->param_setfcn;
-		choice_setter = (void(*)(QofEntity*, QofEntity*))ref->param->param_setfcn;
+		collect_setter = (void(*)(QofInstance*, QofCollection*))ref->param->param_setfcn;
+		choice_setter = (void(*)(QofInstance*, QofInstance*))ref->param->param_setfcn;
 		if ((0 == safe_strcmp(ref->param->param_type, QOF_TYPE_COLLECT)) &&
-			(0 == guid_compare(qof_entity_get_guid(ent), ref->ent_guid)) &&
+			(0 == guid_compare(qof_instance_get_guid(ent), ref->ent_guid)) &&
 			(0 == safe_strcmp(ref->type, ent->e_type)))
 		{
 			QofCollection *temp_col;
@@ -113,18 +113,18 @@
 	qof_object_foreach(obj->e_type, book, entity_set_reference_cb, book);
 }
 
-static QofEntityReference*
-create_reference(QofEntity *ent, const QofParam *param)
+static QofInstanceReference*
+create_reference(QofInstance *ent, const QofParam *param)
 {
-	QofEntityReference *reference;
-	QofEntity          *ref_ent;
+	QofInstanceReference *reference;
+	QofInstance          *ref_ent;
 	const GUID         *cm_guid;
 	char                cm_sa[GUID_ENCODING_LENGTH + 1];
 	gchar              *cm_string;
 
-	ref_ent = QOF_ENTITY(param->param_getfcn(ent, param));
+	ref_ent = QOF_INSTANCE(param->param_getfcn(ent, param));
 	if(!ref_ent) { return NULL; }
-	reference = g_new0(QofEntityReference, 1);
+	reference = g_new0(QofInstanceReference, 1);
 	reference->type = ent->e_type;
 	reference->ref_guid = g_new(GUID, 1);
 	reference->ent_guid = &ent->guid;
@@ -133,7 +133,7 @@
 		reference->choice_type = ref_ent->e_type; 
 	}
 	reference->param = param;
-	cm_guid = qof_entity_get_guid(ref_ent);
+	cm_guid = qof_instance_get_guid(ref_ent);
 	guid_to_string_buff(cm_guid, cm_sa);
 	cm_string = g_strdup(cm_sa);
 	if(TRUE == string_to_guid(cm_string, reference->ref_guid)) {
@@ -144,8 +144,8 @@
 	return NULL;
 }
 
-QofEntityReference*
-qof_entity_get_reference_from(QofEntity *ent, const QofParam *param)
+QofInstanceReference*
+qof_instance_get_reference_from(QofInstance *ent, const QofParam *param)
 {
 	g_return_val_if_fail(param, NULL);
 	param = qof_class_get_parameter(ent->e_type, param->param_name);

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofreference.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -39,15 +39,15 @@
 
 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.
+QofBooks must be self-contained, only a partial book uses QofInstanceReference.
 
 To retain the relationships between entities, including between a partial and 
-a complete book, QofEntityReference data is stored in the QofBook. This data
+a complete book, QofInstanceReference 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
+that given the GUID and QofIdType of any QofInstance 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
@@ -81,7 +81,7 @@
 The QSF backend rebuilds the references by linking to real entities.
 Other backends can process the list in similar ways.
 
-The list stores the QofEntityReference to the referenced entity -
+The list stores the QofInstanceReference to the referenced entity -
 a struct that contains the GUID and the QofIdType of the referenced
 entity as well as the parameter used to obtain the reference.
 
@@ -102,7 +102,7 @@
 Creates a GList stored in the Book hashtable to contain
 repeated references for a single entity.
 */
-typedef struct qof_entity_reference {
+typedef struct qof_instance_reference {
 	QofIdType       choice_type;/**< Used when the reference is a QOF_TYPE_CHOICE type
 	- stores the actual type of the reference from the list of available choices. */
 	QofIdType       type;       /**< The type of the original entity -
@@ -112,7 +112,7 @@
 	const QofParam  *param;      /**< The parameter of the original entity to use 
 	to get or set the reference. */
 	const GUID      *ent_guid;   /**< The GUID of the original entity. */
-}QofEntityReference;
+}QofInstanceReference;
 
 /** \brief Adds a new reference to the partial book data hash.
 
@@ -122,17 +122,17 @@
 partial.
 */
 void
-qof_session_update_reference_list(QofSession *session, QofEntityReference *reference);
+qof_session_update_reference_list(QofSession *session, QofInstanceReference *reference);
 
 /** Used as the key value for the QofBook data hash.
  *
  * Retrieved later by QSF (or any other suitable backend) to
- * rebuild the references from the QofEntityReference struct
+ * rebuild the references from the QofInstanceReference struct
  * that contains the QofIdType and GUID of the referenced entity
  * of the original QofBook as well as the parameter data and the
  * GUID of the original entity.
  * */
-#define ENTITYREFERENCE "QofEntityReference"
+#define ENTITYREFERENCE "QofInstanceReference"
 
 /** \brief Flag indicating a partial QofBook.
 
@@ -143,11 +143,11 @@
 
 #define PARTIAL_QOFBOOK "PartialQofBook"
 
-/** \brief Read QofEntityReference data for this book and set values.
+/** \brief Read QofInstanceReference data for this book and set values.
 
 @param book The partial book containing the referenceList
 
-The referenceList is a GList of QofEntityReference structures that contain
+The referenceList is a GList of QofInstanceReference structures that contain
 the GUID of each end of a reference. e.g. where one entity refers to another.
 
 The referenceList is used in partial books to store relationships between
@@ -173,14 +173,14 @@
 been checked \b NOT to be QOF_TYPE_COLLECT or other known QOF types
 because this function expects to return a single reference and
 a collect parameter would need to return a list of references, other
-parameters would not return a viable QofEntity. (A string cannot be
+parameters would not return a viable QofInstance. (A string cannot be
 cast to an entity.)
 
 Used in the preparation of a partial QofBook when the known entity
 (the one currently being copied into the partial book) refers to
 any other entity, usually as a parent or child.
 The routine calls the param_getfcn of the supplied parameter,
-which must return an object (QofEntity*), not a known QOF data type, to
+which must return an object (QofInstance*), not a known QOF data type, to
 retrieve the referenced entity and therefore the GUID. The GUID of
 both entities are stored in the reference which then needs to be added
 to the reference list which is added to the partial book data hash.
@@ -199,10 +199,10 @@
 @param ent   The known entity.
 @param param  The parameter to use to get the referenced entity.
 
- at return FALSE on error, otherwise a pointer to the QofEntityReference.
+ at return FALSE on error, otherwise a pointer to the QofInstanceReference.
 */
-QofEntityReference*
-qof_entity_get_reference_from(QofEntity *ent, const QofParam *param);
+QofInstanceReference*
+qof_instance_get_reference_from(QofInstance *ent, const QofParam *param);
 
 /** @} */
 /** @} */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -38,7 +38,7 @@
    * an Entity.  NOTE:  THIS IS NOT AN ENTITY!  THE ONLY PART OF ENTITY
    * THAT IS VALID IS E_TYPE!
    */
-  QofEntity entity;
+  QofInstance entity;
 
   /* A book holds pointers to the various types of datasets.
    * A session may have multiple books. */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -305,15 +305,15 @@
 
 /* =============================================================== */
 
-typedef struct qof_entity_copy_data {
-	QofEntity *from;
-	QofEntity *to;
+typedef struct qof_instance_copy_data {
+	QofInstance *from;
+	QofInstance *to;
 	QofParam  *param;
 	GList  *referenceList;
 	GSList *param_list;
 	QofSession *new_session;
 	gboolean error;
-}QofEntityCopyData;
+}QofInstanceCopyData;
 
 static void
 qof_book_set_partial(QofBook *book)
@@ -328,7 +328,7 @@
 }
 
 void
-qof_session_update_reference_list(QofSession *session, QofEntityReference *reference)
+qof_session_update_reference_list(QofSession *session, QofInstanceReference *reference)
 {
 	QofBook  *book;
 	GList    *book_ref_list;
@@ -341,12 +341,12 @@
 }
 
 static void
-qof_entity_param_cb(QofParam *param, gpointer data)
+qof_instance_param_cb(QofParam *param, gpointer data)
 {
-	QofEntityCopyData *qecd;
+	QofInstanceCopyData *qecd;
 
 	g_return_if_fail(data != NULL);
-	qecd = (QofEntityCopyData*)data;
+	qecd = (QofInstanceCopyData*)data;
 	g_return_if_fail(param != NULL);
 	/* KVP doesn't need a set routine to be copied. */
 	if(0 == safe_strcmp(param->param_type, QOF_TYPE_KVP)) {
@@ -359,24 +359,24 @@
 }
 
 static void
-col_ref_cb (QofEntity* ref_ent, gpointer user_data)
+col_ref_cb (QofInstance* ref_ent, gpointer user_data)
 {
-	QofEntityReference *ref;
-	QofEntityCopyData  *qecd;
-	QofEntity *ent;
+	QofInstanceReference *ref;
+	QofInstanceCopyData  *qecd;
+	QofInstance *ent;
 	const GUID   *cm_guid;
 	char         cm_sa[GUID_ENCODING_LENGTH + 1];
 	gchar        *cm_string;
 
-	qecd = (QofEntityCopyData*)user_data;
+	qecd = (QofInstanceCopyData*)user_data;
 	ent = qecd->from;
-	ref = g_new0(QofEntityReference, 1);
+	ref = g_new0(QofInstanceReference, 1);
 	ref->type = ent->e_type;
 	ref->ref_guid = g_new(GUID, 1);
 	ref->ent_guid = &ent->guid;
 	ref->param = qof_class_get_parameter(ent->e_type, 
 		qecd->param->param_name);
-	cm_guid = qof_entity_get_guid(ref_ent);
+	cm_guid = qof_instance_get_guid(ref_ent);
 	guid_to_string_buff(cm_guid, cm_sa);
 	cm_string = g_strdup(cm_sa);
 	if(TRUE == string_to_guid(cm_string, ref->ref_guid)) {
@@ -386,11 +386,11 @@
 }
 
 static void
-qof_entity_foreach_copy(gpointer data, gpointer user_data)
+qof_instance_foreach_copy(gpointer data, gpointer user_data)
 {
-	QofEntity          *importEnt, *targetEnt/*, *referenceEnt*/;
-	QofEntityCopyData 	*context;
-	QofEntityReference  *reference;
+	QofInstance          *importEnt, *targetEnt/*, *referenceEnt*/;
+	QofInstanceCopyData 	*context;
+	QofInstanceReference  *reference;
 	gboolean		registered_type;
 	/* cm_ prefix used for variables that hold the data to commit */
 	QofParam 		*cm_param;
@@ -399,26 +399,26 @@
 	KvpFrame 		*cm_kvp;
 	QofCollection *cm_col;
 	/* function pointers and variables for parameter getters that don't use pointers normally */
-	gnc_numeric 	cm_numeric, (*numeric_getter)	(QofEntity*, QofParam*);
-	double 			cm_double, 	(*double_getter)	(QofEntity*, QofParam*);
-	gboolean 		cm_boolean, (*boolean_getter)	(QofEntity*, QofParam*);
-	gint32 			cm_i32, 	(*int32_getter)		(QofEntity*, QofParam*);
-	gint64 			cm_i64, 	(*int64_getter)		(QofEntity*, QofParam*);
-	Timespec 		cm_date, 	(*date_getter)		(QofEntity*, QofParam*);
+	gnc_numeric 	cm_numeric, (*numeric_getter)	(QofInstance*, QofParam*);
+	double 			cm_double, 	(*double_getter)	(QofInstance*, QofParam*);
+	gboolean 		cm_boolean, (*boolean_getter)	(QofInstance*, QofParam*);
+	gint32 			cm_i32, 	(*int32_getter)		(QofInstance*, QofParam*);
+	gint64 			cm_i64, 	(*int64_getter)		(QofInstance*, QofParam*);
+	Timespec 		cm_date, 	(*date_getter)		(QofInstance*, QofParam*);
 	/* function pointers to the parameter setters */
-	void	(*string_setter)	(QofEntity*, const char*);
-	void	(*date_setter)		(QofEntity*, Timespec);
-	void	(*numeric_setter)	(QofEntity*, gnc_numeric);
-	void	(*guid_setter)		(QofEntity*, const GUID*);
-	void	(*double_setter)	(QofEntity*, double);
-	void	(*boolean_setter)	(QofEntity*, gboolean);
-	void	(*i32_setter)		(QofEntity*, gint32);
-	void	(*i64_setter)		(QofEntity*, gint64);
-	void	(*char_setter)		(QofEntity*, char*);
-	void	(*kvp_frame_setter)	(QofEntity*, KvpFrame*);
+	void	(*string_setter)	(QofInstance*, const char*);
+	void	(*date_setter)		(QofInstance*, Timespec);
+	void	(*numeric_setter)	(QofInstance*, gnc_numeric);
+	void	(*guid_setter)		(QofInstance*, const GUID*);
+	void	(*double_setter)	(QofInstance*, double);
+	void	(*boolean_setter)	(QofInstance*, gboolean);
+	void	(*i32_setter)		(QofInstance*, gint32);
+	void	(*i64_setter)		(QofInstance*, gint64);
+	void	(*char_setter)		(QofInstance*, char*);
+	void	(*kvp_frame_setter)	(QofInstance*, KvpFrame*);
 	
 	g_return_if_fail(user_data != NULL);
-	context = (QofEntityCopyData*) user_data;
+	context = (QofInstanceCopyData*) user_data;
 	cm_date.tv_nsec = 0;
 	cm_date.tv_sec =  0;
 	importEnt = context->from;
@@ -430,63 +430,63 @@
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_STRING) == 0)  { 
 		cm_string = (gchar*)cm_param->param_getfcn(importEnt, cm_param);
 		if(cm_string) {
-		string_setter = (void(*)(QofEntity*, const char*))cm_param->param_setfcn;
+		string_setter = (void(*)(QofInstance*, const char*))cm_param->param_setfcn;
 		if(string_setter != NULL) {	string_setter(targetEnt, cm_string); }
 		}
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_DATE) == 0) { 
-		date_getter = (Timespec (*)(QofEntity*, QofParam*))cm_param->param_getfcn;
+		date_getter = (Timespec (*)(QofInstance*, QofParam*))cm_param->param_getfcn;
 		cm_date = date_getter(importEnt, cm_param);
-		date_setter = (void(*)(QofEntity*, Timespec))cm_param->param_setfcn;
+		date_setter = (void(*)(QofInstance*, Timespec))cm_param->param_setfcn;
 		if(date_setter != NULL) { date_setter(targetEnt, cm_date); }
 		registered_type = TRUE;
 	}
 	if((safe_strcmp(cm_param->param_type, QOF_TYPE_NUMERIC) == 0)  ||
 	(safe_strcmp(cm_param->param_type, QOF_TYPE_DEBCRED) == 0)) { 
-		numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*))cm_param->param_getfcn;
+		numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*))cm_param->param_getfcn;
 		cm_numeric = numeric_getter(importEnt, cm_param);
-		numeric_setter = (void(*)(QofEntity*, gnc_numeric))cm_param->param_setfcn;
+		numeric_setter = (void(*)(QofInstance*, gnc_numeric))cm_param->param_setfcn;
 		if(numeric_setter != NULL) { numeric_setter(targetEnt, cm_numeric); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_GUID) == 0) { 
 		cm_guid = (const GUID*)cm_param->param_getfcn(importEnt, cm_param);
-		guid_setter = (void(*)(QofEntity*, const GUID*))cm_param->param_setfcn;
+		guid_setter = (void(*)(QofInstance*, const GUID*))cm_param->param_setfcn;
 		if(guid_setter != NULL) { guid_setter(targetEnt, cm_guid); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_INT32) == 0) { 
-		int32_getter = (gint32 (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+		int32_getter = (gint32 (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 		cm_i32 = int32_getter(importEnt, cm_param);
-		i32_setter = (void(*)(QofEntity*, gint32))cm_param->param_setfcn;
+		i32_setter = (void(*)(QofInstance*, gint32))cm_param->param_setfcn;
 		if(i32_setter != NULL) { i32_setter(targetEnt, cm_i32); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_INT64) == 0) { 
-		int64_getter = (gint64 (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+		int64_getter = (gint64 (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 		cm_i64 = int64_getter(importEnt, cm_param);
-		i64_setter = (void(*)(QofEntity*, gint64))cm_param->param_setfcn;
+		i64_setter = (void(*)(QofInstance*, gint64))cm_param->param_setfcn;
 		if(i64_setter != NULL) { i64_setter(targetEnt, cm_i64); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_DOUBLE) == 0) { 
-		double_getter = (double (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+		double_getter = (double (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 		cm_double = double_getter(importEnt, cm_param);
-		double_setter = (void(*)(QofEntity*, double))cm_param->param_setfcn;
+		double_setter = (void(*)(QofInstance*, double))cm_param->param_setfcn;
 		if(double_setter != NULL) { double_setter(targetEnt, cm_double); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_BOOLEAN) == 0){ 
-		boolean_getter = (gboolean (*)(QofEntity*, QofParam*)) cm_param->param_getfcn;
+		boolean_getter = (gboolean (*)(QofInstance*, QofParam*)) cm_param->param_getfcn;
 		cm_boolean = boolean_getter(importEnt, cm_param);
-		boolean_setter = (void(*)(QofEntity*, gboolean))cm_param->param_setfcn;
+		boolean_setter = (void(*)(QofInstance*, gboolean))cm_param->param_setfcn;
 		if(boolean_setter != NULL) { boolean_setter(targetEnt, cm_boolean); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_KVP) == 0) { 
 		cm_kvp = (KvpFrame*)cm_param->param_getfcn(importEnt,cm_param);
-		kvp_frame_setter = (void(*)(QofEntity*, KvpFrame*))cm_param->param_setfcn;
+		kvp_frame_setter = (void(*)(QofInstance*, KvpFrame*))cm_param->param_setfcn;
 		if(kvp_frame_setter != NULL) { kvp_frame_setter(targetEnt, cm_kvp); }
 		else
 		{
@@ -500,7 +500,7 @@
 	}
 	if(safe_strcmp(cm_param->param_type, QOF_TYPE_CHAR) == 0) { 
 		cm_char = (gchar*)cm_param->param_getfcn(importEnt,cm_param);
-		char_setter = (void(*)(QofEntity*, char*))cm_param->param_setfcn;
+		char_setter = (void(*)(QofInstance*, char*))cm_param->param_setfcn;
 		if(char_setter != NULL) { char_setter(targetEnt, cm_char); }
 		registered_type = TRUE;
 	}
@@ -514,10 +514,10 @@
 		registered_type = TRUE;
 	}
 	if(registered_type == FALSE) {
-/*		referenceEnt = QOF_ENTITY(cm_param->param_getfcn(importEnt, cm_param));
+/*		referenceEnt = QOF_INSTANCE(cm_param->param_getfcn(importEnt, cm_param));
 		if(!referenceEnt) { return; }
 		if(!referenceEnt->e_type) { return; }*/
-		reference = qof_entity_get_reference_from(importEnt, cm_param);
+		reference = qof_instance_get_reference_from(importEnt, cm_param);
 		if(reference) {
 			qof_session_update_reference_list(context->new_session, reference);
 		}
@@ -525,9 +525,9 @@
 }
 
 static gboolean
-qof_entity_guid_match(QofSession *new_session, QofEntity *original)
+qof_instance_guid_match(QofSession *new_session, QofInstance *original)
 {
-	QofEntity *copy;
+	QofInstance *copy;
 	const GUID *g;
 	QofIdTypeConst type;
 	QofBook *targetBook;
@@ -537,7 +537,7 @@
 	g_return_val_if_fail(original != NULL, FALSE);
 	targetBook = qof_session_get_book(new_session);
 	g_return_val_if_fail(targetBook != NULL, FALSE);
-	g = qof_entity_get_guid(original);
+	g = qof_instance_get_guid(original);
 	type = g_strdup(original->e_type);
 	coll = qof_book_get_collection(targetBook, type);
 	copy = qof_collection_lookup_entity(coll, g);
@@ -546,19 +546,19 @@
 }
 
 static void
-qof_entity_list_foreach(gpointer data, gpointer user_data)
+qof_instance_list_foreach(gpointer data, gpointer user_data)
 {
-	QofEntityCopyData *qecd;
-	QofEntity *original;
+	QofInstanceCopyData *qecd;
+	QofInstance *original;
 	QofInstance *inst;
 	QofBook *book;
 	const GUID *g;
 	
 	g_return_if_fail(data != NULL);
-	original = QOF_ENTITY(data);
+	original = QOF_INSTANCE(data);
 	g_return_if_fail(user_data != NULL);
-	qecd = (QofEntityCopyData*)user_data;
-	if(qof_entity_guid_match(qecd->new_session, original)) { return; }
+	qecd = (QofInstanceCopyData*)user_data;
+	if(qof_instance_guid_match(qecd->new_session, original)) { return; }
 	qecd->from = original;
 	if(!qof_object_compliance(original->e_type, FALSE)) 
 	{
@@ -573,69 +573,69 @@
 		qecd->error = TRUE;
 		return;
 	}
-	qecd->to = &inst->entity;
-	g = qof_entity_get_guid(original);
-	qof_entity_set_guid(qecd->to, g);
+	qecd->to = inst;
+	g = qof_instance_get_guid(original);
+	qof_instance_set_guid(qecd->to, g);
 	if(qecd->param_list != NULL) { 
 		g_slist_free(qecd->param_list);
 		qecd->param_list = NULL;
 	}
-	qof_class_param_foreach(original->e_type, qof_entity_param_cb, qecd);
+	qof_class_param_foreach(original->e_type, qof_instance_param_cb, qecd);
 	qof_begin_edit(inst);
-	g_slist_foreach(qecd->param_list, qof_entity_foreach_copy, qecd);
+	g_slist_foreach(qecd->param_list, qof_instance_foreach_copy, qecd);
 	qof_commit_edit(inst);
 }
 
 static void
-qof_entity_coll_foreach(QofEntity *original, gpointer user_data)
+qof_instance_coll_foreach(QofInstance *original, gpointer user_data)
 {
-	QofEntityCopyData *qecd;
+	QofInstanceCopyData *qecd;
 	const GUID *g;
 	QofBook *targetBook;
 	QofCollection *coll;
-	QofEntity *copy;
+	QofInstance *copy;
 	
 	g_return_if_fail(user_data != NULL);
 	copy = NULL;
-	qecd = (QofEntityCopyData*)user_data;
+	qecd = (QofInstanceCopyData*)user_data;
 	targetBook = qof_session_get_book(qecd->new_session);
-	g = qof_entity_get_guid(original);
+	g = qof_instance_get_guid(original);
 	coll = qof_book_get_collection(targetBook, original->e_type);
 	copy = qof_collection_lookup_entity(coll, g);
 	if(copy) { qecd->error = TRUE; }
 }
 
 static void
-qof_entity_coll_copy(QofEntity *original, gpointer user_data)
+qof_instance_coll_copy(QofInstance *original, gpointer user_data)
 {
-	QofEntityCopyData *qecd;
+	QofInstanceCopyData *qecd;
 	QofBook *book;
 	QofInstance *inst;
 	const GUID *g;
 	
 	g_return_if_fail(user_data != NULL);
-	qecd = (QofEntityCopyData*)user_data;
+	qecd = (QofInstanceCopyData*)user_data;
 	book = qof_session_get_book(qecd->new_session);
 	if(!qof_object_compliance(original->e_type, TRUE)) { return; }
 	inst = (QofInstance*)qof_object_new_instance(original->e_type, book);
-	qecd->to = &inst->entity;
+	qecd->to = inst;
 	qecd->from = original;
-	g = qof_entity_get_guid(original);
-	qof_entity_set_guid(qecd->to, g);
+	g = qof_instance_get_guid(original);
+	qof_instance_set_guid(qecd->to, g);
 	qof_begin_edit(inst);
-	g_slist_foreach(qecd->param_list, qof_entity_foreach_copy, qecd);
+	g_slist_foreach(qecd->param_list, qof_instance_foreach_copy, qecd);
 	qof_commit_edit(inst);
 }
 
 gboolean 
-qof_entity_copy_to_session(QofSession* new_session, QofEntity* original)
+qof_instance_copy_to_session(QofSession* new_session, QofInstance* original)
 {
-	QofEntityCopyData qecd;
+	QofInstanceCopyData qecd;
 	QofInstance *inst;
 	QofBook *book;
 
 	if(!new_session || !original) { return FALSE; }
-	if(qof_entity_guid_match(new_session, original)) { return FALSE; }
+	if(qof_instance_guid_match(new_session, original)) { return FALSE; }
 	if(!qof_object_compliance(original->e_type, TRUE)) { return FALSE; }
 	qof_event_suspend();
 	qecd.param_list = NULL;
@@ -643,31 +643,31 @@
 	qecd.new_session = new_session;
 	qof_book_set_partial(book);
 	inst = (QofInstance*)qof_object_new_instance(original->e_type, book);
-	qecd.to = &inst->entity;
+	qecd.to = inst;
 	qecd.from = original;
-	qof_entity_set_guid(qecd.to, qof_entity_get_guid(original));
+	qof_instance_set_guid(qecd.to, qof_instance_get_guid(original));
 	qof_begin_edit(inst);
-	qof_class_param_foreach(original->e_type, qof_entity_param_cb, &qecd);
+	qof_class_param_foreach(original->e_type, qof_instance_param_cb, &qecd);
 	qof_commit_edit(inst);
 	if(g_slist_length(qecd.param_list) == 0) { return FALSE; }
-	g_slist_foreach(qecd.param_list, qof_entity_foreach_copy, &qecd);
+	g_slist_foreach(qecd.param_list, qof_instance_foreach_copy, &qecd);
 	g_slist_free(qecd.param_list);
 	qof_event_resume();
 	return TRUE;
 }
 
-gboolean qof_entity_copy_list(QofSession *new_session, GList *entity_list)
+gboolean qof_instance_copy_list(QofSession *new_session, GList *entity_list)
 {
-	QofEntityCopyData *qecd;
+	QofInstanceCopyData *qecd;
 
 	if(!new_session || !entity_list) { return FALSE; }
 	ENTER (" list=%d", g_list_length(entity_list));
-	qecd = g_new0(QofEntityCopyData, 1);
+	qecd = g_new0(QofInstanceCopyData, 1);
 	qof_event_suspend();
 	qecd->param_list = NULL;
 	qecd->new_session = new_session;
 	qof_book_set_partial(qof_session_get_book(new_session));
-	g_list_foreach(entity_list, qof_entity_list_foreach, qecd);
+	g_list_foreach(entity_list, qof_instance_list_foreach, qecd);
 	qof_event_resume();
 	if(qecd->error) 
 	{ 
@@ -679,9 +679,9 @@
 }
 
 gboolean 
-qof_entity_copy_coll(QofSession *new_session, QofCollection *entity_coll)
+qof_instance_copy_coll(QofSession *new_session, QofCollection *entity_coll)
 {
-	QofEntityCopyData qecd;
+	QofInstanceCopyData qecd;
 
 	g_return_val_if_fail(new_session, FALSE);
 	if(!entity_coll) { return FALSE; }
@@ -689,10 +689,10 @@
 	qecd.param_list = NULL;
 	qecd.new_session = new_session;
 	qof_book_set_partial(qof_session_get_book(qecd.new_session));
-	qof_collection_foreach(entity_coll, qof_entity_coll_foreach, &qecd);
+	qof_collection_foreach(entity_coll, qof_instance_coll_foreach, &qecd);
 	qof_class_param_foreach(qof_collection_get_type(entity_coll), 
-		qof_entity_param_cb, &qecd);
-	qof_collection_foreach(entity_coll, qof_entity_coll_copy, &qecd);
+		qof_instance_param_cb, &qecd);
+	qof_collection_foreach(entity_coll, qof_instance_coll_copy, &qecd);
 	if(qecd.param_list != NULL) { g_slist_free(qecd.param_list); }
 	qof_event_resume();
 	return TRUE;
@@ -707,25 +707,25 @@
 };
 
 static void
-recurse_collection_cb (QofEntity *ent, gpointer user_data)
+recurse_collection_cb (QofInstance *ent, gpointer user_data)
 {
 	struct recurse_s *store;
 
 	if(user_data == NULL) { return; }
 	store = (struct recurse_s*)user_data;
 	if(!ent || !store) { return; }
-	store->success = qof_entity_copy_to_session(store->session, ent);
+	store->success = qof_instance_copy_to_session(store->session, ent);
 	if(store->success) {
 	store->ent_list = g_list_append(store->ent_list, ent);
 	}
 }
 
 static void
-recurse_ent_cb(QofEntity *ent, gpointer user_data)
+recurse_ent_cb(QofInstance *ent, gpointer user_data)
 {
 	GList      *ref_list, *i, *j, *ent_list, *child_list;
 	QofParam   *ref_param;
-	QofEntity  *ref_ent, *child_ent;
+	QofInstance  *ref_ent, *child_ent;
 	QofSession *session;
 	struct recurse_s *store;
 	gboolean   success;
@@ -756,17 +756,17 @@
 			}
 			continue;
 		}
-		ref_ent = QOF_ENTITY(ref_param->param_getfcn(ent, ref_param));
+		ref_ent = QOF_INSTANCE(ref_param->param_getfcn(ent, ref_param));
 		if((ref_ent)&&(ref_ent->e_type))
 		{
-			store->success = qof_entity_copy_to_session(session, ref_ent);
+			store->success = qof_instance_copy_to_session(session, ref_ent);
 			if(store->success) { ent_list = g_list_append(ent_list, ref_ent); }
 		}
 	}
 	for(i = ent_list; i != NULL; i = i->next)
 	{
 		if(i->data == NULL) { continue; }
-		child_ent = QOF_ENTITY(i->data);
+		child_ent = QOF_INSTANCE(i->data);
 		if(child_ent == NULL) { continue; }
 		ref_list = qof_class_get_referenceList(child_ent->e_type);
 		for(j = ref_list; j != NULL; j = j->next)
@@ -776,7 +776,7 @@
 			ref_ent = ref_param->param_getfcn(child_ent, ref_param);
 			if(ref_ent != NULL)
 			{
-				success = qof_entity_copy_to_session(session, ref_ent);
+				success = qof_instance_copy_to_session(session, ref_ent);
 				if(success) { child_list = g_list_append(child_list, ref_ent); }
 			}
 		}
@@ -784,7 +784,7 @@
 	for(i = child_list; i != NULL; i = i->next)
 	{
 		if(i->data == NULL) { continue; }
-		ref_ent = QOF_ENTITY(i->data);
+		ref_ent = QOF_INSTANCE(i->data);
 		if(ref_ent == NULL) { continue; }
 		ref_list = qof_class_get_referenceList(ref_ent->e_type);
 		for(j = ref_list; j != NULL; j = j->next)
@@ -794,14 +794,14 @@
 			child_ent = ref_param->param_getfcn(ref_ent, ref_param);
 			if(child_ent != NULL)
 			{
-				qof_entity_copy_to_session(session, child_ent);
+				qof_instance_copy_to_session(session, child_ent);
 			}
 		}
 	}
 }
 
 gboolean
-qof_entity_copy_coll_r(QofSession *new_session, QofCollection *coll)
+qof_instance_copy_coll_r(QofSession *new_session, QofCollection *coll)
 {
 	struct recurse_s store;
 	gboolean success;
@@ -812,12 +812,12 @@
 	store.success = success;
 	store.ent_list = NULL;
 	store.ref_list = qof_class_get_referenceList(qof_collection_get_type(coll));
-	success = qof_entity_copy_coll(new_session, coll);
+	success = qof_instance_copy_coll(new_session, coll);
 	if(success){ qof_collection_foreach(coll, recurse_ent_cb, &store); }
 	return success;
 }
 
-gboolean qof_entity_copy_one_r(QofSession *new_session, QofEntity *ent)
+gboolean qof_instance_copy_one_r(QofSession *new_session, QofInstance *ent)
 {
 	struct recurse_s store;
 	QofCollection *coll;
@@ -828,7 +828,7 @@
 	success = TRUE;
 	store.success = success;
 	store.ref_list = qof_class_get_referenceList(ent->e_type);
-	success = qof_entity_copy_to_session(new_session, ent);
+	success = qof_instance_copy_to_session(new_session, ent);
 	if(success == TRUE) {
 		coll = qof_book_get_collection(qof_session_get_book(new_session), ent->e_type);
 		if(coll) { qof_collection_foreach(coll, recurse_ent_cb, &store); }

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsession.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -264,7 +264,7 @@
 
 Copied entities are identical to the source entity, all parameters
 defined with ::QofAccessFunc and ::QofSetterFunc in QOF are copied
-and the ::GUID of the original ::QofEntity is set in the new entity.
+and the ::GUID of the original ::QofInstance is set in the new entity.
 Sessions containing copied entities are intended for use
 as mechanisms for data export.
 
@@ -280,19 +280,19 @@
 
 */
 
-/** \brief Copy a single QofEntity to another session
+/** \brief Copy a single QofInstance to another session
  
 Checks first that no entity in the session book contains
 the GUID of the source entity. 
 
  @param new_session - the target session
- @param original - the QofEntity* to copy
+ @param original - the QofInstance* to copy
 
 @return FALSE without copying if the session contains an entity
 with the same GUID already, otherwise TRUE.
 */
 
-gboolean qof_entity_copy_to_session(QofSession* new_session, QofEntity* original);
+gboolean qof_instance_copy_to_session(QofSession* new_session, QofInstance* original);
 
 /** @brief Copy a GList of entities to another session
 
@@ -301,18 +301,18 @@
 no support for handling collisions, instead use \ref BookMerge
 
 Note that the GList (e.g. from ::qof_sql_query_run) can contain
-QofEntity pointers of any ::QofIdType, in any sequence. As long
-as all members of the list are ::QofEntity*, and all GUID's are
+QofInstance pointers of any ::QofIdType, in any sequence. As long
+as all members of the list are ::QofInstance*, and all GUID's are
 unique, the list can be copied.
 
  @param new_session - the target session
- @param entity_list - a GList of QofEntity pointers of any type(s).
+ @param entity_list - a GList of QofInstance pointers of any type(s).
 
 @return FALSE, without copying, if new_session contains any entities
 with the same GUID. Otherwise TRUE.
 
 */
-gboolean qof_entity_copy_list(QofSession *new_session, GList *entity_list);
+gboolean qof_instance_copy_list(QofSession *new_session, GList *entity_list);
 
 /** @brief Copy a QofCollection of entities.
 
@@ -327,12 +327,12 @@
 with the same GUID. Otherwise TRUE.
 */
 
-gboolean qof_entity_copy_coll(QofSession *new_session, QofCollection *entity_coll);
+gboolean qof_instance_copy_coll(QofSession *new_session, QofCollection *entity_coll);
 
 /** \brief Recursively copy a collection of entities to a session.
 
 \note This function creates a <b>partial QofBook</b>. See 
-::qof_entity_copy_to_session for more information.
+::qof_instance_copy_to_session for more information.
 
 The QofBook in the new_session must \b not contain any entities
 with the same GUID as any entities to be copied - there is
@@ -341,7 +341,7 @@
 Objects can be defined solely in terms of QOF data types or
 as a mix of data types and other objects, which may in turn
 include other objects. These references can be copied recursively
-down to the third level. See ::QofEntityReference.
+down to the third level. See ::QofInstanceReference.
 
 \note This is a deep recursive copy - every referenced entity is copied
 to the new session, including all parameters. The starting point is all
@@ -358,7 +358,7 @@
 
 */
 gboolean
-qof_entity_copy_coll_r(QofSession *new_session, QofCollection *coll);
+qof_instance_copy_coll_r(QofSession *new_session, QofCollection *coll);
 
 /** \brief Recursively copy a single entity to a new session.
 
@@ -369,7 +369,7 @@
 
 This is a deep copy - all parameters of all referenced entities are copied. If 
 the top level entity has no references, this is identical to 
-::qof_entity_copy_to_session.
+::qof_instance_copy_to_session.
 
 @param ent A single entity that may or may not have references.
 
@@ -380,7 +380,7 @@
 one of the references fails to copy.
 */
 gboolean
-qof_entity_copy_one_r(QofSession *new_session, QofEntity *ent);
+qof_instance_copy_one_r(QofSession *new_session, QofInstance *ent);
 
 /** @} 
 */

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -52,7 +52,7 @@
 	char * single_global_tablename;
 	KvpFrame *kvp_join;
 	GList *param_list;
-	QofEntity *inserted_entity;
+	QofInstance *inserted_entity;
 };
 
 /* ========================================================== */
@@ -573,7 +573,7 @@
 	QofIdTypeConst type;
 	sql_insert_statement *sis;
 	gboolean    registered_type;
-	QofEntity   *ent;
+	QofInstance   *ent;
 	struct tm   query_time;
 	time_t      query_time_t;
 	/* cm_ prefix used for variables that hold the data to commit */
@@ -588,15 +588,15 @@
 /*	KvpFrame       *cm_kvp;
 	KvpValue       *cm_value;
 	KvpValueType   cm_type;*/
-	void (*string_setter)    (QofEntity*, const char*);
-	void (*date_setter)      (QofEntity*, Timespec);
-	void (*numeric_setter)   (QofEntity*, gnc_numeric);
-	void (*double_setter)    (QofEntity*, double);
-	void (*boolean_setter)   (QofEntity*, gboolean);
-	void (*i32_setter)       (QofEntity*, gint32);
-	void (*i64_setter)       (QofEntity*, gint64);
-	void (*char_setter)      (QofEntity*, char);
-/*	void (*kvp_frame_setter) (QofEntity*, KvpFrame*);*/
+	void (*string_setter)    (QofInstance*, const char*);
+	void (*date_setter)      (QofInstance*, Timespec);
+	void (*numeric_setter)   (QofInstance*, gnc_numeric);
+	void (*double_setter)    (QofInstance*, double);
+	void (*boolean_setter)   (QofInstance*, gboolean);
+	void (*i32_setter)       (QofInstance*, gint32);
+	void (*i64_setter)       (QofInstance*, gint64);
+	void (*char_setter)      (QofInstance*, char);
+/*	void (*kvp_frame_setter) (QofInstance*, KvpFrame*);*/
 
 	g_return_if_fail(param || insert_string || query);
 	ent = query->inserted_entity;
@@ -606,12 +606,12 @@
 	ENTER (" param=%s param_type=%s type=%s content=%s", 
 		param->param_name, param->param_type, type, insert_string);
 	if(safe_strcmp(param->param_type, QOF_TYPE_STRING) == 0)  { 
-		string_setter = (void(*)(QofEntity*, const char*))param->param_setfcn;
+		string_setter = (void(*)(QofInstance*, const char*))param->param_setfcn;
 		if(string_setter != NULL) { string_setter(ent, insert_string); }
 		registered_type = TRUE;
 	}
 	if(safe_strcmp(param->param_type, QOF_TYPE_DATE) == 0) { 
-		date_setter = (void(*)(QofEntity*, Timespec))param->param_setfcn;
+		date_setter = (void(*)(QofInstance*, Timespec))param->param_setfcn;
 		strptime(insert_string, QOF_UTC_DATE_FORMAT, &query_time);
 		query_time_t = mktime(&query_time);
 		timespecFromTime_t(&cm_date, query_time_t);
@@ -619,7 +619,7 @@
 	}
 	if((safe_strcmp(param->param_type, QOF_TYPE_NUMERIC) == 0)  ||
 	(safe_strcmp(param->param_type, QOF_TYPE_DEBCRED) == 0)) { 
-		numeric_setter = (void(*)(QofEntity*, gnc_numeric))param->param_setfcn;
+		numeric_setter = (void(*)(QofInstance*, gnc_numeric))param->param_setfcn;
 		string_to_gnc_numeric(insert_string, &cm_numeric);
 		if(numeric_setter != NULL) { numeric_setter(ent, cm_numeric); }
 	}
@@ -633,10 +633,10 @@
 /*			reference_type = xmlGetProp(node, QSF_OBJECT_TYPE);
 		if(0 == safe_strcmp(QOF_PARAM_GUID, reference_type)) 
 		{
-			qof_entity_set_guid(qsf_ent, cm_guid);
+			qof_instance_set_guid(qsf_ent, cm_guid);
 		}
 		else {
-			reference = qof_entity_get_reference_from(qsf_ent, cm_param);
+			reference = qof_instance_get_reference_from(qsf_ent, cm_param);
 			if(reference) {
 				params->referenceList = g_list_append(params->referenceList, reference);
 			}
@@ -646,7 +646,7 @@
 		errno = 0;
 		cm_i32 = (gint32)strtol (insert_string, &tail, 0);
 		if(errno == 0) {
-			i32_setter = (void(*)(QofEntity*, gint32))param->param_setfcn;
+			i32_setter = (void(*)(QofInstance*, gint32))param->param_setfcn;
 			if(i32_setter != NULL) { i32_setter(ent, cm_i32); }
 		}
 		else 
@@ -663,7 +663,7 @@
 		errno = 0;
 		cm_i64 = strtoll(insert_string, &tail, 0);
 		if(errno == 0) {
-			i64_setter = (void(*)(QofEntity*, gint64))param->param_setfcn;
+			i64_setter = (void(*)(QofInstance*, gint64))param->param_setfcn;
 			if(i64_setter != NULL) { i64_setter(ent, cm_i64); }
 		}
 		else 
@@ -680,7 +680,7 @@
 		errno = 0;
 		cm_double = strtod(insert_string, &tail);
 		if(errno == 0) {
-			double_setter = (void(*)(QofEntity*, double))param->param_setfcn;
+			double_setter = (void(*)(QofInstance*, double))param->param_setfcn;
 			if(double_setter != NULL) { double_setter(ent, cm_double); }
 		}
 	}
@@ -691,7 +691,7 @@
 			cm_boolean = TRUE;
 		}
 		else { cm_boolean = FALSE; }
-		boolean_setter = (void(*)(QofEntity*, gboolean))param->param_setfcn;
+		boolean_setter = (void(*)(QofInstance*, gboolean))param->param_setfcn;
 		if(boolean_setter != NULL) { boolean_setter(ent, cm_boolean); }
 	}
 	if(safe_strcmp(param->param_type, QOF_TYPE_KVP) == 0) {
@@ -699,7 +699,7 @@
 	}
 	if(safe_strcmp(param->param_type, QOF_TYPE_CHAR) == 0) { 
 		cm_char = *insert_string;
-		char_setter = (void(*)(QofEntity*, char))param->param_setfcn;
+		char_setter = (void(*)(QofInstance*, char))param->param_setfcn;
 		if(char_setter != NULL) { char_setter(ent, cm_char); }
 	}
 	LEAVE (" ");
@@ -725,7 +725,7 @@
 	}
 }
 
-static QofEntity*
+static QofInstance*
 qof_query_insert(QofSqlQuery *query)
 {
 	GList *field_list, *value_list, *cur;
@@ -755,7 +755,7 @@
 		LEAVE (" unable to create instance of type %s", type); 
 		return NULL; 
 	}
-	query->inserted_entity = &inst->entity;
+	query->inserted_entity = inst;
 	value_list = sis->values;
 	for (field_list = sis->fields; field_list != NULL; field_list = field_list->next) 
 	{

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofsql.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -62,7 +62,7 @@
 underlying QofQuery code.
 
 However, by repeating queries and adding the entities to a new session using
-::qof_entity_copy_list, a series of queries can be added to a single
+::qof_instance_copy_list, a series of queries can be added to a single
 book. e.g. You can insert multiple entities and save out as a QSF XML
 file or use multiple SELECT queries to build a precise list - this
 can be used to replicate most of the functionality of a SQL join.
@@ -77,7 +77,7 @@
 entity in the QofBook, you can produce the effect of a join from running
 the two SELECT queries for each value of param_id held in 'value'.
 
-See ::QofEntityForeachCB and ::qof_object_foreach.
+See ::QofInstanceForeachCB and ::qof_object_foreach.
 
 Date queries handle full date and time strings, using the format
 exported by the QSF backend. To query dates and times, convert

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -306,7 +306,7 @@
     }
     if (dirty && qof_get_alt_dirty_mode() && 
         !(inst->infant && inst->do_free)) {
-      qof_collection_mark_dirty(inst->entity.collection);
+      qof_collection_mark_dirty(inst->collection);
       qof_book_mark_dirty(inst->book);
     }
     inst->infant = FALSE;
@@ -397,7 +397,7 @@
 }
 
 gchar*
-qof_util_param_as_string(QofEntity *ent, QofParam *param)
+qof_util_param_as_string(QofInstance *ent, QofParam *param)
 {
 	gchar       *param_string, param_date[MAX_DATE_LENGTH];
 	gchar       param_sa[GUID_ENCODING_LENGTH + 1];
@@ -405,13 +405,13 @@
 	QofType     paramType;
 	const GUID *param_guid;
 	time_t      param_t;
-	gnc_numeric param_numeric,  (*numeric_getter) (QofEntity*, QofParam*);
-	Timespec    param_ts,       (*date_getter)    (QofEntity*, QofParam*);
-	double      param_double,   (*double_getter)  (QofEntity*, QofParam*);
-	gboolean    param_boolean,  (*boolean_getter) (QofEntity*, QofParam*);
-	gint32      param_i32,      (*int32_getter)   (QofEntity*, QofParam*);
-	gint64      param_i64,      (*int64_getter)   (QofEntity*, QofParam*);
-	gchar       param_char,     (*char_getter)    (QofEntity*, QofParam*);
+	gnc_numeric param_numeric,  (*numeric_getter) (QofInstance*, QofParam*);
+	Timespec    param_ts,       (*date_getter)    (QofInstance*, QofParam*);
+	double      param_double,   (*double_getter)  (QofInstance*, QofParam*);
+	gboolean    param_boolean,  (*boolean_getter) (QofInstance*, QofParam*);
+	gint32      param_i32,      (*int32_getter)   (QofInstance*, QofParam*);
+	gint64      param_i64,      (*int64_getter)   (QofInstance*, QofParam*);
+	gchar       param_char,     (*char_getter)    (QofInstance*, QofParam*);
 
 	param_string = NULL;
     known_type = FALSE;
@@ -423,7 +423,7 @@
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_DATE) == 0) { 
-			date_getter = (Timespec (*)(QofEntity*, QofParam*))param->param_getfcn;
+			date_getter = (Timespec (*)(QofInstance*, QofParam*))param->param_getfcn;
 			param_ts = date_getter(ent, param);
 			param_t = timespecToTime_t(param_ts);
 			strftime(param_date, MAX_DATE_LENGTH, 
@@ -434,7 +434,7 @@
 		}
 		if((safe_strcmp(paramType, QOF_TYPE_NUMERIC) == 0)  ||
 		(safe_strcmp(paramType, QOF_TYPE_DEBCRED) == 0)) { 
-			numeric_getter = (gnc_numeric (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			numeric_getter = (gnc_numeric (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_numeric = numeric_getter(ent, param);
 			param_string = g_strdup(gnc_numeric_to_string(param_numeric));
             known_type = TRUE;
@@ -448,28 +448,28 @@
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_INT32) == 0) { 
-			int32_getter = (gint32 (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			int32_getter = (gint32 (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_i32 = int32_getter(ent, param);
 			param_string = g_strdup_printf("%d", param_i32);
             known_type = TRUE;
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_INT64) == 0) { 
-			int64_getter = (gint64 (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			int64_getter = (gint64 (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_i64 = int64_getter(ent, param);
 			param_string = g_strdup_printf("%"G_GINT64_FORMAT, param_i64);
             known_type = TRUE;
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_DOUBLE) == 0) { 
-			double_getter = (double (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			double_getter = (double (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_double = double_getter(ent, param);
 			param_string = g_strdup_printf("%f", param_double);
             known_type = TRUE;
 			return param_string;
 		}
 		if(safe_strcmp(paramType, QOF_TYPE_BOOLEAN) == 0){ 
-			boolean_getter = (gboolean (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			boolean_getter = (gboolean (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_boolean = boolean_getter(ent, param);
 			/* Boolean values need to be lowercase for QSF validation. */
 			if(param_boolean == TRUE) { param_string = g_strdup("true"); }
@@ -491,7 +491,7 @@
             return param_string; 
         }
 		if(safe_strcmp(paramType, QOF_TYPE_CHAR) == 0) { 
-			char_getter = (gchar (*)(QofEntity*, QofParam*)) param->param_getfcn;
+			char_getter = (gchar (*)(QofInstance*, QofParam*)) param->param_getfcn;
 			param_char = char_getter(ent, param);
             known_type = TRUE;
 			return g_strdup_printf("%c", param_char);
@@ -507,7 +507,7 @@
         }
         if(safe_strcmp(paramType, QOF_TYPE_CHOICE) == 0)
         {
-            QofEntity *child = NULL;
+            QofInstance *child = NULL;
             child = param->param_getfcn(ent, param);
             if(!child) { return param_string; }
             known_type = TRUE;
@@ -534,7 +534,7 @@
         }
         if(!known_type)
         {
-            QofEntity *child = NULL;
+            QofInstance *child = NULL;
             child = param->param_getfcn(ent, param);
             if(!child) { return param_string; }
             return g_strdup(qof_object_printable(child->e_type, child));

Modified: gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/lib/libqof/qof/qofutil.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -235,7 +235,7 @@
 
 The returned string must be freed by the caller.
 */
-gchar* qof_util_param_as_string(QofEntity *ent, QofParam *param);
+gchar* qof_util_param_as_string(QofInstance *ent, QofParam *param);
 
 /** The QOF String Cache:
  *

Modified: gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-component-manager.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-component-manager.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -253,12 +253,12 @@
 }
 
 static void
-gnc_cm_event_handler (QofEntity *entity,
+gnc_cm_event_handler (QofInstance *entity,
                       QofEventId event_type,
                       gpointer user_data,
 		      gpointer event_data)
 {
-  const GUID *guid = qof_entity_get_guid(entity);
+  const GUID *guid = qof_instance_get_guid(entity);
 #if CM_DEBUG
   fprintf (stderr, "event_handler: event %d, entity %p, guid %s\n", event_type,
 	   entity, guid);

Modified: gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-sx-instance-model.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/app-utils/gnc-sx-instance-model.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -56,7 +56,7 @@
 
 static GncSxVariable* gnc_sx_variable_new(gchar *name);
 
-static void _gnc_sx_instance_event_handler(QofEntity *ent, QofEventId event_type, gpointer user_data, gpointer evt_data);
+static void _gnc_sx_instance_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_data, gpointer evt_data);
 
 /* ------------------------------------------------------------ */
 
@@ -605,7 +605,7 @@
 }
 
 static void
-_gnc_sx_instance_event_handler(QofEntity *ent, QofEventId event_type, gpointer user_data, gpointer evt_data)
+_gnc_sx_instance_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_data, gpointer evt_data)
 {
     GncSxInstanceModel *instances = GNC_SX_INSTANCE_MODEL(user_data);
 

Modified: gnucash/gobject-engine-dev-warlord/src/backend/dwi/qofmap.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/dwi/qofmap.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/dwi/qofmap.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -364,7 +364,7 @@
 {
 	if (!inst) return;
 
-	GUID *guid = &QOF_ENTITY(inst)->guid;
+	GUID *guid = &QOF_INSTANCE(inst)->guid;
 
 	dui_connection_lock(qm->db_conn, qm->table_name);
 	/* Use a temp book when loading from the database */
@@ -376,8 +376,8 @@
 
 	/* See if we got something back from the DB */
 	QofCollection *col;
-	col = qof_book_get_collection (qm->tmp_book, QOF_ENTITY(inst)->e_type);
-	QofEntity * db_ent = qof_collection_lookup_entity (col, guid);
+	col = qof_book_get_collection (qm->tmp_book, QOF_INSTANCE(inst)->e_type);
+	QofInstance * db_ent = qof_collection_lookup_entity (col, guid);
 	QofInstance *db_inst = QOF_INSTANCE(db_ent);
 
 	/* If its not already in the database, then insert it in */

Modified: gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-backend-file.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-backend-file.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -821,7 +821,7 @@
     QofBook *book = gp;
     const char * filepath;
 
-    QofIdTypeConst typ = QOF_ENTITY(inst)->e_type;
+    QofIdTypeConst typ = QOF_INSTANCE(inst)->e_type;
     if (strcmp (GNC_ID_PERIOD, typ)) return;
     filepath = build_period_filepath(fbe, book);
     PINFO (" ====================== book=%p filepath=%s\n", book, filepath);

Modified: gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-book-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-book-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-book-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -196,7 +196,7 @@
     GUID *guid;
 
     guid = dom_tree_to_guid(node);
-    qof_entity_set_guid(QOF_ENTITY(book), guid);
+    qof_instance_set_guid(QOF_INSTANCE(book), guid);
     g_free(guid);
     
     return TRUE;

Modified: gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-budget-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-budget-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/file/gnc-budget-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -111,7 +111,7 @@
 
     guid = dom_tree_to_guid(node);
     g_return_val_if_fail(guid, FALSE);
-    qof_entity_set_guid(QOF_ENTITY(bgt), guid);
+    qof_instance_set_guid(QOF_INSTANCE(bgt), guid);
     g_free(guid);
     return TRUE;
 }

Modified: gnucash/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/file/io-gncxml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -865,7 +865,7 @@
 static void write_transactions (FILE *out, QofBook *book, sixtp_gdv2 *gd);
 static void write_template_transaction_data (FILE *out, QofBook *book, sixtp_gdv2 *gd);
 static void write_schedXactions(FILE *out, QofBook *book, sixtp_gdv2 *gd);
-static void write_budget (QofEntity *ent, gpointer data);
+static void write_budget (QofInstance *ent, gpointer data);
 
 static void
 write_counts_cb (const char *type, gpointer data_p, gpointer be_data_p)
@@ -1103,7 +1103,7 @@
 }
 
 static void
-write_budget (QofEntity *ent, gpointer data)
+write_budget (QofInstance *ent, gpointer data)
 {
     xmlNodePtr node;
     struct file_backend* be = data;

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/PostgresBackend.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/PostgresBackend.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/PostgresBackend.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -184,7 +184,7 @@
 
 struct _iter {
   const GUID *guid;
-  QofEntity *ent;
+  QofInstance *ent;
 };
 
 static void
@@ -1627,7 +1627,7 @@
 pgend_do_begin (QofBackend *bend, QofInstance *inst)
 {
   PGBackend *be = (PGBackend*)bend;
-  QofIdTypeConst type = inst->entity.e_type;
+  QofIdTypeConst type = inst->e_type;
 
   ENTER ("be=%p, type=%s", bend, type);
   // if (!safe_strcmp (type, GNC_ID_PERIOD))
@@ -1653,7 +1653,7 @@
 pgend_do_commit (QofBackend *bend, QofInstance *inst)
 {
   PGBackend *be = (PGBackend*)bend;
-  QofIdTypeConst type = inst->entity.e_type;
+  QofIdTypeConst type = inst->e_type;
 
   ENTER ("be=%p, type=%s", bend, type);
   // if (!safe_strcmp (type, GNC_ID_PERIOD))
@@ -1689,7 +1689,7 @@
 pgend_do_rollback (QofBackend *bend, QofInstance *inst)
 {
   PGBackend *be = (PGBackend*)bend;
-  QofIdTypeConst type = inst->entity.e_type;
+  QofIdTypeConst type = inst->e_type;
 
   ENTER ("be=%p, type=%s", bend, type);
   switch (be->session_mode) {

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/book.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/book.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/book.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -139,7 +139,7 @@
    guid = nullguid;  /* just in case the read fails ... */
    string_to_guid (DB_GET_VAL("bookGuid",j), &guid);
 
-   qof_entity_set_guid (QOF_ENTITY(book), &guid);
+   qof_instance_set_guid (QOF_INSTANCE(book), &guid);
 
    if((DB_GET_VAL("book_open",j))[0] == 'n')
    {
@@ -208,14 +208,14 @@
    for (node=blist; node; node=node->next)
    {
       book = node->data;
-      if (guid_equal (qof_entity_get_guid(QOF_ENTITY(book)), &guid)) break;
+      if (guid_equal (qof_instance_get_guid(QOF_INSTANCE(book)), &guid)) break;
       book = NULL;
    }
    
    if (!book) 
    {
       book = qof_book_new();
-      qof_entity_set_guid (QOF_ENTITY(book), &guid);
+      qof_instance_set_guid (QOF_INSTANCE(book), &guid);
    }
 
    if((DB_GET_VAL("book_open",j))[0] == 'n')

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/events.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/events.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/events.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -259,7 +259,7 @@
    {
       Event *ev = (Event *) node->data;
       QofIdType local_obj_type;
-      QofEntity *ent;
+      QofInstance *ent;
 
       ent = NULL;
       /* lets see if the local cache has this item in it */
@@ -290,14 +290,14 @@
 
                /* if the remote user created an account, mirror it here */
                acc = pgendCopyAccountToEngine (be, &(ev->guid));
-               ent = QOF_ENTITY(acc);
+               ent = QOF_INSTANCE(acc);
                break;
             }
             case QOF_EVENT_DESTROY: {
                Account * acc = pgendAccountLookup (be, &(ev->guid));
                xaccAccountBeginEdit (acc);
                xaccAccountDestroy (acc);
-               ent = QOF_ENTITY(acc);
+               ent = QOF_INSTANCE(acc);
                break;
             }
          }
@@ -319,7 +319,7 @@
                /* don't mirror transaction creations. If a register needs
                 * it, it will do a query. */
                trans = pgendTransLookup (be, &(ev->guid));
-               ent = QOF_ENTITY(trans);
+               ent = QOF_INSTANCE(trans);
                PINFO ("create transaction");
                break;
 			}
@@ -327,7 +327,7 @@
                Transaction *trans;
                trans = pgendTransLookup (be, &(ev->guid));
                pgendCopyTransactionToEngine (be, &(ev->guid));
-               ent = QOF_ENTITY(trans);
+               ent = QOF_INSTANCE(trans);
                break;
 			}
             case QOF_EVENT_DESTROY: {
@@ -336,7 +336,7 @@
                /* mark trans for freeing */
                xaccTransDestroy (trans);
                xaccTransCommitEdit (trans);
-               ent = QOF_ENTITY(trans);
+               ent = QOF_INSTANCE(trans);
                break;
             }
          }

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/putil.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/putil.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/putil.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -358,7 +358,7 @@
       for (node=be->blist; node; node=node->next)                \
       {                                                          \
          book = node->data;                                      \
-         if (guid_equal (qof_entity_get_guid((QofEntity*)book), &book_guid)) break; \
+         if (guid_equal (qof_instance_get_guid((QofInstance*)book), &book_guid)) break; \
          book = NULL;                                            \
       }                                                          \
       if (!book) return data;                                    \

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/table.m4
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/table.m4	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/table.m4	2007-04-01 22:18:50 UTC (rev 15773)
@@ -13,7 +13,7 @@
        commodity,      , char *, gnc_commodity_get_unique_name(xaccAccountGetCommodity(ptr)),
        version,        , int32,  xaccAccountGetVersion(ptr),
        iguid,          , int32,  ptr->idata,
-       bookGUID,       , GUID *, qof_entity_get_guid((QofEntity*)gnc_account_get_book(ptr)),
+       bookGUID,       , GUID *, qof_instance_get_guid((QofInstance*)gnc_account_get_book(ptr)),
        parentGUID,     , GUID *, xaccAccountGetGUID(gnc_account_get_parent(ptr)),
        accountGUID, KEY, GUID *, xaccAccountGetGUID(ptr),
        ')
@@ -362,7 +362,7 @@
 
    p = be->buff; *p = 0;
    p = stpcpy (p, "SELECT version FROM tablename($@) WHERE key_fieldname($@) = ''`");
-   p = guid_to_string_buff (qof_entity_get_guid(QOF_ENTITY(ptr)), p);
+   p = guid_to_string_buff (qof_instance_get_guid(QOF_INSTANCE(ptr)), p);
    p = stpcpy (p, "''`;");
    SEND_QUERY (be,be->buff, -1);
    sql_version = GPOINTER_TO_INT(pgendGetResults (be, get_version_cb, (gpointer) -1));
@@ -392,7 +392,7 @@
 
    p = be->buff; *p = 0;
    p = stpcpy (p, "SELECT version FROM tablename($@)" "Trail WHERE key_fieldname($@) = ''`");
-   p = guid_to_string_buff (qof_entity_get_guid(QOF_ENTITY(ptr)), p);
+   p = guid_to_string_buff (qof_instance_get_guid(QOF_INSTANCE(ptr)), p);
    p = stpcpy (p, "''` AND change = ''`d''`;");
    SEND_QUERY (be,be->buff, -1);
    sql_version = GPOINTER_TO_INT(pgendGetResults (be, get_version_cb, (gpointer) -1));

Modified: gnucash/gobject-engine-dev-warlord/src/backend/postgres/txn.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/backend/postgres/txn.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/backend/postgres/txn.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -171,7 +171,7 @@
         {
           Split *s = split_node->data;
 
-          if (s && guid_equal (&s->inst.entity.guid, &dti->guid))
+          if (s && guid_equal (&s->inst.guid, &dti->guid))
           {
             pgendStoreAuditSplit (be, s, SQL_DELETE);
             break;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-bill-term-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-bill-term-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-bill-term-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -482,7 +482,7 @@
 }
 
 static void
-do_count (QofEntity *term_p, gpointer count_p)
+do_count (QofInstance *term_p, gpointer count_p)
 {
   int *count = count_p;
   (*count)++;
@@ -497,7 +497,7 @@
 }
 
 static void
-xml_add_billterm (QofEntity *term_p, gpointer out_p)
+xml_add_billterm (QofInstance *term_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncBillTerm *term = (GncBillTerm *) term_p;
@@ -556,7 +556,7 @@
 
 /* build a list of bill terms that are grandchildren or bogus (empty entry list). */
 static void
-billterm_scrub_cb (QofEntity *term_p, gpointer list_p)
+billterm_scrub_cb (QofInstance *term_p, gpointer list_p)
 {
   GncBillTerm *term = GNC_BILLTERM(term_p);
   GList **list = list_p;
@@ -590,7 +590,7 @@
  * grandchildren, then fix them to point to the most senior child
  */
 static void
-billterm_scrub_invoices (QofEntity * invoice_p, gpointer ht_p)
+billterm_scrub_invoices (QofInstance * invoice_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncInvoice *invoice = GNC_INVOICE(invoice_p);
@@ -617,7 +617,7 @@
 }
 
 static void
-billterm_scrub_cust (QofEntity * cust_p, gpointer ht_p)
+billterm_scrub_cust (QofInstance * cust_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncCustomer *cust = GNC_CUSTOMER(cust_p);
@@ -637,7 +637,7 @@
 }
 
 static void
-billterm_scrub_vendor (QofEntity * vendor_p, gpointer ht_p)
+billterm_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncVendor *vendor = GNC_VENDOR(vendor_p);

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-customer-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-customer-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-customer-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -470,7 +470,7 @@
 }
 
 static void
-do_count (QofEntity * cust_p, gpointer count_p)
+do_count (QofInstance * cust_p, gpointer count_p)
 {
   int *count = count_p;
   if (customer_should_be_saved ((GncCustomer *)cust_p))
@@ -486,7 +486,7 @@
 }
 
 static void
-xml_add_customer (QofEntity * cust_p, gpointer out_p)
+xml_add_customer (QofInstance * cust_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncCustomer *cust = (GncCustomer *) cust_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-employee-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-employee-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-employee-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -389,7 +389,7 @@
 }
 
 static void
-do_count (QofEntity * employee_p, gpointer count_p)
+do_count (QofInstance * employee_p, gpointer count_p)
 {
   int *count = count_p;
   if (employee_should_be_saved ((GncEmployee *) employee_p))
@@ -405,7 +405,7 @@
 }
 
 static void
-xml_add_employee (QofEntity * employee_p, gpointer out_p)
+xml_add_employee (QofInstance * employee_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncEmployee *employee = (GncEmployee *) employee_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-entry-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-entry-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-entry-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -781,7 +781,7 @@
 }
 
 static void
-do_count (QofEntity * entry_p, gpointer count_p)
+do_count (QofInstance * entry_p, gpointer count_p)
 {
   int *count = count_p;
   (*count)++;
@@ -796,7 +796,7 @@
 }
 
 static void
-xml_add_entry (QofEntity * entry_p, gpointer out_p)
+xml_add_entry (QofInstance * entry_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncEntry *entry = (GncEntry *) entry_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-invoice-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-invoice-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-invoice-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -501,7 +501,7 @@
 }
 
 static void
-do_count (QofEntity * invoice_p, gpointer count_p)
+do_count (QofInstance * invoice_p, gpointer count_p)
 {
   int *count = count_p;
   if (invoice_should_be_saved ((GncInvoice *)invoice_p))
@@ -517,7 +517,7 @@
 }
 
 static void
-xml_add_invoice (QofEntity * invoice_p, gpointer out_p)
+xml_add_invoice (QofInstance * invoice_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncInvoice *invoice = (GncInvoice *) invoice_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-job-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-job-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-job-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -288,7 +288,7 @@
 }
 
 static void
-do_count (QofEntity * job_p, gpointer count_p)
+do_count (QofInstance * job_p, gpointer count_p)
 {
   int *count = count_p;
   if (job_should_be_saved ((GncJob *)job_p))
@@ -304,7 +304,7 @@
 }
 
 static void
-xml_add_job (QofEntity * job_p, gpointer out_p)
+xml_add_job (QofInstance * job_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncJob *job = (GncJob *) job_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-order-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-order-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-order-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -331,7 +331,7 @@
 }
 
 static void
-do_count (QofEntity * order_p, gpointer count_p)
+do_count (QofInstance * order_p, gpointer count_p)
 {
   int *count = count_p;
   if (order_should_be_saved ((GncOrder *) order_p))
@@ -347,7 +347,7 @@
 }
 
 static void
-xml_add_order (QofEntity * order_p, gpointer out_p)
+xml_add_order (QofInstance * order_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncOrder *order = (GncOrder *) order_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-tax-table-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-tax-table-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-tax-table-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -445,7 +445,7 @@
 }
 
 static void
-do_count (QofEntity * table_p, gpointer count_p)
+do_count (QofInstance * table_p, gpointer count_p)
 {
   int *count = count_p;
   (*count)++;
@@ -460,7 +460,7 @@
 }
 
 static void
-xml_add_taxtable (QofEntity * table_p, gpointer out_p)
+xml_add_taxtable (QofInstance * table_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncTaxTable *table = (GncTaxTable *) table_p;
@@ -520,7 +520,7 @@
 
 /* build a list of tax tables that are grandchildren or bogus (empty entry list). */
 static void
-taxtable_scrub_cb (QofEntity * table_p, gpointer list_p)
+taxtable_scrub_cb (QofInstance * table_p, gpointer list_p)
 {
   GncTaxTable *table = GNC_TAXTABLE(table_p);
   GList **list = list_p;
@@ -533,7 +533,7 @@
  * grandchildren, then fix them to point to the most senior child
  */
 static void
-taxtable_scrub_entries (QofEntity * entry_p, gpointer ht_p)
+taxtable_scrub_entries (QofInstance * entry_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncEntry *entry = GNC_ENTRY(entry_p);
@@ -578,7 +578,7 @@
 }
 
 static void
-taxtable_scrub_cust (QofEntity * cust_p, gpointer ht_p)
+taxtable_scrub_cust (QofInstance * cust_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncCustomer *cust = GNC_CUSTOMER(cust_p);
@@ -594,7 +594,7 @@
 }
 
 static void
-taxtable_scrub_vendor (QofEntity * vendor_p, gpointer ht_p)
+taxtable_scrub_vendor (QofInstance * vendor_p, gpointer ht_p)
 {
   GHashTable *ht = ht_p;
   GncVendor *vendor = GNC_VENDOR(vendor_p);

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-vendor-xml-v2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-vendor-xml-v2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/file/gnc-vendor-xml-v2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -407,7 +407,7 @@
 }
 
 static void
-do_count (QofEntity * vendor_p, gpointer count_p)
+do_count (QofInstance * vendor_p, gpointer count_p)
 {
   int *count = count_p;
   if (vendor_should_be_saved ((GncVendor *)vendor_p))
@@ -423,7 +423,7 @@
 }
 
 static void
-xml_add_vendor (QofEntity * vendor_p, gpointer out_p)
+xml_add_vendor (QofInstance * vendor_p, gpointer out_p)
 {
   xmlNodePtr node;
   GncVendor *vendor = (GncVendor *) vendor_p;

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -38,7 +38,7 @@
   QofInstance inst;
 
   QofBook *	book;
-  QofEntity * parent;
+  QofInstance * parent;
   gboolean	dirty;
   char *	name;
   char *	addr1;
@@ -65,7 +65,7 @@
 /* Create/Destroy functions */
 
 GncAddress * 
-gncAddressCreate (QofBook *book, QofEntity *prnt)
+gncAddressCreate (QofBook *book, QofInstance *prnt)
 {
   GncAddress *addr;
 
@@ -97,13 +97,13 @@
 }
 
 static void
-qofAddressSetOwner(GncAddress *addr, QofEntity *ent)
+qofAddressSetOwner(GncAddress *addr, QofInstance *ent)
 {
 	if(!addr || !ent) { return; }
 	if(addr->parent == NULL) { addr->parent = ent; }
 }
 
-static QofEntity*
+static QofInstance*
 qofAddressGetOwner(GncAddress *addr)
 {
 
@@ -112,7 +112,7 @@
 }
 
 GncAddress * 
-gncCloneAddress (GncAddress *from, QofEntity *new_parent, QofBook *book)
+gncCloneAddress (GncAddress *from, QofInstance *new_parent, QofBook *book)
 {
   GncAddress *addr;
 
@@ -148,7 +148,7 @@
 {
   if (!addr) return;
 
-  qof_event_gen (&addr->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&addr->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (addr->name);
   CACHE_REMOVE (addr->addr1);

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddress.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -65,7 +65,7 @@
 
 @param  QofInstance The address instance.
 @param	QofBook*	  Copy of the book pointer.
- at param	QofEntity* parent entity.
+ at param	QofInstance* parent entity.
 @param	gboolean	dirty flag
 @param	char*	name of addressee
 @param	char*	first line of address
@@ -80,7 +80,7 @@
 
 /** @name Create/Destroy functions 
  @{ */
-GncAddress *gncAddressCreate (QofBook *book, QofEntity *parent);
+GncAddress *gncAddressCreate (QofBook *book, QofInstance *parent);
 void gncAddressDestroy (GncAddress *addr);
 void gncAddressBeginEdit (GncAddress *addr);
 void gncAddressCommitEdit (GncAddress *addr);

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddressP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddressP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncAddressP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -33,7 +33,7 @@
 gboolean gncAddressRegister (void);
 
 /** Make a copy of the address, setting the parent to 'new_parent' */
-GncAddress * gncCloneAddress (GncAddress *from, QofEntity *new_parent, QofBook *book);
+GncAddress * gncCloneAddress (GncAddress *from, QofInstance *new_parent, QofBook *book);
 
 
 #endif /* GNC_ADDRESSP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTerm.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -85,7 +85,7 @@
 mark_term (GncBillTerm *term)
 {
   qof_instance_set_dirty(&term->inst);
-  qof_event_gen (&term->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&term->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 static inline void maybe_resort_list (GncBillTerm *term)
@@ -140,7 +140,7 @@
   term->desc = CACHE_INSERT ("");
   term->discount = gnc_numeric_zero ();
   addObj (term);
-  qof_event_gen (&term->inst.entity,  QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&term->inst,  QOF_EVENT_CREATE, NULL);
   return term;
 }
 
@@ -161,7 +161,7 @@
 
   if (!term) return;
 
-  qof_event_gen (&term->inst.entity,  QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&term->inst,  QOF_EVENT_DESTROY, NULL);
   CACHE_REMOVE (term->name);
   CACHE_REMOVE (term->desc);
   remObj (term);
@@ -228,7 +228,7 @@
   }
 
   addObj (term);
-  qof_event_gen (&term->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&term->inst, QOF_EVENT_CREATE, NULL);
   return term;
 }
 

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTermP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTermP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncBillTermP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -64,7 +64,7 @@
  */
 GncBillTerm * gncBillTermObtainTwin (GncBillTerm *from, QofBook *book);
 
-#define gncBillTermSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncBillTermSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 
 #endif /* GNC_BILLTERMP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomer.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -79,7 +79,7 @@
 void mark_customer (GncCustomer *customer)
 {
   qof_instance_set_dirty(&customer->inst);
-  qof_event_gen (&customer->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&customer->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ============================================================== */
@@ -97,16 +97,16 @@
   cust->id = CACHE_INSERT ("");
   cust->name = CACHE_INSERT ("");
   cust->notes = CACHE_INSERT ("");
-  cust->addr = gncAddressCreate (book, &cust->inst.entity);
+  cust->addr = gncAddressCreate (book, &cust->inst);
   cust->taxincluded = GNC_TAXINCLUDED_USEGLOBAL;
   cust->active = TRUE;
   cust->jobs = NULL;
 
   cust->discount = gnc_numeric_zero();
   cust->credit = gnc_numeric_zero();
-  cust->shipaddr = gncAddressCreate (book, &cust->inst.entity);
+  cust->shipaddr = gncAddressCreate (book, &cust->inst);
 
-  qof_event_gen (&cust->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&cust->inst, QOF_EVENT_CREATE, NULL);
 
   return cust;
 }
@@ -132,8 +132,8 @@
   cust->active = from->active;
   cust->taxtable_override = from->taxtable_override;
 
-  cust->addr = gncCloneAddress (from->addr, &cust->inst.entity, book);
-  cust->shipaddr = gncCloneAddress (from->shipaddr, &cust->inst.entity, book);
+  cust->addr = gncCloneAddress (from->addr, &cust->inst, book);
+  cust->shipaddr = gncCloneAddress (from->shipaddr, &cust->inst, book);
 
   /* Find the matching currency in the new book, assumes
    * currency has already been copied into new book. */
@@ -150,7 +150,7 @@
     cust->jobs = g_list_prepend(cust->jobs, job);
   }
 
-  qof_event_gen (&cust->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&cust->inst, QOF_EVENT_CREATE, NULL);
 
   return cust;
 }
@@ -167,7 +167,7 @@
 {
   if (!cust) return;
 
-  qof_event_gen (&cust->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&cust->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (cust->id);
   CACHE_REMOVE (cust->name);
@@ -340,7 +340,7 @@
     cust->jobs = g_list_insert_sorted (cust->jobs, job,
                                        (GCompareFunc)gncJobCompare);
 
-  qof_event_gen (&cust->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&cust->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void gncCustomerRemoveJob (GncCustomer *cust, GncJob *job)
@@ -357,7 +357,7 @@
     cust->jobs = g_list_remove_link (cust->jobs, node);
     g_list_free_1 (node);
   }
-  qof_event_gen (&cust->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&cust->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void gncCustomerBeginEdit (GncCustomer *cust)
@@ -412,7 +412,7 @@
 }
 
 static void
-qofCustomerSetAddr (GncCustomer *cust, QofEntity *addr_ent)
+qofCustomerSetAddr (GncCustomer *cust, QofInstance *addr_ent)
 {
 	GncAddress *addr;
 
@@ -426,7 +426,7 @@
 }
 
 static void
-qofCustomerSetShipAddr (GncCustomer *cust, QofEntity *ship_addr_ent)
+qofCustomerSetShipAddr (GncCustomer *cust, QofInstance *ship_addr_ent)
 {
 	GncAddress *ship_addr;
 

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomerP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomerP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncCustomerP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -53,6 +53,6 @@
  */
 GncCustomer * gncCustomerObtainTwin (GncCustomer *from, QofBook *book);
 
-#define gncCustomerSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncCustomerSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 #endif /* GNC_CUSTOMERP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -62,7 +62,7 @@
 void mark_employee (GncEmployee *employee)
 {
   qof_instance_set_dirty(&employee->inst);
-  qof_event_gen (&employee->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&employee->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ============================================================== */
@@ -81,12 +81,12 @@
   employee->username = CACHE_INSERT ("");
   employee->language = CACHE_INSERT ("");
   employee->acl = CACHE_INSERT ("");
-  employee->addr = gncAddressCreate (book, &employee->inst.entity);
+  employee->addr = gncAddressCreate (book, &employee->inst);
   employee->workday = gnc_numeric_zero();
   employee->rate = gnc_numeric_zero();
   employee->active = TRUE;
   
-  qof_event_gen (&employee->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&employee->inst, QOF_EVENT_CREATE, NULL);
 
   return employee;
 }
@@ -102,7 +102,7 @@
 {
   if (!employee) return;
 
-  qof_event_gen (&employee->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&employee->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (employee->id);
   CACHE_REMOVE (employee->username);
@@ -128,7 +128,7 @@
   employee->username = CACHE_INSERT (from->username);
   employee->language = CACHE_INSERT (from->language);
   employee->acl = CACHE_INSERT (from->acl);
-  employee->addr = gncCloneAddress (from->addr, &employee->inst.entity, book);
+  employee->addr = gncCloneAddress (from->addr, &employee->inst, book);
   employee->workday = from->workday;
   employee->rate = from->rate;
   employee->active = from->active;
@@ -136,7 +136,7 @@
   employee->ccard_acc = 
      GNC_ACCOUNT(qof_instance_lookup_twin(QOF_INSTANCE(from->ccard_acc), book));
   
-  qof_event_gen (&employee->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&employee->inst, QOF_EVENT_CREATE, NULL);
 
   return employee;
 }
@@ -258,7 +258,7 @@
 }
 
 void
-qofEmployeeSetAddr (GncEmployee *employee, QofEntity *addr_ent)
+qofEmployeeSetAddr (GncEmployee *employee, QofInstance *addr_ent)
 {
 	GncAddress *addr;
 

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployee.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -60,7 +60,7 @@
 void gncEmployeeSetCurrency (GncEmployee *employee, gnc_commodity * currency);
 void gncEmployeeSetActive (GncEmployee *employee, gboolean active);
 void gncEmployeeSetCCard (GncEmployee *employee, Account* ccard_acc);
-void qofEmployeeSetAddr (GncEmployee *employee, QofEntity *addr_ent);
+void qofEmployeeSetAddr (GncEmployee *employee, QofInstance *addr_ent);
 
 /** @} */
 
@@ -101,9 +101,9 @@
 #define EMPLOYEE_CC    "credit_card_account"
 
 /** deprecated routines */
-#define gncEmployeeGetGUID(E) qof_entity_get_guid(QOF_ENTITY(E))
+#define gncEmployeeGetGUID(E) qof_instance_get_guid(QOF_INSTANCE(E))
 #define gncEmployeeGetBook(E) qof_instance_get_book(QOF_INSTANCE(E))
-#define gncEmployeeRetGUID(E) (E ? *(qof_entity_get_guid(QOF_ENTITY(E))) : *(guid_null()))
+#define gncEmployeeRetGUID(E) (E ? *(qof_instance_get_guid(QOF_INSTANCE(E))) : *(guid_null()))
 #define gncEmployeeLookupDirect(G,B) gncEmployeeLookup((B),&(G))
 
 #endif /* GNC_EMPLOYEE_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployeeP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployeeP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEmployeeP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -57,6 +57,6 @@
  */
 GncEmployee * gncEmployeeObtainTwin (GncEmployee *from, QofBook *book);
 
-#define gncEmployeeSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncEmployeeSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 #endif /* GNC_EMPLOYEEP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntry.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -169,7 +169,7 @@
 void mark_entry (GncEntry *entry)
 {
   qof_instance_set_dirty(&entry->inst);
-  qof_event_gen (&entry->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&entry->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ================================================================ */
@@ -203,7 +203,7 @@
 
   entry->values_dirty = TRUE;
 
-  qof_event_gen (&entry->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&entry->inst, QOF_EVENT_CREATE, NULL);
 
   return entry;
 }
@@ -219,7 +219,7 @@
 {
   if (!entry) return;
 
-  qof_event_gen (&entry->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&entry->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (entry->desc);
   CACHE_REMOVE (entry->action);
@@ -1209,7 +1209,7 @@
   compare = safe_strcmp (a->action, b->action);
   if (compare) return compare;
 
-  return guid_compare (&(a->inst.entity.guid), &(b->inst.entity.guid));
+  return guid_compare (&(a->inst.guid), &(b->inst.guid));
 }
 
 /* ============================================================= */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntryP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntryP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncEntryP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -59,6 +59,6 @@
  */
 GncEntry * gncEntryObtainTwin (GncEntry *from, QofBook *book);
 
-#define gncEntrySetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncEntrySetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 #endif /* GNC_ENTRYP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoice.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -91,7 +91,7 @@
 mark_invoice (GncInvoice *invoice)
 {
   qof_instance_set_dirty(&invoice->inst);
-  qof_event_gen (&invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&invoice->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 QofBook * gncInvoiceGetBook(GncInvoice *x)
@@ -120,7 +120,7 @@
 
   invoice->to_charge_amount = gnc_numeric_zero();
 
-  qof_event_gen (&invoice->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&invoice->inst, QOF_EVENT_CREATE, NULL);
 
   return invoice;
 }
@@ -136,7 +136,7 @@
 {
   if (!invoice) return;
 
-  qof_event_gen (&invoice->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&invoice->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (invoice->id);
   CACHE_REMOVE (invoice->notes);
@@ -199,7 +199,7 @@
   GNCLot *	posted_lot;
 #endif
 
-  qof_event_gen (&invoice->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&invoice->inst, QOF_EVENT_CREATE, NULL);
 
   return invoice;
 }
@@ -241,7 +241,7 @@
 }
 
 static void
-qofInvoiceSetOwner (GncInvoice *invoice, QofEntity *ent)
+qofInvoiceSetOwner (GncInvoice *invoice, QofInstance *ent)
 {
 	if(!invoice || !ent) { return; }
 	gncInvoiceBeginEdit (invoice);
@@ -251,7 +251,7 @@
 }
 
 static void
-qofInvoiceSetBillTo (GncInvoice *invoice, QofEntity *ent)
+qofInvoiceSetBillTo (GncInvoice *invoice, QofInstance *ent)
 {
 	if(!invoice || !ent) { return; }
 	gncInvoiceBeginEdit (invoice);
@@ -459,18 +459,18 @@
   return &invoice->owner;
 }
 
-static QofEntity*
+static QofInstance*
 qofInvoiceGetOwner (GncInvoice *invoice)
 {
 	if(!invoice) { return NULL; }
-	return QOF_ENTITY(&invoice->owner);
+	return QOF_INSTANCE(&invoice->owner);
 }
 
-static QofEntity*
+static QofInstance*
 qofInvoiceGetBillTo (GncInvoice *invoice)
 {
 	if(!invoice) { return NULL; }
-	return QOF_ENTITY(&invoice->billto);
+	return QOF_INSTANCE(&invoice->billto);
 }
 
 Timespec gncInvoiceGetDateOpened (GncInvoice *invoice)
@@ -655,19 +655,19 @@
 {
 	QofCollection *entry_coll;
 	GList         *list;
-	QofEntity     *entry;
+	QofInstance     *entry;
 
 	entry_coll = qof_collection_new(GNC_ID_ENTRY);
 	for(list = gncInvoiceGetEntries(invoice); list != NULL; list = list->next)
 	{
-		entry = QOF_ENTITY(list->data);
+		entry = QOF_INSTANCE(list->data);
 		qof_collection_add_entity(entry_coll, entry);
 	}
 	return entry_coll;
 }
 
 static void
-qofInvoiceEntryCB (QofEntity *ent, gpointer user_data)
+qofInvoiceEntryCB (QofInstance *ent, gpointer user_data)
 {
 	GncInvoice *invoice;
 
@@ -1385,7 +1385,7 @@
     /* Now send an event for the invoice so it gets updated as paid */
     this_invoice = gncInvoiceGetInvoiceFromLot(lot);
     if (this_invoice)
-      qof_event_gen (&this_invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
+      qof_event_gen (&this_invoice->inst, QOF_EVENT_MODIFY, NULL);
 
     if (gnc_numeric_zero_p (amount))
       break;
@@ -1482,7 +1482,7 @@
   compare = timespec_cmp (&(a->date_posted), &(b->date_posted));
   if (compare) return compare;
 
-  return guid_compare (&(a->inst.entity.guid), &(b->inst.entity.guid));
+  return guid_compare (&(a->inst.guid), &(b->inst.guid));
 }
 
 /* ============================================================= */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoiceP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoiceP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncInvoiceP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -63,5 +63,5 @@
  * different ways.
  */
 GncInvoice * gncInvoiceObtainTwin (GncInvoice *from, QofBook *book);
-#define gncInvoiceSetGUID(I,G) qof_entity_set_guid(QOF_ENTITY(I),(G))
+#define gncInvoiceSetGUID(I,G) qof_instance_set_guid(QOF_INSTANCE(I),(G))
 #endif /* GNC_INVOICEP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJob.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJob.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJob.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -57,7 +57,7 @@
 void mark_job (GncJob *job)
 {
   qof_instance_set_dirty(&job->inst);
-  qof_event_gen (&job->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&job->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ================================================================== */
@@ -78,7 +78,7 @@
   job->active = TRUE;
 
   /* GncOwner not initialized */
-  qof_event_gen (&job->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&job->inst, QOF_EVENT_CREATE, NULL);
 
   return job;
 }
@@ -101,7 +101,7 @@
 
   job->owner = gncCloneOwner(&from->owner, book);
 
-  qof_event_gen (&job->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&job->inst, QOF_EVENT_CREATE, NULL);
                                                                                 
   return job;
 }
@@ -117,7 +117,7 @@
 {
   if (!job) return;
 
-  qof_event_gen (&job->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&job->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (job->id);
   CACHE_REMOVE (job->name);
@@ -248,7 +248,7 @@
 }
 
 static void
-qofJobSetOwner (GncJob *job, QofEntity *ent)
+qofJobSetOwner (GncJob *job, QofInstance *ent)
 {
 	if(!job || !ent) { return; }
 	qof_begin_edit(&job->inst);
@@ -315,11 +315,11 @@
   return job->active;
 }
 
-static QofEntity*
+static QofInstance*
 qofJobGetOwner (GncJob *job)
 {
 	if(!job) { return NULL; }
-	return QOF_ENTITY(qofOwnerGetOwner(&job->owner));
+	return QOF_INSTANCE(qofOwnerGetOwner(&job->owner));
 }
 
 /* Other functions */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJobP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJobP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncJobP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -53,6 +53,6 @@
  */
 GncJob * gncJobObtainTwin (GncJob *from, QofBook *book);
 
-#define gncJobSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncJobSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 #endif /* GNC_JOBP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrder.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -71,7 +71,7 @@
 void mark_order (GncOrder *order)
 {
   qof_instance_set_dirty(&order->inst);
-  qof_event_gen (&order->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&order->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* =============================================================== */
@@ -92,7 +92,7 @@
 
   order->active = TRUE;
 
-  qof_event_gen (&order->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&order->inst, QOF_EVENT_CREATE, NULL);
 
   return order;
 }
@@ -108,7 +108,7 @@
 {
   if (!order) return;
 
-  qof_event_gen (&order->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&order->inst, QOF_EVENT_DESTROY, NULL);
 
   g_list_free (order->entries);
   CACHE_REMOVE (order->id);
@@ -152,7 +152,7 @@
     order->entries = g_list_prepend (order->entries, entry);
   }
 
-  qof_event_gen (&order->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&order->inst, QOF_EVENT_CREATE, NULL);
 
   return order;
 }
@@ -373,7 +373,7 @@
   compare = timespec_cmp (&(a->closed), &(b->closed));
   if (compare) return compare;
 
-  return guid_compare (&(a->inst.entity.guid), &(b->inst.entity.guid));
+  return guid_compare (&(a->inst.guid), &(b->inst.guid));
 }
 
 /* =========================================================== */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrderP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrderP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOrderP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -54,6 +54,6 @@
  */
 GncOrder * gncOrderObtainTwin (GncOrder *from, QofBook *book);
 
-#define gncOrderSetGUID(O,G) qof_entity_set_guid(QOF_ENTITY(O),(G))
+#define gncOrderSetGUID(O,G) qof_instance_set_guid(QOF_INSTANCE(O),(G))
 
 #endif /* GNC_ORDERP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -138,10 +138,10 @@
 	return type;
 }
 
-QofEntity*
+QofInstance*
 qofOwnerGetOwner (GncOwner *owner)
 {
-	QofEntity *ent;
+	QofInstance *ent;
 
 	if(!owner) { return NULL; }
 	ent = NULL;
@@ -154,19 +154,19 @@
 			break;
 		}
 		case GNC_OWNER_CUSTOMER : {
-			ent = QOF_ENTITY(owner->owner.customer);
+			ent = QOF_INSTANCE(owner->owner.customer);
 			break;
 		}
 		case GNC_OWNER_JOB : {
-			ent = QOF_ENTITY(owner->owner.job);
+			ent = QOF_INSTANCE(owner->owner.job);
 			break;
 		}
 		case GNC_OWNER_VENDOR : {
-			ent = QOF_ENTITY(owner->owner.vendor);
+			ent = QOF_INSTANCE(owner->owner.vendor);
 			break;
 		}
 		case GNC_OWNER_EMPLOYEE : {
-			ent = QOF_ENTITY(owner->owner.employee);
+			ent = QOF_INSTANCE(owner->owner.employee);
 			break;
 		}
 	}
@@ -174,7 +174,7 @@
 }
 
 void
-qofOwnerSetEntity (GncOwner *owner, QofEntity *ent)
+qofOwnerSetEntity (GncOwner *owner, QofInstance *ent)
 {
 	if(!owner || !ent) { return; }
 	if(0 == safe_strcmp(ent->e_type, GNC_ID_CUSTOMER))

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncOwner.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -63,9 +63,9 @@
 /** return the type for the collection. */
 QofIdType qofOwnerGetType(GncOwner *owner);
 /** return the owner itself as an entity. */
-QofEntity* qofOwnerGetOwner (GncOwner *owner);
+QofInstance* qofOwnerGetOwner (GncOwner *owner);
 /** set the owner from the entity. */
-void qofOwnerSetEntity (GncOwner *owner, QofEntity *ent);
+void qofOwnerSetEntity (GncOwner *owner, QofInstance *ent);
 
 gboolean
 gncOwnerRegister(void);

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTable.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -144,7 +144,7 @@
 mark_table (GncTaxTable *table)
 {
   qof_instance_set_dirty(&table->inst);
-  qof_event_gen (&table->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&table->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 static inline void 
@@ -212,7 +212,7 @@
   qof_instance_init (&table->inst, _GNC_MOD_NAME, book);
   table->name = CACHE_INSERT ("");
   addObj (table);
-  qof_event_gen (&table->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&table->inst, QOF_EVENT_CREATE, NULL);
   return table;
 }
 
@@ -264,7 +264,7 @@
   }
 
   addObj (table);
-  qof_event_gen (&table->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&table->inst, QOF_EVENT_CREATE, NULL);
   return table;
 }
 
@@ -300,7 +300,7 @@
 
   if (!table) return;
 
-  qof_event_gen (&table->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&table->inst, QOF_EVENT_DESTROY, NULL);
   CACHE_REMOVE (table->name);
   remObj (table);
 

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTableP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTableP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncTaxTableP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -63,6 +63,6 @@
  */
 GncTaxTable * gncTaxTableObtainTwin (GncTaxTable *from, QofBook *book);
 
-#define gncTaxTableSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
+#define gncTaxTableSetGUID(E,G) qof_instance_set_guid(QOF_INSTANCE(E),(G))
 
 #endif /* GNC_TAXTABLEP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendor.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -68,7 +68,7 @@
 void mark_vendor (GncVendor *vendor)
 {
   qof_instance_set_dirty(&vendor->inst);
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ============================================================== */
@@ -86,12 +86,12 @@
   vendor->id = CACHE_INSERT ("");
   vendor->name = CACHE_INSERT ("");
   vendor->notes = CACHE_INSERT ("");
-  vendor->addr = gncAddressCreate (book, &vendor->inst.entity);
+  vendor->addr = gncAddressCreate (book, &vendor->inst);
   vendor->taxincluded = GNC_TAXINCLUDED_USEGLOBAL;
   vendor->active = TRUE;
   vendor->jobs = NULL;
 
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_CREATE, NULL);
 
   return vendor;
 }
@@ -107,7 +107,7 @@
 {
   if (!vendor) return;
 
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_DESTROY, NULL);
 
   CACHE_REMOVE (vendor->id);
   CACHE_REMOVE (vendor->name);
@@ -140,7 +140,7 @@
   vendor->id = CACHE_INSERT (from->id);
   vendor->name = CACHE_INSERT (from->name);
   vendor->notes = CACHE_INSERT (from->notes);
-  vendor->addr = gncCloneAddress (from->addr, &vendor->inst.entity, book);
+  vendor->addr = gncCloneAddress (from->addr, &vendor->inst, book);
   vendor->taxincluded = from->taxincluded;
   vendor->taxtable_override = from->taxtable_override;
   vendor->active = from->active;
@@ -161,7 +161,7 @@
     vendor->jobs = g_list_prepend(vendor->jobs, job);
   }
 
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_CREATE, NULL);
 
   return vendor;
 }
@@ -293,7 +293,7 @@
 }
 
 static void
-qofVendorSetAddr (GncVendor *vendor, QofEntity *addr_ent)
+qofVendorSetAddr (GncVendor *vendor, QofInstance *addr_ent)
 {
 	GncAddress *addr;
 
@@ -396,7 +396,7 @@
     vendor->jobs = g_list_insert_sorted (vendor->jobs, job,
                                          (GCompareFunc)gncJobCompare);
 
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void gncVendorRemoveJob (GncVendor *vendor, GncJob *job)
@@ -414,7 +414,7 @@
     g_list_free_1 (node);
   }
 
-  qof_event_gen (&vendor->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&vendor->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void gncVendorBeginEdit (GncVendor *vendor)

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendorP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendorP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/gncVendorP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -52,7 +52,7 @@
  * different ways.
  */
 GncVendor * gncVendorObtainTwin (GncVendor *from, QofBook *book);
-#define gncVendorSetGUID(V,G) qof_entity_set_guid(QOF_ENTITY(V),(G))
+#define gncVendorSetGUID(V,G) qof_instance_set_guid(QOF_INSTANCE(V),(G))
 
 
 #endif /* GNC_VENDORP_H_ */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-core/test/test-address.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-core/test/test-address.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-core/test/test-address.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -38,7 +38,7 @@
 static void
 test_address (void)
 {
-  QofEntity ent;
+  QofInstance ent;
   GncAddress *address;
   QofBook *book = qof_book_new ();
 

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-gnome/business-urls.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-gnome/business-urls.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-gnome/business-urls.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -79,7 +79,7 @@
 customerCB (const char *location, const char *label,
            gboolean new_window, GNCURLResult * result)
 {
-  QofEntity *entity;
+  QofInstance *entity;
   GncCustomer *customer;
 
   /* href="...:customer=<guid>" */
@@ -94,7 +94,7 @@
 vendorCB (const char *location, const char *label,
            gboolean new_window, GNCURLResult * result)
 {
-  QofEntity *entity;
+  QofInstance *entity;
   GncVendor *vendor;
 
   /* href="...:vendor=<guid>" */
@@ -109,7 +109,7 @@
 employeeCB (const char *location, const char *label,
            gboolean new_window, GNCURLResult * result)
 {
-  QofEntity *entity;
+  QofInstance *entity;
   GncEmployee *employee;
 
   /* href="...:employee=<guid>" */
@@ -125,7 +125,7 @@
 invoiceCB (const char *location, const char *label,
            gboolean new_window, GNCURLResult * result)
 {
-  QofEntity *entity;
+  QofInstance *entity;
   GncInvoice *invoice;
 
   /* href="...:invoice=<guid>" */
@@ -141,7 +141,7 @@
 jobCB (const char *location, const char *label,
            gboolean new_window, GNCURLResult * result)
 {
-  QofEntity *entity;
+  QofInstance *entity;
   GncJob *job;
 
   /* href="...:job=<guid>" */

Modified: gnucash/gobject-engine-dev-warlord/src/business/business-gnome/gnc-plugin-business.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/business/business-gnome/gnc-plugin-business.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/business/business-gnome/gnc-plugin-business.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -727,10 +727,10 @@
 	{
 		qof_session_begin(chart_session, filename, TRUE, TRUE);
 		coll = qof_book_get_collection(book, GNC_ID_INVOICE);
-		success = qof_entity_copy_coll_r(chart_session, coll);
+		success = qof_instance_copy_coll_r(chart_session, coll);
 		/* Need to get the GList of GncEntry's - KVP */
 		coll = qof_book_get_collection(book, GNC_ID_CUSTOMER);
-		success = qof_entity_copy_coll_r(chart_session, coll);
+		success = qof_instance_copy_coll_r(chart_session, coll);
 		if(success) 
 		{ 
 			qof_session_save(chart_session, NULL);
@@ -762,7 +762,7 @@
 	{
 		qof_session_begin(chart_session, filename, TRUE, TRUE);
 		coll = qof_book_get_collection(book, GNC_ID_CUSTOMER);
-		success = qof_entity_copy_coll_r(chart_session, coll);
+		success = qof_instance_copy_coll_r(chart_session, coll);
 		if(success) 
 		{ 
 			qof_session_save(chart_session, NULL);
@@ -794,7 +794,7 @@
 	{
 		qof_session_begin(chart_session, filename, TRUE, TRUE);
 		coll = qof_book_get_collection(book, GNC_ID_VENDOR);
-		success = qof_entity_copy_coll_r(chart_session, coll);
+		success = qof_instance_copy_coll_r(chart_session, coll);
 		if(success) 
 		{ 
 			qof_session_save(chart_session, NULL);
@@ -826,7 +826,7 @@
 	{
 		qof_session_begin(chart_session, filename, TRUE, TRUE);
 		coll = qof_book_get_collection(book, GNC_ID_EMPLOYEE);
-		success = qof_entity_copy_coll_r(chart_session, coll);
+		success = qof_instance_copy_coll_r(chart_session, coll);
 		if(success) 
 		{ 
 			qof_session_save(chart_session, NULL);

Modified: gnucash/gobject-engine-dev-warlord/src/doc/backend-api.txt
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/doc/backend-api.txt	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/doc/backend-api.txt	2007-04-01 22:18:50 UTC (rev 15773)
@@ -29,7 +29,7 @@
 the type of the referenced object and the GUID of the referenced object
 as the value and the GUID of the original object as the key in a
 GHashTable or other lookup mechanism within the backend. See
-::QofEntityReference.
+::QofInstanceReference.
 
 \section backendqueries Handling Queries:
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Account.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Account.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Account.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -233,7 +233,7 @@
 
   acc = g_new (Account, 1);
   xaccInitAccount (acc, book);
-  qof_event_gen (&acc->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&acc->inst, QOF_EVENT_CREATE, NULL);
 
   return acc;
 }
@@ -342,7 +342,7 @@
 
   if (!acc) return;
 
-  qof_event_gen (&acc->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&acc->inst, QOF_EVENT_DESTROY, NULL);
 
   if (acc->children) 
   {
@@ -430,7 +430,7 @@
 static void on_done(QofInstance *inst) 
 {
     /* old event style */
-    qof_event_gen (&inst->entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen (inst, QOF_EVENT_MODIFY, NULL);
 }
 
 static void on_err (QofInstance *inst, QofBackendError errcode)
@@ -448,7 +448,7 @@
 }
 
 static void
-destroy_pending_splits_for_account(QofEntity *ent, gpointer acc)
+destroy_pending_splits_for_account(QofInstance *ent, gpointer acc)
 {
     Transaction *trans = (Transaction *) ent;
     Split *split;
@@ -629,7 +629,7 @@
   }
 
   if(check_guids) {
-    if(!guid_equal(&aa->inst.entity.guid, &ab->inst.entity.guid))
+    if(!guid_equal(&aa->inst.guid, &ab->inst.guid))
     {
       PWARN ("GUIDs differ");
       return FALSE;
@@ -831,7 +831,7 @@
   /* XXX this looks fishy and weird to me ... */
   PINFO("acct=%p", acc);
   xaccAccountBeginEdit (acc);
-  qof_entity_set_guid (&acc->inst.entity, guid);
+  qof_instance_set_guid (&acc->inst, guid);
   qof_instance_set_dirty(&acc->inst);
   xaccAccountCommitEdit (acc);
 }
@@ -1160,7 +1160,7 @@
     return result;
 
   /* guarantee a stable sort */
-  return guid_compare (&(aa->inst.entity.guid), &(ab->inst.entity.guid));
+  return guid_compare (&(aa->inst.guid), &(ab->inst.guid));
 }
 
 static int
@@ -1222,7 +1222,7 @@
 }
 
 static void
-qofAccountSetParent (Account *acc, QofEntity *parent) 
+qofAccountSetParent (Account *acc, QofInstance *parent) 
 {
 	Account *parent_acc;
 	
@@ -1405,10 +1405,10 @@
        */
       PWARN ("reparenting accounts across books is not correctly supported\n");
 
-      qof_event_gen (&child->inst.entity, QOF_EVENT_DESTROY, NULL);
+      qof_event_gen (&child->inst, QOF_EVENT_DESTROY, NULL);
       col = qof_book_get_collection (new_parent->inst.book, GNC_ID_ACCOUNT);
-      qof_collection_insert_entity (col, &child->inst.entity);
-      qof_event_gen (&child->inst.entity, QOF_EVENT_CREATE, NULL);
+      qof_collection_insert_entity (col, &child->inst);
+      qof_event_gen (&child->inst, QOF_EVENT_CREATE, NULL);
     }
   }
   child->parent = new_parent;
@@ -1420,8 +1420,8 @@
    * to send a MODIFY event. If the gtktreemodelfilter code gets the
    * MODIFY before it gets the ADD, it gets very confused and thinks
    * that two nodes have been added. */
-  qof_event_gen (&child->inst.entity, QOF_EVENT_ADD, NULL);
-  // qof_event_gen (&new_parent->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&child->inst, QOF_EVENT_ADD, NULL);
+  // qof_event_gen (&new_parent->inst, QOF_EVENT_MODIFY, NULL);
 
   xaccAccountCommitEdit (child);
   //  xaccAccountCommitEdit(new_parent);
@@ -1451,12 +1451,12 @@
   parent->children = g_list_remove (parent->children, child);
 
   /* Now send the event. */
-  qof_event_gen(&child->inst.entity, QOF_EVENT_REMOVE, &ed);
+  qof_event_gen(&child->inst, QOF_EVENT_REMOVE, &ed);
 
   /* clear the account's parent pointer after REMOVE event generation. */
   child->parent = NULL;
 
-  qof_event_gen (&parent->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&parent->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 Account *
@@ -3178,7 +3178,7 @@
 	gnc_account_copy_children(to_acc, from_acc);
       }
       xaccAccountCommitEdit (to_acc);
-      qof_event_gen (&to_acc->inst.entity, QOF_EVENT_CREATE, NULL);
+      qof_event_gen (&to_acc->inst, QOF_EVENT_CREATE, NULL);
       /* DRH - Should this send ADD/REMOVE events */
    }
    xaccAccountCommitEdit(from);
@@ -3225,8 +3225,8 @@
 	  gnc_account_append_child (acc_a, (Account *)worker->data);
 	g_list_free(work);
 
-	qof_event_gen (&acc_a->inst.entity, QOF_EVENT_MODIFY, NULL);
-	qof_event_gen (&acc_b->inst.entity, QOF_EVENT_MODIFY, NULL);
+	qof_event_gen (&acc_a->inst, QOF_EVENT_MODIFY, NULL);
+	qof_event_gen (&acc_b->inst, QOF_EVENT_MODIFY, NULL);
       }
 
       /* recurse to do the children's children */

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Account.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Account.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Account.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -216,8 +216,8 @@
 void gnc_book_set_root_account(QofBook *book, Account *root);
 
 /** @deprecated */
-#define xaccAccountGetGUID(X)     qof_entity_get_guid(QOF_ENTITY(X))
-#define xaccAccountReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
+#define xaccAccountGetGUID(X)     qof_instance_get_guid(QOF_INSTANCE(X))
+#define xaccAccountReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 /** The xaccAccountLookup() subroutine will return the
  *    account associated with the given id, or NULL

Modified: gnucash/gobject-engine-dev-warlord/src/engine/FreqSpec.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/FreqSpec.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/FreqSpec.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -168,12 +168,10 @@
 static void
 xaccFreqSpecInit( FreqSpec *fs, QofBook *book )
 {
-   QofCollection *col;
    g_return_if_fail( fs );
    g_return_if_fail (book);
 
-   col = qof_book_get_collection (book, QOF_ID_FREQSPEC);
-   qof_entity_init (&fs->entity, QOF_ID_FREQSPEC, col);
+   qof_instance_init (&fs->entity, QOF_ID_FREQSPEC, book);
 
    fs->type = INVALID;
    fs->uift = UIFREQ_ONCE;
@@ -224,7 +222,7 @@
    qof_event_gen( &fs->entity, QOF_EVENT_DESTROY , NULL);
    xaccFreqSpecCleanUp( fs );
 
-   qof_entity_release (&fs->entity);
+   qof_instance_release (&fs->entity);
    g_free( fs );
 }
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/FreqSpecP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/FreqSpecP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/FreqSpecP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -37,7 +37,7 @@
 
 struct gncp_freq_spec 
 {
-        QofEntity       entity;
+        QofInstance       entity;
         FreqType        type;
         UIFreqType      uift;
         union u {

Modified: gnucash/gobject-engine-dev-warlord/src/engine/GNCId.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/GNCId.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/GNCId.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -5,7 +5,7 @@
  * void xaccGUIDNew (GUID *guid, QofBook *book)
  */
 #define xaccGUIDNew(guid,book)     \
-      qof_entity_guid_new (qof_book_get_entity_table (book), (guid))
+      qof_instance_guid_new (qof_book_get_entity_table (book), (guid))
                                                                                 
 
 		#define xaccGUIDNULL guid_null
@@ -14,16 +14,16 @@
 
 		#define GNCIdTypeConst QofIdTypeConst
 		#define GNCIdType QofIdType
-		#define GNCEntityTable QofEntityTable
+		#define GNCEntityTable QofInstanceTable
 		#define xaccGUIDTypeEntityTable qof_guid_type
 
-		#define xaccEntityTableNew qof_entity_new
-		#define xaccEntityTableDestroy qof_entity_destroy
-		#define xaccGUIDNewEntityTable qof_entity_guid_new
-		#define xaccLookupEntity qof_entity_lookup
-		#define xaccStoreEntity qof_entity_store
-		#define xaccRemoveEntity qof_entity_remove
-		#define xaccForeachEntity qof_entity_foreach
+		#define xaccEntityTableNew qof_instance_new
+		#define xaccEntityTableDestroy qof_instance_destroy
+		#define xaccGUIDNewEntityTable qof_instance_guid_new
+		#define xaccLookupEntity qof_instance_lookup
+		#define xaccStoreEntity qof_instance_store
+		#define xaccRemoveEntity qof_instance_remove
+		#define xaccForeachEntity qof_instance_foreach
 
-		#define foreachObjectCB QofEntityForeachCB
+		#define foreachObjectCB QofInstanceForeachCB
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Period.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Period.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Period.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -89,7 +89,7 @@
 
    /* Fiddle the transaction into place in the new book */
    col = qof_book_get_collection (book, GNC_ID_TRANS);
-   qof_collection_insert_entity (col, &newtrans->inst.entity);
+   qof_collection_insert_entity (col, &newtrans->inst);
    newtrans->inst.book = book;
 
    col = qof_book_get_collection (book, GNC_ID_SPLIT);
@@ -101,7 +101,7 @@
 
       /* move the split into the new book ... */
       s->inst.book = book;
-      qof_collection_insert_entity(col, &s->inst.entity);
+      qof_collection_insert_entity(col, &s->inst);
 
       /* find the twin account, and re-parent to that. */
       twin = xaccAccountLookupTwin (s->acc, book);
@@ -118,7 +118,7 @@
    }
 
    xaccTransCommitEdit (newtrans);
-   qof_event_gen (&newtrans->inst.entity, QOF_EVENT_CREATE, NULL);
+   qof_event_gen (&newtrans->inst, QOF_EVENT_CREATE, NULL);
    LEAVE ("trans=%p %s", trans, trans->description);
 }
 
@@ -152,7 +152,7 @@
 
    col = qof_book_get_collection (book, GNC_ID_TRANS);
    trans->inst.book = book;
-   qof_collection_insert_entity (col, &trans->inst.entity);
+   qof_collection_insert_entity (col, &trans->inst);
 
    col = qof_book_get_collection (book, GNC_ID_SPLIT);
    for (node = trans->splits; node; node = node->next)
@@ -164,7 +164,7 @@
       if (s->inst.book != book)
       {
          s->inst.book = book;
-         qof_collection_insert_entity (col, &s->inst.entity);
+         qof_collection_insert_entity (col, &s->inst);
       }
 
       /* Find the twin account, and re-parent to that. */
@@ -186,7 +186,7 @@
    }
 
    xaccTransCommitEdit (trans);
-   qof_event_gen (&trans->inst.entity, QOF_EVENT_MODIFY, NULL);
+   qof_event_gen (&trans->inst, QOF_EVENT_MODIFY, NULL);
    LEAVE ("trans=%p %s", trans, trans->description);
 }
 
@@ -228,7 +228,7 @@
 
    col = qof_book_get_collection (book, GNC_ID_LOT);
    lot->inst.book = book;
-   qof_collection_insert_entity (col, &lot->inst.entity);
+   qof_collection_insert_entity (col, &lot->inst);
 
    /* Move the splits over (only if they haven't already been moved). */
    col = qof_book_get_collection (book, GNC_ID_SPLIT);
@@ -238,7 +238,7 @@
       if (s->inst.book != book)
       {
          s->inst.book = book;
-         qof_collection_insert_entity (col, &s->inst.entity);
+         qof_collection_insert_entity (col, &s->inst);
       }
    }
 
@@ -280,7 +280,7 @@
 
    col = qof_book_get_collection (book, GNC_ID_PRICE);
    pr->inst.book = book;
-   qof_collection_insert_entity (col, &pr->inst.entity);
+   qof_collection_insert_entity (col, &pr->inst);
 
    gnc_pricedb_remove_price (pr->db, pr);
    gnc_pricedb_add_price (gnc_pricedb_get_db (book), pr);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/SX-book.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/SX-book.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/SX-book.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -197,7 +197,7 @@
   if (g_list_find(sxes->sx_list, sx) != NULL)
     return;
   sxes->sx_list = g_list_append(sxes->sx_list, sx);
-  qof_event_gen(&sxes->inst.entity, GNC_EVENT_ITEM_ADDED, (gpointer)sx);
+  qof_event_gen(&sxes->inst, GNC_EVENT_ITEM_ADDED, (gpointer)sx);
 }
 
 void
@@ -208,7 +208,7 @@
   if (to_remove == NULL)
     return;
   sxes->sx_list = g_list_delete_link(sxes->sx_list, to_remove);
-  qof_event_gen(&sxes->inst.entity, GNC_EVENT_ITEM_REMOVED, (gpointer)sx);
+  qof_event_gen(&sxes->inst, GNC_EVENT_ITEM_REMOVED, (gpointer)sx);
 }
 
 /* ====================================================================== */

Modified: gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -71,7 +71,7 @@
    /* create a new template account for our splits */
    sx->template_acct = xaccMallocAccount(book);
    xaccAccountSetName( sx->template_acct,
-                       guid_to_string( &sx->inst.entity.guid ));
+                       guid_to_string( &sx->inst.guid ));
    xaccAccountSetCommodity
      (sx->template_acct,
       gnc_commodity_new( book,
@@ -91,7 +91,7 @@
 
    sx = g_new0( SchedXaction, 1 );
    xaccSchedXactionInit( sx, book );
-   qof_event_gen( &sx->inst.entity, QOF_EVENT_CREATE , NULL);
+   qof_event_gen( &sx->inst, QOF_EVENT_CREATE , NULL);
 
    return sx;
 }
@@ -158,7 +158,7 @@
   if ( sx == NULL ) return;
   
   xaccFreqSpecFree( sx->freq );
-  qof_event_gen( &sx->inst.entity, QOF_EVENT_DESTROY , NULL);
+  qof_event_gen( &sx->inst, QOF_EVENT_DESTROY , NULL);
   
   if ( sx->name )
     g_free( sx->name );
@@ -206,7 +206,7 @@
 
 static void commit_done(QofInstance *inst)
 {
-  qof_event_gen (&inst->entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (inst, QOF_EVENT_MODIFY, NULL);
 }
 
 static void noop(QofInstance *inst) {}

Modified: gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/SchedXaction.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -111,7 +111,7 @@
   gint num_inst;
 } temporalStateData;
 
-#define xaccSchedXactionSetGUID(X,G) qof_entity_set_guid(QOF_ENTITY(X),(G))
+#define xaccSchedXactionSetGUID(X,G) qof_instance_set_guid(QOF_INSTANCE(X),(G))
 
 /**
  * Creates and initializes a scheduled transaction.
@@ -297,7 +297,7 @@
 /** \deprecated */
 #define xaccSchedXactionIsDirty(X) qof_instance_is_dirty (QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccSchedXactionGetGUID(X) qof_entity_get_guid(QOF_ENTITY(X))
+#define xaccSchedXactionGetGUID(X) qof_instance_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
 #define xaccSchedXactionGetSlots(X) qof_instance_get_slots(QOF_INSTANCE(X))
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Scrub2.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Scrub2.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Scrub2.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -319,7 +319,7 @@
 
    /* Find and remove the matching guid's */
    ksub = (KvpFrame*)gnc_kvp_bag_find_by_guid (sa->inst.kvp_data, "lot-split",
-                    "peer_guid", &sb->inst.entity.guid);
+                    "peer_guid", &sb->inst.guid);
    if (ksub) 
    {
       gnc_kvp_bag_remove_frame (sa->inst.kvp_data, "lot-split", ksub);
@@ -328,7 +328,7 @@
 
    /* Now do it in the other direction */
    ksub = (KvpFrame*)gnc_kvp_bag_find_by_guid (sb->inst.kvp_data, "lot-split",
-                    "peer_guid", &sa->inst.entity.guid);
+                    "peer_guid", &sa->inst.guid);
    if (ksub) 
    {
       gnc_kvp_bag_remove_frame (sb->inst.kvp_data, "lot-split", ksub);
@@ -422,7 +422,7 @@
        * repeatedly merging adjacent subsplits, we'll get the non-
        * adjacent ones too. */
       if (gnc_kvp_bag_find_by_guid (split->inst.kvp_data, "lot-split",
-                                    "peer_guid", &s->inst.entity.guid) == NULL)
+                                    "peer_guid", &s->inst.guid) == NULL)
          continue;
          
       merge_splits (split, s);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Split.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Split.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Split.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -154,9 +154,9 @@
    * splits as something official.  If we ever use this split, we'll
    * have to fix this up.
    */
-  split->inst.entity.e_type = NULL;
-  split->inst.entity.collection = NULL;
-  split->inst.entity.guid = s->inst.entity.guid;
+  split->inst.e_type = NULL;
+  split->inst.collection = NULL;
+  split->inst.guid = s->inst.guid;
   split->inst.book = s->inst.book;
 
   split->parent = s->parent;
@@ -336,7 +336,7 @@
   if (sa == sb) return TRUE;
 
   if (check_guids) {
-    if (!guid_equal(&(sa->inst.entity.guid), &(sb->inst.entity.guid)))
+    if (!guid_equal(&(sa->inst.guid), &(sb->inst.guid)))
     {
       PWARN ("GUIDs differ");
       return FALSE;
@@ -512,9 +512,9 @@
         if (node) {
             orig_acc->splits = g_list_delete_link (orig_acc->splits, node);
             //FIXME: find better event type
-            qof_event_gen (&orig_acc->inst.entity, QOF_EVENT_MODIFY, NULL);
+            qof_event_gen (&orig_acc->inst, QOF_EVENT_MODIFY, NULL);
 	    // And send the account-based event, too
-	    qof_event_gen(&orig_acc->inst.entity, GNC_EVENT_ITEM_REMOVED, s);
+	    qof_event_gen(&orig_acc->inst, GNC_EVENT_ITEM_REMOVED, s);
         } else PERR("Account lost track of moved or deleted split.");
         orig_acc->balance_dirty = TRUE;
         xaccAccountRecomputeBalance(orig_acc);
@@ -537,10 +537,10 @@
                 xaccAccountInsertLot (acc, s->lot);
 
             //FIXME: find better event
-            qof_event_gen (&acc->inst.entity, QOF_EVENT_MODIFY, NULL);
+            qof_event_gen (&acc->inst, QOF_EVENT_MODIFY, NULL);
 
 	    /* Also send an event based on the account */
-	    qof_event_gen(&acc->inst.entity, GNC_EVENT_ITEM_ADDED, s);
+	    qof_event_gen(&acc->inst, GNC_EVENT_ITEM_ADDED, s);
         } else PERR("Account grabbed split prematurely.");
         acc->balance_dirty = TRUE;
         xaccSplitSetAmount(s, xaccSplitGetAmount(s));
@@ -549,12 +549,12 @@
     if (s->parent != s->orig_parent) {
         //FIXME: find better event
         if (s->orig_parent)
-            qof_event_gen(&s->orig_parent->inst.entity, QOF_EVENT_MODIFY, 
+            qof_event_gen(&s->orig_parent->inst, QOF_EVENT_MODIFY, 
                           NULL);
     }
     if (s->lot) {
         /* A change of value/amnt affects gains display, etc. */
-        qof_event_gen (&s->lot->inst.entity, QOF_EVENT_MODIFY, NULL);
+        qof_event_gen (&s->lot->inst, QOF_EVENT_MODIFY, NULL);
     }
 
     /* Important: we save off the original parent transaction and account
@@ -590,7 +590,7 @@
         s->inst.do_free = FALSE;
         ed.node = s;
         ed.idx = -1; /* unused */
-        qof_event_gen(&s->parent->inst.entity, GNC_EVENT_ITEM_ADDED, &ed);
+        qof_event_gen(&s->parent->inst, GNC_EVENT_ITEM_ADDED, &ed);
     }
 
     /* But for the parent trans, we want the intermediate events, so
@@ -1117,7 +1117,7 @@
    ed.idx = xaccTransGetSplitIndex(trans, split);
    qof_instance_set_dirty(QOF_INSTANCE(split));
    split->inst.do_free = TRUE;
-   qof_event_gen(&trans->inst.entity, GNC_EVENT_ITEM_REMOVED, &ed);
+   qof_event_gen(&trans->inst, GNC_EVENT_ITEM_REMOVED, &ed);
    xaccTransCommitEdit(trans);
 
    return TRUE;
@@ -1172,7 +1172,7 @@
   DATE_CMP(sa,sb,date_reconciled);
 
   /* else, sort on guid - keeps sort stable. */
-  retval = guid_compare(&(sa->inst.entity.guid), &(sb->inst.entity.guid));
+  retval = guid_compare(&(sa->inst.guid), &(sb->inst.guid));
   if (retval) return retval;
 
   return 0;
@@ -1487,7 +1487,7 @@
     ed.node = s;
     if (old_trans) {
         ed.idx = xaccTransGetSplitIndex(old_trans, s);
-        qof_event_gen(&old_trans->inst.entity, GNC_EVENT_ITEM_REMOVED, &ed);
+        qof_event_gen(&old_trans->inst, GNC_EVENT_ITEM_REMOVED, &ed);
     }
     s->parent = t;
 
@@ -1503,7 +1503,7 @@
             t->splits = g_list_append(t->splits, s);
         
         ed.idx = -1; /* unused */
-        qof_event_gen(&t->inst.entity, GNC_EVENT_ITEM_ADDED, &ed);
+        qof_event_gen(&t->inst, GNC_EVENT_ITEM_ADDED, &ed);
     }
     xaccTransCommitEdit(t);
 }
@@ -1769,7 +1769,7 @@
 }
 
 static void
-qofSplitSetParentTrans(Split *s, QofEntity *ent)
+qofSplitSetParentTrans(Split *s, QofInstance *ent)
 {
     Transaction *trans = (Transaction*)ent;
 
@@ -1778,7 +1778,7 @@
 }
 
 static void
-qofSplitSetAccount(Split *s, QofEntity *ent)
+qofSplitSetAccount(Split *s, QofInstance *ent)
 {
     Account *acc = (Account*)ent;
 
@@ -1798,7 +1798,7 @@
     { "d-share-amount", QOF_TYPE_DOUBLE,  
       (QofAccessFunc)DxaccSplitGetShareAmount, NULL },
     { "d-share-int64", QOF_TYPE_INT64, 
-      (QofAccessFunc)qof_entity_get_guid, NULL },
+      (QofAccessFunc)qof_instance_get_guid, NULL },
     { SPLIT_BALANCE, QOF_TYPE_NUMERIC, 
       (QofAccessFunc)xaccSplitGetBalance, NULL },
     { SPLIT_CLEARED_BALANCE, QOF_TYPE_NUMERIC,
@@ -1839,7 +1839,7 @@
     { SPLIT_KVP, QOF_TYPE_KVP, (QofAccessFunc)xaccSplitGetSlots, NULL },
     { QOF_PARAM_BOOK, QOF_ID_BOOK, (QofAccessFunc)xaccSplitGetBook, NULL },
     { QOF_PARAM_GUID, QOF_TYPE_GUID, 
-      (QofAccessFunc)qof_entity_get_guid, NULL },
+      (QofAccessFunc)qof_instance_get_guid, NULL },
     { NULL },
   };
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Split.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Split.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Split.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -72,7 +72,7 @@
 Split       * xaccMallocSplit (QofBook *book);
 
 /* Reinit a previously malloc'd split. Split remains in the book it
-   was already in, and the QofEntity portions also remain unchanged.
+   was already in, and the QofInstance portions also remain unchanged.
    It's basically the data elements that are reverted to default
    values. */
 void xaccSplitReinit(Split * split);
@@ -482,9 +482,9 @@
 /** @} */
 
 /** \deprecated */
-#define xaccSplitGetGUID(X)      qof_entity_get_guid(QOF_ENTITY(X))
+#define xaccSplitGetGUID(X)      qof_instance_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccSplitReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
+#define xaccSplitReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 #endif /* XACC_SPLIT_H */
 /** @} */

Modified: gnucash/gobject-engine-dev-warlord/src/engine/SplitP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/SplitP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/SplitP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -135,7 +135,7 @@
 /* Set the split's GUID. This should only be done when reading
  * a split from a datafile, or some other external source. Never
  * call this on an existing split! */
-#define xaccSplitSetGUID(s,g) qof_entity_set_guid(QOF_ENTITY(s),g)
+#define xaccSplitSetGUID(s,g) qof_instance_set_guid(QOF_INSTANCE(s),g)
 
 /* The xaccFreeSplit() method simply frees all memory associated
  * with the split.  It does not verify that the split isn't

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Transaction.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Transaction.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Transaction.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -219,12 +219,12 @@
     Account *account = s->acc;
     GNCLot *lot = s->lot;
     if (account)
-      qof_event_gen (&account->inst.entity, GNC_EVENT_ITEM_CHANGED, s);
+      qof_event_gen (&account->inst, GNC_EVENT_ITEM_CHANGED, s);
 
     if (lot)
     {
       /* A change of transaction date might affect opening date of lot */
-      qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
+      qof_event_gen (&lot->inst, QOF_EVENT_MODIFY, NULL);
     }
   }
 #endif
@@ -274,7 +274,7 @@
 
   trans = g_new(Transaction, 1);
   xaccInitTransaction (trans, book);
-  qof_event_gen (&trans->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&trans->inst, QOF_EVENT_CREATE, NULL);
 
   return trans;
 }
@@ -376,9 +376,9 @@
    * the cloned transaction as something official.  If we ever 
    * use this transaction, we'll have to fix this up.
    */
-  trans->inst.entity.e_type = NULL;
-  trans->inst.entity.guid = *guid_null();
-  trans->inst.entity.collection = NULL;
+  trans->inst.e_type = NULL;
+  trans->inst.guid = *guid_null();
+  trans->inst.collection = NULL;
   trans->inst.book = t->inst.book;
   trans->inst.editlevel = 0;
   trans->inst.do_free = FALSE;
@@ -522,7 +522,7 @@
   if (ta == tb) return TRUE;
 
   if (check_guids) {
-    if (!guid_equal(&(ta->inst.entity.guid), &(tb->inst.entity.guid)))
+    if (!guid_equal(&(ta->inst.guid), &(tb->inst.guid)))
     {
       PWARN ("GUIDs differ");
       return FALSE;
@@ -885,7 +885,7 @@
   if (!shutting_down)
     xaccTransWriteLog (trans, 'D');
 
-  qof_event_gen (&trans->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&trans->inst, QOF_EVENT_DESTROY, NULL);
 
   /* We only own the splits that still think they belong to us. */
   trans->splits = g_list_copy(trans->splits);
@@ -953,14 +953,14 @@
             ed.node = trans;
             ed.idx = g_list_index(trans->splits, s);
             trans->splits = g_list_remove(trans->splits, s);
-            qof_event_gen(&s->inst.entity, QOF_EVENT_REMOVE, &ed);
+            qof_event_gen(&s->inst, QOF_EVENT_REMOVE, &ed);
         }
 
         if (s->parent == trans) {
             /* Split was either added, destroyed or just changed */
             if (s->inst.do_free)
-                qof_event_gen(&s->inst.entity, QOF_EVENT_DESTROY, NULL);
-            else qof_event_gen(&s->inst.entity, QOF_EVENT_MODIFY, NULL);
+                qof_event_gen(&s->inst, QOF_EVENT_DESTROY, NULL);
+            else qof_event_gen(&s->inst, QOF_EVENT_MODIFY, NULL);
             xaccSplitCommitEdit(s);
         }
     }
@@ -983,7 +983,7 @@
     g_assert(trans->inst.editlevel == 0);
 
     gen_event_trans (trans); //TODO: could be conditional
-    qof_event_gen (&trans->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen (&trans->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void
@@ -1241,7 +1241,7 @@
     return retval;
 
   /* else, sort on guid - keeps sort stable. */
-  return guid_compare(&(ta->inst.entity.guid), &(tb->inst.entity.guid));
+  return guid_compare(&(ta->inst.guid), &(tb->inst.guid));
 }
 
 /********************************************************************\
@@ -1967,7 +1967,7 @@
     { QOF_PARAM_BOOK, QOF_ID_BOOK,      
       (QofAccessFunc)qof_instance_get_book, NULL },
     { QOF_PARAM_GUID, QOF_TYPE_GUID,    
-      (QofAccessFunc)qof_entity_get_guid, NULL },
+      (QofAccessFunc)qof_instance_get_guid, NULL },
     { NULL },
   };
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/Transaction.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/Transaction.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/Transaction.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -550,9 +550,9 @@
 /** \deprecated */
 #define xaccTransGetBook(X)      qof_instance_get_book (QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccTransGetGUID(X)      qof_entity_get_guid(QOF_ENTITY(X))
+#define xaccTransGetGUID(X)      qof_instance_get_guid(QOF_INSTANCE(X))
 /** \deprecated */
-#define xaccTransReturnGUID(X) (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
+#define xaccTransReturnGUID(X) (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 /** \deprecated */
 #define xaccTransGetSlots(X)     qof_instance_get_slots (QOF_INSTANCE(X))
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/TransactionP.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/TransactionP.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/TransactionP.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -123,7 +123,7 @@
 /* Set the transaction's GUID. This should only be done when reading
  * a transaction from a datafile, or some other external source. Never
  * call this on an existing transaction! */
-#define xaccTransSetGUID(t,g) qof_entity_set_guid(QOF_ENTITY(t),g)
+#define xaccTransSetGUID(t,g) qof_instance_set_guid(QOF_INSTANCE(t),g)
 
 /* This routine makes a 'duplicate' of the indicated transaction.
  * This routine cannot be exposed publically since the duplicate

Modified: gnucash/gobject-engine-dev-warlord/src/engine/cap-gains.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/cap-gains.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/cap-gains.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -659,7 +659,7 @@
 
    /* Both splits will be in the same collection, so search there. */
    gains_split = (Split*) qof_collection_lookup_entity (
-       split->inst.entity.collection, gains_guid);
+       split->inst.collection, gains_guid);
    PINFO ("split=%p has gains-split=%p", split, gains_split);
    return gains_split;
 }
@@ -682,7 +682,7 @@
 
    /* Both splits will be in the same collection, so search there. */
    source_split = (Split*) qof_collection_lookup_entity(
-       split->inst.entity.collection, source_guid);
+       split->inst.collection, source_guid);
    PINFO ("split=%p has source-split=%p", split, source_split);
    return source_split;
 }

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -65,7 +65,7 @@
     /* We first send the message that this object is about to be
      * destroyed so that any GUI elements can remove it before it is
      * actually gone. */
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_DESTROY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_DESTROY, NULL);
 
     CACHE_REMOVE(budget->name);
     CACHE_REMOVE(budget->description);
@@ -109,7 +109,7 @@
     gnc_budget_set_description(budget, "");
     gnc_budget_set_num_periods(budget, 12);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_CREATE , NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_CREATE , NULL);
 
     LEAVE(" ");
     return budget;
@@ -135,7 +135,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 const gchar*
@@ -156,7 +156,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 const gchar*
@@ -175,7 +175,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen(&budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen(&budget->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 const Recurrence *
@@ -190,7 +190,7 @@
 {
     g_return_val_if_fail(budget, NULL);
     g_return_val_if_fail(GNC_IS_BUDGET(budget), NULL);
-    return qof_entity_get_guid(QOF_ENTITY(budget));
+    return qof_instance_get_guid(QOF_INSTANCE(budget));
 }
 
 void
@@ -203,7 +203,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 guint
@@ -237,7 +237,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
 
 }
 
@@ -265,7 +265,7 @@
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
-    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+    qof_event_gen( &budget->inst, QOF_EVENT_MODIFY, NULL);
 
 }
 
@@ -377,7 +377,7 @@
     return GNC_BUDGET(qof_collection_lookup_entity (col, guid));
 }
 
-static void just_get_one(QofEntity *ent, gpointer data)
+static void just_get_one(QofInstance *ent, gpointer data)
 {
     GncBudget **bgt = (GncBudget**)data;
     if (bgt && !*bgt) *bgt = GNC_BUDGET(ent);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-budget.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -90,7 +90,7 @@
 
 const GUID* gnc_budget_get_guid(GncBudget* budget);
 #define gnc_budget_return_guid(X) \
-  (X ? *(qof_entity_get_guid(QOF_ENTITY(X))) : *(guid_null()))
+  (X ? *(qof_instance_get_guid(QOF_INSTANCE(X))) : *(guid_null()))
 
 /** Set/Get the name of the Budget */
 void gnc_budget_set_name(GncBudget* budget, const gchar* name);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-commodity.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-commodity.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-commodity.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -499,7 +499,7 @@
 mark_commodity_dirty (gnc_commodity *cm)
 {
   qof_instance_set_dirty(&cm->inst);
-  qof_event_gen (&cm->inst.entity, QOF_EVENT_MODIFY, NULL);
+  qof_event_gen (&cm->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 static void
@@ -554,7 +554,7 @@
   reset_unique_name(retval);
   if (gnc_commodity_namespace_is_iso(namespace))
     retval->quote_source = gnc_quote_source_lookup_by_internal("currency");
-  qof_event_gen (&retval->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&retval->inst, QOF_EVENT_CREATE, NULL);
 
   return retval;
 }
@@ -575,7 +575,7 @@
   table = gnc_commodity_table_get_table(book);
   gnc_commodity_table_remove(table, cm);
 
-  qof_event_gen (&cm->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&cm->inst, QOF_EVENT_DESTROY, NULL);
 
   /* Set at creation */
   CACHE_REMOVE (cm->fullname);
@@ -1285,7 +1285,7 @@
                       (gpointer)comm);
   nsp->cm_list = g_list_append(nsp->cm_list, comm);
 
-  qof_event_gen (&comm->inst.entity, QOF_EVENT_ADD, NULL);
+  qof_event_gen (&comm->inst, QOF_EVENT_ADD, NULL);
   LEAVE ("(table=%p, comm=%p)", table, comm);
   return comm;
 }
@@ -1310,7 +1310,7 @@
   c = gnc_commodity_table_lookup (table, ns_name, comm->mnemonic);
   if (c != comm) return;
 
-  qof_event_gen (&comm->inst.entity, QOF_EVENT_REMOVE, NULL);
+  qof_event_gen (&comm->inst, QOF_EVENT_REMOVE, NULL);
 
   nsp = gnc_commodity_table_find_namespace(table, ns_name);
   if (!nsp) return;
@@ -1527,13 +1527,13 @@
     ns->name = CACHE_INSERT((gpointer)namespace);
     ns->iso4217 = gnc_commodity_namespace_is_iso(namespace);
     qof_instance_init (&ns->inst, GNC_ID_COMMODITY_NAMESPACE, book);
-    qof_event_gen (&ns->inst.entity, QOF_EVENT_CREATE, NULL);
+    qof_event_gen (&ns->inst, QOF_EVENT_CREATE, NULL);
     
     g_hash_table_insert(table->ns_table,
 			(gpointer) ns->name, 
 			(gpointer) ns);
     table->ns_list = g_list_append(table->ns_list, ns);
-    qof_event_gen (&ns->inst.entity, QOF_EVENT_ADD, NULL);
+    qof_event_gen (&ns->inst, QOF_EVENT_ADD, NULL);
   }
   return ns;
 }
@@ -1597,7 +1597,7 @@
   if (!ns)
     return;
 
-  qof_event_gen (&ns->inst.entity, QOF_EVENT_REMOVE, NULL);
+  qof_event_gen (&ns->inst, QOF_EVENT_REMOVE, NULL);
   g_hash_table_remove(table->ns_table, namespace);
   table->ns_list = g_list_remove(table->ns_list, ns);
 
@@ -1608,7 +1608,7 @@
   g_hash_table_destroy(ns->cm_table);
   CACHE_REMOVE(ns->name);
 
-  qof_event_gen (&ns->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&ns->inst, QOF_EVENT_DESTROY, NULL);
   qof_instance_release(&ns->inst);
   g_free(ns);
 }

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -60,7 +60,7 @@
   unsigned char marker;
 };
 
-#define gnc_lot_set_guid(L,G)  qof_entity_set_guid(QOF_ENTITY(L),&(G))
+#define gnc_lot_set_guid(L,G)  qof_instance_set_guid(QOF_INSTANCE(L),&(G))
 
 /* Register with the Query engine */
 gboolean gnc_lot_register (void);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -73,7 +73,7 @@
 
    lot = g_new (GNCLot, 1);
    gnc_lot_init (lot, book);
-   qof_event_gen (&lot->inst.entity, QOF_EVENT_CREATE, NULL);
+   qof_event_gen (&lot->inst, QOF_EVENT_CREATE, NULL);
    return lot;
 }
 
@@ -84,7 +84,7 @@
    if (!lot) return;
    
    ENTER ("(lot=%p)", lot);
-   qof_event_gen (&lot->inst.entity, QOF_EVENT_DESTROY, NULL);
+   qof_event_gen (&lot->inst, QOF_EVENT_DESTROY, NULL);
 
    
    for (node=lot->splits; node; node=node->next)
@@ -340,7 +340,7 @@
    lot->is_closed = -1;
    gnc_lot_commit_edit(lot);
 
-   qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
+   qof_event_gen (&lot->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 void
@@ -361,7 +361,7 @@
       lot->account = NULL;
    }
    gnc_lot_commit_edit(lot);
-   qof_event_gen (&lot->inst.entity, QOF_EVENT_MODIFY, NULL);
+   qof_event_gen (&lot->inst, QOF_EVENT_MODIFY, NULL);
 }
 
 /* ============================================================== */
@@ -453,7 +453,7 @@
           (QofAccessFunc) gnc_lot_get_notes, 
           (QofSetterFunc) gnc_lot_set_notes },
         { QOF_PARAM_GUID, QOF_TYPE_GUID, 
-          (QofAccessFunc) qof_entity_get_guid, NULL },
+          (QofAccessFunc) qof_instance_get_guid, NULL },
         { QOF_PARAM_BOOK, QOF_ID_BOOK, 
           (QofAccessFunc) gnc_lot_get_book, NULL },
         { LOT_IS_CLOSED, QOF_TYPE_BOOLEAN, 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-lot.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -139,7 +139,7 @@
  * */
 KvpFrame * gnc_lot_get_slots (GNCLot *);
 
-#define gnc_lot_get_guid(X)  qof_entity_get_guid(QOF_ENTITY(X))
+#define gnc_lot_get_guid(X)  qof_instance_get_guid(QOF_INSTANCE(X))
 
 #define LOT_IS_CLOSED	"is-closed?"
 #define LOT_BALANCE	"balance"

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb-p.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -88,7 +88,7 @@
   Timespec time;
 } GNCPriceLookupHelper;
 
-#define  gnc_price_set_guid(P,G)  qof_entity_set_guid(QOF_ENTITY(P),(G))
+#define  gnc_price_set_guid(P,G)  qof_instance_set_guid(QOF_INSTANCE(P),(G))
 void     gnc_pricedb_substitute_commodity(GNCPriceDB *db,
                                           gnc_commodity *old_c,
                                           gnc_commodity *new_c);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -57,7 +57,7 @@
   p->source = NULL;
 
   qof_instance_init (&p->inst, GNC_ID_PRICE, book);
-  qof_event_gen (&p->inst.entity, QOF_EVENT_CREATE, NULL);
+  qof_event_gen (&p->inst, QOF_EVENT_CREATE, NULL);
 
   return p;
 }
@@ -66,7 +66,7 @@
 gnc_price_destroy (GNCPrice *p)
 {
   ENTER(" ");
-  qof_event_gen (&p->inst.entity, QOF_EVENT_DESTROY, NULL);
+  qof_event_gen (&p->inst, QOF_EVENT_DESTROY, NULL);
 
   if(p->type) CACHE_REMOVE(p->type);
   if(p->source) CACHE_REMOVE(p->source);
@@ -820,7 +820,7 @@
   }
   g_hash_table_insert(currency_hash, currency, price_list);
   p->db = db;
-  qof_event_gen (&p->inst.entity, QOF_EVENT_ADD, NULL);
+  qof_event_gen (&p->inst, QOF_EVENT_ADD, NULL);
 
   LEAVE ("db=%p, pr=%p dirty=%d do-free=%d commodity=%s/%s currency_hash=%p",
          db, p, p->inst.dirty, p->inst.do_free,
@@ -885,7 +885,7 @@
   currency_hash = g_hash_table_lookup(db->commodity_hash, commodity);
   if(!currency_hash) { LEAVE (" no currency hash"); return FALSE; }
 
-  qof_event_gen (&p->inst.entity, QOF_EVENT_REMOVE, NULL);
+  qof_event_gen (&p->inst, QOF_EVENT_REMOVE, NULL);
   price_list = g_hash_table_lookup(currency_hash, currency);
   gnc_price_ref(p);
   if(!gnc_price_list_remove(&price_list, p)) {
@@ -2376,7 +2376,7 @@
 }
 
 static void
-price_foreach(const QofCollection *col, QofEntityForeachCB cb, gpointer data)
+price_foreach(const QofCollection *col, QofInstanceForeachCB cb, gpointer data)
 {
   GNCPriceDB *db;
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/gnc-pricedb.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -197,8 +197,8 @@
 gint32          gnc_price_get_version(GNCPrice *p);
 gboolean        gnc_price_equal(GNCPrice *p1, GNCPrice *p2);
 
-#define gnc_price_get_guid(X)    qof_entity_get_guid(QOF_ENTITY(X))
-#define gnc_price_return_guid(X) (*(qof_entity_get_guid(QOF_ENTITY(X))))
+#define gnc_price_get_guid(X)    qof_instance_get_guid(QOF_INSTANCE(X))
+#define gnc_price_return_guid(X) (*(qof_instance_get_guid(QOF_INSTANCE(X))))
 #define gnc_price_get_book(X)    qof_instance_get_book(QOF_INSTANCE(X))
 /**  @} */
 

Modified: gnucash/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/test/test-book-merge.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -94,7 +94,7 @@
 	g->active = TRUE;
 	g->version = 1;
 	g->minor = 1;
-	qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
 	return g;
 }
 
@@ -285,8 +285,8 @@
 	do_test ((NULL != &import_obj->inst), "#4 instance init");
 	obj_setGUID(import_obj,qof_instance_get_guid(&import_obj->inst));
 	do_test ((NULL != &import_obj->obj_guid), "#5 guid set");
-	qof_event_gen(&import_obj->inst.entity, QOF_EVENT_CREATE, NULL);
-	do_test ((NULL != &import_obj->inst.entity), "#6 gnc event create");
+	qof_event_gen(&import_obj->inst, QOF_EVENT_CREATE, NULL);
+	do_test ((NULL != &import_obj->inst), "#6 gnc event create");
 	obj_setName(import_obj, import_init);
 	do_test ((NULL != &import_obj->Name), "#7 string set");
 	obj_amount = double_to_gnc_numeric(init_value,1, GNC_HOW_DENOM_EXACT);
@@ -313,7 +313,7 @@
 	new_obj = g_new(myobj, 1);
 	qof_instance_init (&new_obj->inst, TEST_MODULE_NAME, import);
 	obj_setGUID(new_obj,qof_instance_get_guid(&new_obj->inst));
-	qof_event_gen (&new_obj->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen (&new_obj->inst, QOF_EVENT_CREATE, NULL);
 	obj_setName(new_obj, import_init);
 	obj_setAmount(new_obj, obj_amount);
 	obj_setActive(new_obj, active);
@@ -333,7 +333,7 @@
 	target_obj = g_new(myobj, 1);
 	qof_instance_init (&target_obj->inst, TEST_MODULE_NAME, target);
 	obj_setGUID(target_obj,qof_instance_get_guid(&target_obj->inst));
-	qof_event_gen (&target_obj->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen (&target_obj->inst, QOF_EVENT_CREATE, NULL);
 	obj_setName(target_obj, target_init);
 	obj_setAmount(target_obj, obj_amount);
 	obj_setActive(target_obj, active);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/test/test-guid.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/test/test-guid.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/test/test-guid.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -53,7 +53,7 @@
   int i;
   QofSession *sess;
   QofBook *book;
-  QofEntity *eblk;
+  QofInstance *eblk;
   QofCollection *col;
   QofIdType type;
 
@@ -65,10 +65,10 @@
   type = qof_collection_get_type (col);
   
 #define NENT 500123
-  eblk = g_new0(QofEntity, NENT);
+  eblk = g_new0(QofInstance, NENT);
   for (i=0; i<NENT; i++)
   {
-    QofEntity *ent = &eblk[i];
+    QofInstance *ent = &eblk[i];
     guid_new(&ent->guid);
     do_test ((NULL == qof_collection_lookup_entity (col, &ent->guid)),
 						  "duplicate guid");

Modified: gnucash/gobject-engine-dev-warlord/src/engine/test/test-object.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/test/test-object.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/test/test-object.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -33,7 +33,7 @@
 #define TEST_MODULE_NAME "object-test"
 #define TEST_MODULE_DESC "Test Object"
 
-static void obj_foreach (const QofCollection *, QofEntityForeachCB, gpointer);
+static void obj_foreach (const QofCollection *, QofInstanceForeachCB, gpointer);
 static const char * printable (gpointer obj);
 static void test_printable (const char *name, gpointer obj);
 static void test_foreach (QofBook *, const char *);
@@ -79,7 +79,7 @@
 }
 
 static void
-obj_foreach (const QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
+obj_foreach (const QofCollection *col, QofInstanceForeachCB cb, gpointer u_d)
 {
   int *foo = u_d;
 
@@ -89,7 +89,7 @@
   *foo = 1;
 }
 
-static void foreachCB (QofEntity *ent, gpointer u_d)
+static void foreachCB (QofInstance *ent, gpointer u_d)
 {
   do_test (FALSE, "FAIL");
 }

Modified: gnucash/gobject-engine-dev-warlord/src/engine/test/test-recursive.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/test/test-recursive.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/test/test-recursive.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -182,7 +182,7 @@
 	g->Amount = get_random_gnc_numeric();
 	g->child = NULL;
 	g->descend = NULL;
-	qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
 	return g;
 }
 
@@ -203,7 +203,7 @@
 	g->Name = get_random_string();
 	g->Amount = get_random_gnc_numeric();
 	g->child = NULL;
-	qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
 	return g;
 }
 
@@ -223,12 +223,12 @@
 	g->flag = get_random_character();
 	g->Name = get_random_string();
 	g->Amount = get_random_gnc_numeric();
-	qof_event_gen(&g->inst.entity, QOF_EVENT_CREATE, NULL);
+	qof_event_gen(&g->inst, QOF_EVENT_CREATE, NULL);
 	return g;
 }
 
 static void
-descend_cb (QofEntity *ent, gpointer user_data)
+descend_cb (QofInstance *ent, gpointer user_data)
 {
 	mygrand *g = (mygrand*)user_data;
 
@@ -251,14 +251,14 @@
 grand_getDescend(mygrand *g)
 {
 	QofCollection *col;
-	QofEntity *ent;
+	QofInstance *ent;
 	GList *list;
 
 	g_return_val_if_fail(g, NULL);
 	col = qof_collection_new(CHILD_MODULE_NAME);
 	for(list = g_list_copy(g->descend);list;list=list->next)
 	{
-		ent = QOF_ENTITY(list->data);
+		ent = QOF_INSTANCE(list->data);
 		if(!ent) { break; }
 		do_test(0 == safe_strcmp(ent->e_type, CHILD_MODULE_NAME), "wrong entity");
 		qof_collection_add_entity(col, ent);
@@ -869,9 +869,9 @@
 			do_test((coll != NULL), "grandparent not valid");
 			if(coll)
 			{
-				QofEntity *ent;
+				QofInstance *ent;
 
-				ent = QOF_ENTITY(child1);
+				ent = QOF_INSTANCE(child1);
 				qof_collection_add_entity(coll, ent);
 				grand_setDescend(grand1, coll);
 				qof_collection_destroy(coll);
@@ -891,9 +891,9 @@
 };
 
 static void
-check_cb (QofEntity *ent, gpointer data)
+check_cb (QofInstance *ent, gpointer data)
 {
-	QofEntity *parent, *child;
+	QofInstance *parent, *child;
 	QofCollection *coll;
 	struct tally *c;
 	const QofParam *param;
@@ -913,7 +913,7 @@
 	c->collect = qof_collection_count(coll);
 	if(c->book) { qof_book_set_references(c->book); }
 	param = qof_class_get_parameter(GRAND_MODULE_NAME, OBJ_RELATIVE);
-	parent = QOF_ENTITY(param->param_getfcn(ent, param));
+	parent = QOF_INSTANCE(param->param_getfcn(ent, param));
 	testp = grand_getChild((mygrand*)ent);
 	/* not all grandparents have family so just keep count. */
 	if(!parent) { c->nulls++; return; }
@@ -945,7 +945,7 @@
 	copy = qof_session_new();
 	if(debug) { qof_session_begin(copy, QOF_STDOUT, TRUE, FALSE); }
 	/* TODO: implement QOF_TYPE_CHOICE testing. */
-	qof_entity_copy_coll_r(copy, grand_coll);
+	qof_instance_copy_coll_r(copy, grand_coll);
 	/* test the original */
 	qof_object_foreach(GRAND_MODULE_NAME, book, check_cb, &c);
 	book = qof_session_get_book(copy);

Modified: gnucash/gobject-engine-dev-warlord/src/engine/xlate.pl
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/engine/xlate.pl	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/engine/xlate.pl	2007-04-01 22:18:50 UTC (rev 15773)
@@ -192,18 +192,18 @@
 
 		s/GNCIdTypeConst/QofIdTypeConst/g;
 		s/GNCIdType/QofIdType/g;
-		s/GNCEntityTable/QofEntityTable/g;
+		s/GNCEntityTable/QofInstanceTable/g;
 		s/xaccGUIDTypeEntityTable/qof_guid_type/g;
 
-		s/xaccEntityTableNew/qof_entity_new/g;
-		s/xaccEntityTableDestroy/qof_entity_destroy/g;
-		s/xaccGUIDNewEntityTable/qof_entity_guid_new/g;
-		s/xaccLookupEntity/qof_entity_lookup/g;
-		s/xaccStoreEntity/qof_entity_store/g;
-		s/xaccRemoveEntity/qof_entity_remove/g;
-		s/xaccForeachEntity/qof_entity_foreach/g;
+		s/xaccEntityTableNew/qof_instance_new/g;
+		s/xaccEntityTableDestroy/qof_instance_destroy/g;
+		s/xaccGUIDNewEntityTable/qof_instance_guid_new/g;
+		s/xaccLookupEntity/qof_instance_lookup/g;
+		s/xaccStoreEntity/qof_instance_store/g;
+		s/xaccRemoveEntity/qof_instance_remove/g;
+		s/xaccForeachEntity/qof_instance_foreach/g;
 
-		s/foreachObjectCB/QofEntityForeachCB/g;
+		s/foreachObjectCB/QofInstanceForeachCB/g;
 		s/GNC_OBJECT_VERSION/QOF_OBJECT_VERSION/g;
 
 		s/GNCSession/QofSession/g;

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -58,7 +58,7 @@
 }chart_data;
 
 static void
-chart_collection_cb(QofEntity *ent, gpointer user_data)
+chart_collection_cb(QofInstance *ent, gpointer user_data)
 {
 	chart_data *data;
 	Account *acc;
@@ -73,9 +73,9 @@
 	if(0 == safe_strcmp(EQUITY_ACCOUNT_NAME, xaccAccountGetName(acc)) 
 		&& (xaccAccountGetType(acc) == ACCT_TYPE_EQUITY))
 	{
-		success = qof_entity_copy_to_session(data->chart_session, ent);
+		success = qof_instance_copy_to_session(data->chart_session, ent);
 		if(!success) { return; }
-		guid = qof_entity_get_guid(ent);
+		guid = qof_instance_get_guid(ent);
 		book = qof_session_get_book(data->chart_session);
 		copy_coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
 		data->equity_account = (Account*)qof_collection_lookup_entity(copy_coll, guid);
@@ -84,9 +84,9 @@
 }
 
 static void
-chart_reference_cb(QofEntity *ent, gpointer user_data)
+chart_reference_cb(QofInstance *ent, gpointer user_data)
 {
-	QofEntityReference *reference;
+	QofInstanceReference *reference;
 	QofParam     *ref_param;
 	chart_data   *data;
 
@@ -94,14 +94,14 @@
 	data = (chart_data*)user_data;
 	while(data->param_ref_list != NULL) {
 		ref_param = data->param_ref_list->data;
-		reference = qof_entity_get_reference_from(ent, ref_param);
+		reference = qof_instance_get_reference_from(ent, ref_param);
 		qof_session_update_reference_list(data->chart_session, reference);
 		data->param_ref_list = data->param_ref_list->next;
 	}
 }
 
 static void
-chart_entity_cb(QofEntity *ent, gpointer user_data)
+chart_entity_cb(QofInstance *ent, gpointer user_data)
 {
 	chart_data *data;
 	Account *acc_ent, *equity_account;
@@ -113,19 +113,19 @@
 	const GUID *guid;
 	time_t trans_time;
 	GList *ref;
-	QofEntityReference *ent_ref;
+	QofInstanceReference *ent_ref;
 	
 	g_return_if_fail(user_data != NULL);
 	data = (chart_data*)user_data;
 	trans_time = data->chart_time_t;
 	data->param_ref_list = NULL;
-	guid = qof_entity_get_guid(ent);
+	guid = qof_instance_get_guid(ent);
 	acc_ent = (Account*)ent;
 	ref = NULL;
 	equity_account = data->equity_account;
 	g_return_if_fail(equity_account != NULL);
 	balance = xaccAccountGetBalanceAsOfDate(acc_ent, data->chart_time_t);
-	qof_entity_copy_to_session(data->chart_session, ent);
+	qof_instance_copy_to_session(data->chart_session, ent);
 	book = qof_session_get_book(data->chart_session);
 	coll = qof_book_get_collection(book, GNC_ID_ACCOUNT);
 	acc_ent = (Account*)qof_collection_lookup_entity(coll, guid);
@@ -151,7 +151,7 @@
 	xaccSplitSetValue (split, balance);
 	ref = qof_class_get_referenceList(GNC_ID_SPLIT);
 	while(ref != NULL) {
-		ent_ref = qof_entity_get_reference_from(QOF_ENTITY(split), ref->data);
+		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
 		qof_session_update_reference_list(data->chart_session, ent_ref);
 		ref = g_list_next(ref);
 	}
@@ -168,14 +168,14 @@
 	xaccAccountCommitEdit (acc_ent);
 	ref = qof_class_get_referenceList(GNC_ID_TRANS);
 	while(ref != NULL) {
-		ent_ref = qof_entity_get_reference_from(QOF_ENTITY(trans), ref->data);
+		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(trans), ref->data);
 		qof_session_update_reference_list(data->chart_session, ent_ref);
 		ref = g_list_next(ref);
 	}
 	g_list_free(ref);
 	ref = qof_class_get_referenceList(GNC_ID_SPLIT);
 	while(ref != NULL) {
-		ent_ref = qof_entity_get_reference_from(QOF_ENTITY(split), ref->data);
+		ent_ref = qof_instance_get_reference_from(QOF_INSTANCE(split), ref->data);
 		qof_session_update_reference_list(data->chart_session, ent_ref);
 		ref = g_list_next(ref);
 	}

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/dialog-chart-export.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -31,8 +31,8 @@
 */
 /** @addtogroup ChartExport Export a chart of accounts.
 
-Remember to use qof_entity_copy routines
-like ::qof_entity_copy_to_session so that the QofBook is marked
+Remember to use qof_instance_copy routines
+like ::qof_instance_copy_to_session so that the QofBook is marked
 as \a partial. 
 
 \par guidelines Guidelines for partial book export

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/dialog-sx-editor.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/dialog-sx-editor.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/dialog-sx-editor.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -1659,7 +1659,7 @@
 }
 
 static void
-_sx_engine_event_handler(QofEntity *ent, QofEventId event_type, gpointer user_data, gpointer evt_data)
+_sx_engine_event_handler(QofInstance *ent, QofEventId event_type, gpointer user_data, gpointer evt_data)
 {
     Account *acct;
     QofBook *book;

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/druid-hierarchy.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/druid-hierarchy.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -754,7 +754,7 @@
 	  g_object_set (G_OBJECT(cell), "text", "", NULL);
 	}
 	set_final_balance (data->balance_hash, account, amount);
-	qof_event_gen (QOF_ENTITY(account), QOF_EVENT_MODIFY, NULL);
+	qof_event_gen (QOF_INSTANCE(account), QOF_EVENT_MODIFY, NULL);
 }
 
 static void

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -188,7 +188,7 @@
 	gnc_resume_gui_refresh ();
 }
 
-void currency_transfer_cb ( QofEntity* ent, gpointer user_data)
+void currency_transfer_cb ( QofInstance* ent, gpointer user_data)
 {
 	if(!ent) return;
 	if(xaccAccountGetCommodity((Account*)ent) == NULL) {
@@ -197,7 +197,7 @@
 }
 
 /* If the account has no parent, shove it into the top level under the root. */
-void reference_parent_cb ( QofEntity* ent, gpointer user_data)
+void reference_parent_cb ( QofInstance* ent, gpointer user_data)
 {
 	Account *root;
 

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.h
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.h	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/druid-merge.h	2007-04-01 22:18:50 UTC (rev 15773)
@@ -79,10 +79,10 @@
 #define GNC_QSF_IMPORT "gnc-qsf-import-druid"
 
 /** \brief 	gncCommodity is not QOF enabled, need to set a default commodity before the merge */
-void currency_transfer_cb ( QofEntity* ent, gpointer user_data);
+void currency_transfer_cb ( QofInstance* ent, gpointer user_data);
 
 /** \brief workaround for AccountGroup not being fully QOF enabled. Eh? */
-void reference_parent_cb ( QofEntity* ent, gpointer user_data);
+void reference_parent_cb ( QofInstance* ent, gpointer user_data);
 
 /** @} */
 /** @} */

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/gnc-plugin-page-register.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/gnc-plugin-page-register.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -149,7 +149,7 @@
 
 static void gnc_plugin_page_register_ui_update (gpointer various, GncPluginPageRegister *page);
 static void gppr_account_destroy_cb (Account *account);
-static void gnc_plugin_page_register_event_handler (QofEntity *entity,
+static void gnc_plugin_page_register_event_handler (QofInstance *entity,
 						    QofEventId event_type,
 						    GncPluginPageRegister *page,
 						    GncEventData *ed);
@@ -2837,7 +2837,7 @@
  *  @param ed
  */
 static void
-gnc_plugin_page_register_event_handler (QofEntity *entity,
+gnc_plugin_page_register_event_handler (QofInstance *entity,
 					QofEventId event_type,
 					GncPluginPageRegister *page,
 					GncEventData *ed)

Modified: gnucash/gobject-engine-dev-warlord/src/gnome/top-level.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome/top-level.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome/top-level.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -83,7 +83,7 @@
   {                                                                         \
     GUID guid;                                                              \
     QofCollection *col;                                                     \
-    QofEntity *entity;                                                      \
+    QofInstance *entity;                                                      \
     if (!string_to_guid (location + strlen(URL_TYPE_STR), &guid))           \
     {                                                                       \
       result->error_message = g_strdup_printf (_("Bad URL: %s"), location); \
@@ -230,7 +230,7 @@
     
     /* Get the book GUID */
     book = qof_session_get_book(session);
-    guid = qof_entity_get_guid(QOF_ENTITY(book));
+    guid = qof_instance_get_guid(QOF_INSTANCE(book));
     guid_string = guid_to_string(guid);
     
     keyfile = gnc_find_state_file(url, guid_string, &filename);
@@ -317,7 +317,7 @@
 
     /* Get the book GUID */
     book = qof_session_get_book(session);
-    guid = qof_entity_get_guid(QOF_ENTITY(book));
+    guid = qof_instance_get_guid(QOF_INSTANCE(book));
     guid_string = guid_to_string(guid);
 
     /* Find the filename to use.  This returns the data from the

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/account-quickfill.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/account-quickfill.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/account-quickfill.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -31,7 +31,7 @@
 static QofLogModule log_module = GNC_MOD_REGISTER;
 
 static void shared_quickfill_gconf_changed (GConfEntry *entry, gpointer qfb);
-static void listen_for_account_events  (QofEntity *entity,  QofEventId event_type,
+static void listen_for_account_events  (QofInstance *entity,  QofEventId event_type,
 					gpointer user_data, gpointer event_data);
 
 /* Column indices for the list store */
@@ -219,7 +219,7 @@
  * for account modification events, and add new accounts.
  */
 static void
-listen_for_account_events  (QofEntity *entity,  QofEventId event_type,
+listen_for_account_events  (QofInstance *entity,  QofEventId event_type,
 			    gpointer user_data, gpointer event_data)
 {
   QFB *qfb = user_data;

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-account-sel.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-account-sel.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-account-sel.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -94,7 +94,7 @@
 
 static
 void
-gnc_account_sel_event_cb( QofEntity *entity,
+gnc_account_sel_event_cb( QofInstance *entity,
                           QofEventId event_type,
                           gpointer user_data,
 			  gpointer event_data )

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-main-window.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-main-window.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -1112,7 +1112,7 @@
  *  @param user_data  A pointer to the window data structure.
  */
 static void
-gnc_main_window_event_handler (QofEntity *entity,  QofEventId event_type,
+gnc_main_window_event_handler (QofInstance *entity,  QofEventId event_type,
                                gpointer user_data, gpointer event_data)
 {
 	GncMainWindow *window;

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-account.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-account.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-account.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -84,7 +84,7 @@
     						    GtkTreeIter *child);
 
 /** Component Manager Callback ******************************************/
-static void gnc_tree_model_account_event_handler (QofEntity *entity,
+static void gnc_tree_model_account_event_handler (QofInstance *entity,
 						  QofEventId event_type,
 						  GncTreeModelAccount *model,
 						  GncEventData *ed);
@@ -1220,7 +1220,7 @@
  *  @param user_data A pointer to the account tree model.
  */
 static void
-gnc_tree_model_account_event_handler (QofEntity *entity,
+gnc_tree_model_account_event_handler (QofInstance *entity,
 				      QofEventId event_type,
 				      GncTreeModelAccount *model,
 				      GncEventData *ed)

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-budget.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-budget.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-budget.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -31,7 +31,7 @@
 #include "gnc-ui-util.h"
 
 /* Add the new budget object to the tree model.  */
-static void add_budget_to_model(QofEntity* data, gpointer user_data )
+static void add_budget_to_model(QofInstance* data, gpointer user_data )
 {
     GtkTreeIter iter;
     GncBudget* budget = GNC_BUDGET(data);

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-commodity.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-commodity.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-commodity.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -82,7 +82,7 @@
 static gboolean	gnc_tree_model_commodity_iter_parent (GtkTreeModel *tree_model,
 						      GtkTreeIter *iter,
     						      GtkTreeIter *child);
-static void gnc_tree_model_commodity_event_handler (QofEntity *entity,
+static void gnc_tree_model_commodity_event_handler (QofInstance *entity,
 						    QofEventId event_type,
 						    gpointer user_data,
 						    gpointer event_data);
@@ -1212,7 +1212,7 @@
  *  @param event_data A pointer to additional data about this event.
  */
 static void
-gnc_tree_model_commodity_event_handler (QofEntity *entity,
+gnc_tree_model_commodity_event_handler (QofInstance *entity,
 					QofEventId event_type,
 					gpointer user_data,
 					gpointer event_data)

Modified: gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c
===================================================================
--- gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c	2007-04-01 22:18:30 UTC (rev 15772)
+++ gnucash/gobject-engine-dev-warlord/src/gnome-utils/gnc-tree-model-price.c	2007-04-01 22:18:50 UTC (rev 15773)
@@ -101,7 +101,7 @@
 static gboolean	gnc_tree_model_price_iter_parent (GtkTreeModel *tree_model,
 						  GtkTreeIter *iter,
 						  GtkTreeIter *child);
-static void gnc_tree_model_price_event_handler (QofEntity *entity,
+static void gnc_tree_model_price_event_handler (QofInstance *entity,
 						QofEventId event_type,
 						gpointer user_data,
 						gpointer event_data);
@@ -1443,7 +1443,7 @@
  *  @param event_data A pointer to additional data about this event.
  */
 static void
-gnc_tree_model_price_event_handler (QofEntity *entity,
+gnc_tree_model_price_event_handler (QofInstance *entity,
 				    QofEventId event_type,
 				    gpointer user_data,
 				    gpointer event_data)



More information about the gnucash-changes mailing list