Example usage for org.apache.commons.dbcp DelegatingConnection innermostDelegateEquals

List of usage examples for org.apache.commons.dbcp DelegatingConnection innermostDelegateEquals

Introduction

In this page you can find the example usage for org.apache.commons.dbcp DelegatingConnection innermostDelegateEquals.

Prototype

public boolean innermostDelegateEquals(Connection c) 

Source Link

Document

Compares innermost delegate to the given connection.

Usage

From source file:org.nuxeo.runtime.datasource.PatchedPoolableManagedConnection.java

@Override
public boolean equals(Object obj) {
    if (obj == null) {
        return false;
    }//from ww  w  .j  a  v  a 2 s . c  o  m
    if (obj == this) {
        return true;
    }
    Connection delegate = getInnermostDelegateInternal();
    if (delegate == null) {
        return false;
    }
    if (obj instanceof DelegatingConnection) {
        DelegatingConnection c = (DelegatingConnection) obj;
        return c.innermostDelegateEquals(delegate);
    } else {
        // PATCH: check object equality first
        return delegate == obj || delegate.equals(obj);
    }
}