Esempio n. 1
0
/* ================================================================= */
void
gnc_sql_init_transaction_handler (void)
{
    static GncSqlObjectBackend be_data_tx =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_TRANS,
        commit_transaction,          /* commit */
#if LOAD_TRANSACTIONS_AS_NEEDED
        NULL,                        /* initial load */
#else
        gnc_sql_transaction_load_all_tx,
#endif
        create_transaction_tables,   /* create tables */
        NULL,                        /* compile_query */
        NULL,                        /* run_query */
        NULL,                        /* free_query */
        NULL                         /* write */
    };
    static GncSqlObjectBackend be_data_split =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_SPLIT,
        commit_split,                /* commit */
        NULL,                        /* initial_load */
        NULL,                        /* create tables */
#if LOAD_TRANSACTIONS_AS_NEEDED
        compile_split_query,
        run_split_query,
        free_split_query,
#else
        NULL,                        /* compile_query */
        NULL,                        /* run_query */
        NULL,                        /* free_query */
#endif
        NULL                         /* write */
    };

    (void)qof_object_register_backend (GNC_ID_TRANS, GNC_SQL_BACKEND, &be_data_tx);
    (void)qof_object_register_backend (GNC_ID_SPLIT, GNC_SQL_BACKEND,
                                       &be_data_split);

    gnc_sql_register_col_type_handler (CT_TXREF, &tx_guid_handler);
}
Esempio n. 2
0
/* ================================================================= */
void
gnc_employee_sql_initialize (void)
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_EMPLOYEE,
        save_employee,                      /* commit */
        load_all_employees,                 /* initial_load */
        create_employee_tables,             /* create_tables */
        NULL, NULL, NULL,
        write_employees                     /* write */
    };

    qof_object_register_backend (GNC_ID_EMPLOYEE, GNC_SQL_BACKEND, &be_data);
}
Esempio n. 3
0
/* ================================================================= */
void
gnc_sql_init_price_handler (void)
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_PRICE,
        save_price,                 /* commit */
        load_all_prices,            /* initial_load */
        create_prices_tables,       /* create tables */
        NULL, NULL, NULL,
        write_prices                /* write */
    };

    (void)qof_object_register_backend (GNC_ID_PRICE, GNC_SQL_BACKEND, &be_data);
}
Esempio n. 4
0
/* ================================================================= */
void
gnc_job_sql_initialize( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_JOB,
        save_job,						/* commit */
        load_all_jobs,					/* initial_load */
        create_job_tables,				/* create_tables */
        NULL, NULL, NULL,
        write_jobs						/* write */
    };

    qof_object_register_backend( GNC_ID_JOB, GNC_SQL_BACKEND, &be_data );
}
Esempio n. 5
0
/* ================================================================= */
void
gnc_customer_sql_initialize( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_CUSTOMER,
        save_customer,						/* commit */
        load_all_customers,					/* initial_load */
        create_customer_tables,				/* create_tables */
        NULL, NULL, NULL,
        write_customers						/* write */
    };

    qof_object_register_backend( GNC_ID_CUSTOMER, GNC_SQL_BACKEND, &be_data );
}
Esempio n. 6
0
/* ================================================================= */
void
gnc_billterm_sql_initialize (void)
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_BILLTERM,
        gnc_sql_save_billterm,              /* commit */
        load_all_billterms,                 /* initial_load */
        create_billterm_tables,             /* create_tables */
        NULL, NULL, NULL,
        write_billterms                     /* write */
    };

    qof_object_register_backend (GNC_ID_BILLTERM, GNC_SQL_BACKEND, &be_data);

    gnc_sql_register_col_type_handler (CT_BILLTERMREF, &billterm_guid_handler);
}
Esempio n. 7
0
/* ================================================================= */
void
gnc_sql_init_slots_handler( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_ACCOUNT,
        NULL,                    /* commit - cannot occur */
        NULL,                    /* initial_load - cannot occur */
        create_slots_tables,     /* create_tables */
        NULL,                    /* compile_query */
        NULL,                    /* run_query */
        NULL,                    /* free_query */
        NULL                     /* write */
    };

    (void)qof_object_register_backend( TABLE_NAME, GNC_SQL_BACKEND, &be_data );
}
Esempio n. 8
0
/* ================================================================= */
void
gnc_invoice_sql_initialize( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_INVOICE,
        save_invoice,						/* commit */
        load_all_invoices,					/* initial_load */
        create_invoice_tables,				/* create_tables */
        NULL, NULL, NULL,
        write_invoices						/* write */
    };

    qof_object_register_backend( GNC_ID_INVOICE, GNC_SQL_BACKEND, &be_data );

    gnc_sql_register_col_type_handler( CT_INVOICEREF, &invoice_guid_handler );
}
Esempio n. 9
0
/* ================================================================= */
void
gnc_sql_init_book_handler( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_BOOK,
        gnc_sql_save_book,      /* commit */
        load_all_books,         /* initial_load */
        create_book_tables,		/* create_tables */
        NULL,                   /* compile_query */
        NULL,                   /* run_query */
        NULL,                   /* free_query */
        NULL                    /* write */
    };

    (void)qof_object_register_backend( GNC_ID_BOOK, GNC_SQL_BACKEND, &be_data );
}
Esempio n. 10
0
/* ================================================================= */
void
gnc_sql_init_lot_handler( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_LOT,
        commit_lot,            /* commit */
        load_all_lots,         /* initial_load */
        create_lots_tables,    /* create tables */
        NULL, NULL, NULL,
        write_lots             /* save all */
    };

    (void)qof_object_register_backend( GNC_ID_LOT, GNC_SQL_BACKEND, &be_data );

    gnc_sql_register_col_type_handler( CT_LOTREF, &lot_guid_handler );
}
Esempio n. 11
0
/* ================================================================= */
void
gnc_order_sql_initialize (void)
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_ORDER,
        save_order,                     /* commit */
        load_all_orders,                /* initial_load */
        create_order_tables,            /* create_tables */
        NULL, NULL, NULL,
        write_orders                    /* write */
    };

    qof_object_register_backend (GNC_ID_ORDER, GNC_SQL_BACKEND, &be_data);

    gnc_sql_register_col_type_handler (CT_ORDERREF, &order_guid_handler);
}
Esempio n. 12
0
void
gnc_order_xml_initialize (void)
{
    static GncXmlDataType_t be_data =
    {
        GNC_FILE_BACKEND_VERS,
        gnc_order_string,
        order_sixtp_parser_create,
        NULL,			/* add_item */
        order_get_count,
        order_write,
        NULL,			/* scrub */
        order_ns,
    };

    qof_object_register_backend (_GNC_MOD_NAME,
                                 GNC_FILE_BACKEND,
                                 &be_data);
}
Esempio n. 13
0
void
gnc_address_xml_initialize (void)
{
    static GncXmlDataType_t be_data =
    {
        GNC_FILE_BACKEND_VERS,
        "gnc:Address",
        NULL,			/* parser_create */
        NULL,			/* add_item */
        NULL,			/* get_count */
        NULL,			/* write */
        NULL,			/* scrub */
        address_ns,
    };

    qof_object_register_backend ("gnc:Address",
                                 GNC_FILE_BACKEND,
                                 &be_data);
}
Esempio n. 14
0
/* ================================================================= */
void
gnc_sql_init_account_handler (void)
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_ACCOUNT,
        gnc_sql_save_account,       /* commit */
        load_all_accounts,          /* initial_load */
        create_account_tables,      /* create_tables */
        NULL,                       /* compile_query */
        NULL,                       /* run_query */
        NULL,                       /* free_query */
        NULL                        /* write */
    };

    (void)qof_object_register_backend (GNC_ID_ACCOUNT, GNC_SQL_BACKEND, &be_data);

    gnc_sql_register_col_type_handler (CT_ACCOUNTREF, &account_guid_handler);
}
/* ================================================================= */
void
gnc_sql_init_commodity_handler( void )
{
    static GncSqlObjectBackend be_data =
    {
        GNC_SQL_BACKEND_VERSION,
        GNC_ID_COMMODITY,
        commit_commodity,            /* commit */
        load_all_commodities,        /* initial_load */
        create_commodities_tables,   /* create_tables */
        NULL,                        /* compile_query */
        NULL,                        /* run_query */
        NULL,                        /* free_query */
        NULL                         /* write */
    };

    (void)qof_object_register_backend( GNC_ID_COMMODITY, GNC_SQL_BACKEND, &be_data );

    gnc_sql_register_col_type_handler( CT_COMMODITYREF, &commodity_guid_handler );
}