1

We are developing the ADF application, where in we came accross the requirement that we have to log all the operations into the database which user has performed like all the DML operations (Insert, update , delete), this can be achieved by overriding the doDML method of entity impl class, but now one more requirement is there where we have to log the event when user has queried the records i.e DQL.

May I Know which entity impl method is getting called when we queries the record? or is there any other way to perform audit logging when user queries the record in ADF?

Thanks

user1784757
  • 41
  • 1
  • 4
  • Hi guys, Thanks for the response. I tried using executeQueryForCollection() method and it works well but the problem is the method is getting invoked multiple times on the event of rollback. Any solution for this? – user1784757 Jun 08 '16 at 08:57

1 Answers1

0

You can use this method to intercept querying:

protected void bindParametersForCollection(QueryCollection qc,
                                           java.lang.Object[] params,
                                           java.sql.PreparedStatement stmt)
                                    throws java.sql.SQLException

Please check slide 10, but use this method instead of executeQueryForCollection() if you run JDev 12c

Florin Marcus
  • 1,657
  • 1
  • 12
  • 11
  • Hi Florin , shouldn't it be executeQueryForCollection method ? If not , may you please let us know some reference for using bindParametersForCollection . Thanks ! – Sid Dec 17 '15 at 08:43
  • May I know how to use it? Also how it will log the query event in database? – user1784757 Dec 17 '15 at 09:10
  • 2
    @Sid executeQueryForCollection lifecycle was changed in 12c, the method is being called sometimes without firing database query. – Florin Marcus Dec 17 '15 at 10:48