@@ -19,7 +19,7 @@ create or replace package body ut_annotation_manager as
1919 ------------------------------
2020 --private definitions
2121
22- function get_annotation_objs_info(a_object_owner varchar2, a_object_type varchar2, a_parse_date date := null) return ut_annotation_objs_cache_info is
22+ function get_annotation_objs_info(a_object_owner varchar2, a_object_type varchar2, a_parse_date timestamp := null) return ut_annotation_objs_cache_info is
2323 l_rows sys_refcursor;
2424 l_ut_owner varchar2(250) := ut_utils.ut_owner;
2525 l_objects_view varchar2(200) := ut_metadata.get_dba_view('dba_objects');
@@ -31,7 +31,7 @@ create or replace package body ut_annotation_manager as
3131 object_owner => o.owner,
3232 object_name => o.object_name,
3333 object_type => o.object_type,
34- needs_refresh => case when o.last_ddl_time < i.parse_time then 'N' else 'Y' end
34+ needs_refresh => case when o.last_ddl_time < cast( i.parse_time as date) then 'N' else 'Y' end
3535 )
3636 from ]'||l_objects_view||q'[ o
3737 left join ]'||l_ut_owner||q'[.ut_annotation_cache_info i
@@ -44,7 +44,7 @@ create or replace package body ut_annotation_manager as
4444 || case
4545 when a_parse_date is null
4646 then ':a_parse_date is null'
47- else 'o.last_ddl_time > :a_parse_date'
47+ else 'o.last_ddl_time > cast( :a_parse_date as date) '
4848 end;
4949 open l_rows for l_cursor_text using a_object_owner, a_object_type, a_parse_date;
5050 fetch l_rows bulk collect into l_result limit 1000000;
@@ -148,37 +148,17 @@ create or replace package body ut_annotation_manager as
148148
149149
150150 procedure rebuild_annotation_cache( a_object_owner varchar2, a_object_type varchar2, a_info_rows ut_annotation_objs_cache_info) is
151- l_objects_in_cache_count integer;
152151 l_objects_to_parse ut_annotation_objs_cache_info := ut_annotation_objs_cache_info();
153152 begin
154- --get list of objects in cache
155- select count(1) into l_objects_in_cache_count
156- from table(a_info_rows) x where x.needs_refresh = 'N';
157-
158- --if cache is empty and there are objects to parse
159- if l_objects_in_cache_count = 0 and a_info_rows.count > 0 then
153+ select value(x)bulk collect into l_objects_to_parse from table(a_info_rows) x where x.needs_refresh = 'Y';
160154
155+ --if some source needs parsing and putting into cache
156+ if l_objects_to_parse.count > 0 then
161157 build_annot_cache_for_sources(
162158 a_object_owner, a_object_type,
163- --all schema objects
164- get_sources_to_annotate(a_object_owner, a_object_type),
165- a_info_rows
159+ get_sources_to_annotate(a_object_owner, a_object_type, l_objects_to_parse),
160+ l_objects_to_parse
166161 );
167-
168- --if not all in cache, get list of objects to rebuild cache for
169- elsif l_objects_in_cache_count < a_info_rows.count then
170-
171- select value(x)bulk collect into l_objects_to_parse from table(a_info_rows) x where x.needs_refresh = 'Y';
172-
173- --if some source needs parsing and putting into cache
174- if l_objects_to_parse.count > 0 then
175- build_annot_cache_for_sources(
176- a_object_owner, a_object_type,
177- get_sources_to_annotate(a_object_owner, a_object_type, l_objects_to_parse),
178- l_objects_to_parse
179- );
180- end if;
181-
182162 end if;
183163 end;
184164
@@ -194,7 +174,7 @@ create or replace package body ut_annotation_manager as
194174 );
195175 end;
196176
197- function get_annotated_objects(a_object_owner varchar2, a_object_type varchar2, a_parse_date date := null) return ut_annotated_objects pipelined is
177+ function get_annotated_objects(a_object_owner varchar2, a_object_type varchar2, a_parse_date timestamp := null) return ut_annotated_objects pipelined is
198178 l_info_rows ut_annotation_objs_cache_info;
199179 l_cursor sys_refcursor;
200180 l_results ut_annotated_objects;
0 commit comments