AnsweredAssumed Answered

Executing database queries

Question asked by marcelogodois on Dec 9, 2010
Hi all,

I've been using Auditing in the Alfresco 3.2 and it works very well.  But in the old fashion way (I know it will be deprecated in the 3.4):


I'd like to know how to execute the queries exemples showed up in the
So, to show the results in a custom dialog. Which service should I use? Should I change the hibernate mappings? Can someone give me a piece of code?


select fact.timestamp, convert(prop.string_value using utf8)
from alf_audit_fact fact
   join alf_audit_source source
      on fact.audit_source_id =
         and (
                  (source.service = 'ContentService' and source.method = 'getReader')
               or (source.service = 'FileFolderService' and source.method = 'getReader')
   join alf_node_status ns on ns.guid = fact.node_uuid
   join alf_node_properties prop
      on ns.node_id = prop.node_id
         and prop.qname = '{}name'
         fact.user_id = 'admin'
     and fact.timestamp > ADDDATE(now(), -7)