On 04/05/2012 12:14 PM, Tomas Lestach wrote:
yes, this shall work.
However, I'd much better see something like:
<query name="system_list_with_errata_keyword" params="org_id, user_id,
keyword">
...
(SELECT EK.errata_id FROM rhnErrataKeyword EK WHERE EK.keyword = :keyword)
...
to have it more generic and prepared for possible reuse with other keywords

Thanks, I will try to refactor it.


Hmm, this isn't suitable for one system (if I understood it correctly),
because you make a query, where you get all the systems having the specific
errata keyword and then you just elaborate a "1" for one single system
(without setting it anywhere)? This doesn't seem to be correct at all. (Or I
just didn't understand it.)


I took the "pattern" from another method, that did the same query and the Java method in the "Manager" class returns !result.isEmpty()

If I implement this at the Java level, by fetching the keywords, I would
not be able to reuse the queries "Give me the systems who had this kind
of errata applied", but still because limitations in the framework, I
don't seem to be able to refactor requiring_reboot_list into a list of
erratas plus a elaborator that fetches the systems with those erratas,
because they would be in different files.

What is still unclear to me, where you'd like to store the information the
system has been rebooted, so you stop marking the system as needing reboot.

The query compares against rhnSystem.last_boot (against the time of the errata action completed) :-)

thanks a lot for your help.

--
Duncan Mac-Vicar P. - http://www.suse.com/

SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Maxfeldstraße 5, 90409 Nürnberg, Germany

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to