Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Translated SQL is null(getTranslatedSQL from DescriptorEvent returns null)
Translated SQL is null [message #1713109] Sat, 31 October 2015 08:44
Cobus Stroebel is currently offline Cobus StroebelFriend
Messages: 1
Registered: October 2015
Junior Member
I have a class that extends DescriptorEventAdapter and implements SessionCustomizer and DescriptorCustomizer.

I have override the postWrite and postDelete methods to obtain the SQL statements and store them into a separate database. On some of the objects that gets stored, the SQL returned is null, but the object was inserted.

How can I ensure that the SQL string is always returned?

public class SQLLogger extends DescriptorEventAdapter implements SessionCustomizer, DescriptorCustomizer {

    public void customize(ClassDescriptor descriptor) throws Exception {

    public void customize(Session session) throws Exception {
        for (ClassDescriptor descriptor : session.getDescriptors().values()) {

    public void postWrite(DescriptorEvent event) {

    public void postDelete(DescriptorEvent event) {

    protected void processDescriptorEvent(DescriptorEvent descriptorEvent) {
        String sql = descriptorEvent.getQuery().getTranslatedSQLString(descriptorEvent.getSession(), descriptorEvent.getQuery().getTranslationRow());
    //store sql into auditing database
Previous Topic:count queries with specification
Next Topic:"Transaction cannot proceed STATUS_COMMITTED" while leaving EJB container
Goto Forum:

Current Time: Sun Mar 03 07:17:46 GMT 2024

Powered by FUDForum. Page generated in 0.02151 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top