oddgen / bitemp

Code generator to switch between non-temporal, uni-temporal and bi-temporal models while preserving data.
Apache License 2.0
4 stars 1 forks source link

Invalid code generated with CRUD compatibility for original table = yes #12

Open PhilippSalvisberg opened 6 years ago

PhilippSalvisberg commented 6 years ago

Configuration

-- 
-- Bitemp Remodeler configuration
-- - Input table : DEPT
-- - Origin model: non-temporal
-- - Target model: uni-temporal transaction-time
-- - Parameters
--     - Generate table API?                   : Yes
--     - CRUD compatibility for original table?: Yes
--     - Flashback data archive name           : FBA
--     - Flashback archive context level       : Keep current level
--     - Suffix for table with latest content  : _lt
--     - Suffix for full history view          : _fhv
--     - Suffix for object type                : _ot
--     - Suffix for collection type            : _ct
--     - Suffix for instead-of-trigger         : _trg
--     - Suffix for API PL/SQL package         : _api
--     - Suffix for hook PL/SQL package        : _hook
--

Wrong generated code

Table DEPT instead of DEPT_LT is used.

here (table_name = 'DEPT')

--
-- Enforce visibility of source flashback archive tables (for SCN 0 instead of SCN MINVALUE)
--
BEGIN
   dbms_flashback_archive.disassociate_fba(
      owner_name => 'OGDEMO',
      table_name => 'DEPT'
   );
   dbms_flashback_archive.reassociate_fba(
       owner_name => 'OGDEMO',
       table_name => 'DEPT'
   );
END;
/

and here (FROM dept)

--
-- Create full history view
--
CREATE OR REPLACE FORCE VIEW dept_fhv (
...
  FROM dept VERSIONS BETWEEN SCN 0 AND MAXVALUE
...