Skip to content

Commit

Permalink
HHH-9923 - Avoid cast to MetadataBuildingOptionsImpl in AnnotationMet…
Browse files Browse the repository at this point in the history
…adataSourceProcessorImpl#prepare()
  • Loading branch information
sebersole committed Jul 24, 2015
1 parent f34c69c commit 5ec711f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 44 deletions.
Expand Up @@ -21,11 +21,11 @@
*
* @author Gunnar Morling
*/
public class ForwardingSessionBuilder implements SessionBuilder {
public abstract class AbstractDelegatingSessionBuilder implements SessionBuilder {

private final SessionBuilder delegate;

public ForwardingSessionBuilder(SessionBuilder delegate) {
public AbstractDelegatingSessionBuilder(SessionBuilder delegate) {
this.delegate = delegate;
}

Expand All @@ -36,57 +36,67 @@ public Session openSession() {

@Override
public SessionBuilder interceptor(Interceptor interceptor) {
return delegate.interceptor(interceptor);
delegate.interceptor( interceptor );
return this;
}

@Override
public SessionBuilder noInterceptor() {
return delegate.noInterceptor();
delegate.noInterceptor();
return this;
}

@Override
public SessionBuilder statementInspector(StatementInspector statementInspector) {
return delegate.statementInspector( statementInspector );
delegate.statementInspector( statementInspector );
return this;
}

@Override
public SessionBuilder connection(Connection connection) {
return delegate.connection(connection);
delegate.connection( connection );
return this;
}

@Override
public SessionBuilder connectionReleaseMode(
ConnectionReleaseMode connectionReleaseMode) {
return delegate.connectionReleaseMode(connectionReleaseMode);
public SessionBuilder connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode) {
delegate.connectionReleaseMode( connectionReleaseMode );
return this;
}

@Override
public SessionBuilder autoJoinTransactions(boolean autoJoinTransactions) {
return delegate.autoJoinTransactions(autoJoinTransactions);
delegate.autoJoinTransactions( autoJoinTransactions );
return this;
}

@Override
public SessionBuilder autoClose(boolean autoClose) {
return delegate.autoClose(autoClose);
delegate.autoClose( autoClose );
return this;
}

@Override
public SessionBuilder flushBeforeCompletion(boolean flushBeforeCompletion) {
return delegate.flushBeforeCompletion(flushBeforeCompletion);
delegate.flushBeforeCompletion( flushBeforeCompletion );
return this;
}

@Override
public SessionBuilder tenantIdentifier(String tenantIdentifier) {
return delegate.tenantIdentifier(tenantIdentifier);
delegate.tenantIdentifier( tenantIdentifier );
return this;
}

@Override
public SessionBuilder eventListeners(SessionEventListener... listeners) {
return delegate.eventListeners(listeners);
delegate.eventListeners( listeners );
return this;
}

@Override
public SessionBuilder clearEventListeners() {
return delegate.clearEventListeners();
delegate.clearEventListeners();
return this;
}
}
Expand Up @@ -14,17 +14,21 @@
*
* @author Gunnar Morling
*/
public class ForwardingSessionBuilderImplementor extends ForwardingSessionBuilder implements SessionBuilderImplementor {
@SuppressWarnings("unused")
public abstract class AbstractDelegatingSessionBuilderImplementor
extends AbstractDelegatingSessionBuilder
implements SessionBuilderImplementor {

private final SessionBuilderImplementor delegate;

public ForwardingSessionBuilderImplementor(SessionBuilderImplementor delegate) {
public AbstractDelegatingSessionBuilderImplementor(SessionBuilderImplementor delegate) {
super( delegate );
this.delegate = delegate;
}

@Override
public SessionBuilder owner(SessionOwner sessionOwner) {
return delegate.owner(sessionOwner);
delegate.owner( sessionOwner );
return this;
}
}
Expand Up @@ -22,11 +22,12 @@
*
* @author Gunnar Morling
*/
public class ForwardingSharedSessionBuilder implements SharedSessionBuilder {
@SuppressWarnings("unused")
public abstract class AbstractDelegatingSharedSessionBuilder implements SharedSessionBuilder {

private final SharedSessionBuilder delegate;

public ForwardingSharedSessionBuilder(SharedSessionBuilder delegate) {
public AbstractDelegatingSharedSessionBuilder(SharedSessionBuilder delegate) {
this.delegate = delegate;
}

Expand All @@ -37,94 +38,109 @@ public Session openSession() {

@Override
public SharedSessionBuilder interceptor() {
return delegate.interceptor();
delegate.interceptor();
return this;
}

@Override
public SharedSessionBuilder connection() {
return delegate.connection();
delegate.connection();
return this;
}

@Override
public SharedSessionBuilder connectionReleaseMode() {
return delegate.connectionReleaseMode();
delegate.connectionReleaseMode();
return this;
}

@Override
public SharedSessionBuilder autoJoinTransactions() {
return delegate.autoJoinTransactions();
delegate.autoJoinTransactions();
return this;
}

@Override
public SharedSessionBuilder autoClose() {
return delegate.autoClose();
delegate.autoClose();
return this;
}

@Override
public SharedSessionBuilder flushBeforeCompletion() {
return delegate.flushBeforeCompletion();
delegate.flushBeforeCompletion();
return this;
}

@Override
public SharedSessionBuilder transactionContext() {
return delegate.transactionContext();
delegate.transactionContext();
return this;
}

@Override
public SharedSessionBuilder interceptor(Interceptor interceptor) {
return delegate.interceptor(interceptor);
delegate.interceptor( interceptor );
return this;
}

@Override
public SharedSessionBuilder noInterceptor() {
return delegate.noInterceptor();
delegate.noInterceptor();
return this;
}

@Override
public SessionBuilder statementInspector(StatementInspector statementInspector) {
return delegate.statementInspector( statementInspector );
delegate.statementInspector( statementInspector );
return this;
}

@Override
public SharedSessionBuilder connection(Connection connection) {
return delegate.connection(connection);
delegate.connection( connection );
return this;
}

@Override
public SharedSessionBuilder connectionReleaseMode(
ConnectionReleaseMode connectionReleaseMode) {
return delegate.connectionReleaseMode(connectionReleaseMode);
public SharedSessionBuilder connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode) {
delegate.connectionReleaseMode( connectionReleaseMode );
return this;
}

@Override
public SharedSessionBuilder autoJoinTransactions(
boolean autoJoinTransactions) {
return delegate.autoJoinTransactions(autoJoinTransactions);
public SharedSessionBuilder autoJoinTransactions(boolean autoJoinTransactions) {
delegate.autoJoinTransactions( autoJoinTransactions );
return this;
}

@Override
public SharedSessionBuilder autoClose(boolean autoClose) {
return delegate.autoClose(autoClose);
delegate.autoClose( autoClose );
return this;
}

@Override
public SharedSessionBuilder flushBeforeCompletion(
boolean flushBeforeCompletion) {
return delegate.flushBeforeCompletion(flushBeforeCompletion);
public SharedSessionBuilder flushBeforeCompletion(boolean flushBeforeCompletion) {
delegate.flushBeforeCompletion( flushBeforeCompletion );
return this;
}

@Override
public SessionBuilder tenantIdentifier(String tenantIdentifier) {
return delegate.tenantIdentifier(tenantIdentifier);
delegate.tenantIdentifier( tenantIdentifier );
return this;
}

@Override
public SessionBuilder eventListeners(SessionEventListener... listeners) {
return delegate.eventListeners(listeners);
delegate.eventListeners( listeners );
return this;
}

@Override
public SessionBuilder clearEventListeners() {
return delegate.clearEventListeners();
delegate.clearEventListeners();
return this;
}
}

0 comments on commit 5ec711f

Please sign in to comment.