HHH-7992 - Add a base Session delegator implementation

This commit is contained in:
Steve Ebersole 2013-02-12 16:17:21 -06:00
parent ec11902a92
commit 5a5d19273d
1 changed files with 37 additions and 19 deletions

View File

@ -1,22 +1,25 @@
/*
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* JBoss, Home of Professional Open Source
* Copyright 2012 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
* Copyright (c) 2013, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.hibernate.engine.spi;
@ -59,16 +62,16 @@ import org.hibernate.jdbc.ReturningWork;
import org.hibernate.jdbc.Work;
import org.hibernate.loader.custom.CustomQuery;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.procedure.ProcedureCall;
import org.hibernate.stat.SessionStatistics;
import org.hibernate.type.Type;
/**
* This class is meant to be extended.
*
* Wraps and delegates all methods to a {@link SessionImplementor} and
* a {@link Session}. This is useful for custom implementations of this
* API so that only some methods need to be overriden
* API so that only some methods need to be overridden
* (Used by Hibernate Search).
*
* @author Sanne Grinovero <sanne@hibernate.org> (C) 2012 Red Hat Inc.
@ -394,6 +397,21 @@ public class SessionDelegatorBaseImpl implements SessionImplementor, Session {
return session.createSQLQuery( queryString );
}
@Override
public ProcedureCall createStoredProcedureCall(String procedureName) {
return session.createStoredProcedureCall( procedureName );
}
@Override
public ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses) {
return session.createStoredProcedureCall( procedureName, resultClasses );
}
@Override
public ProcedureCall createStoredProcedureCall(String procedureName, String... resultSetMappings) {
return session.createStoredProcedureCall( procedureName, resultSetMappings );
}
public Criteria createCriteria(Class persistentClass) {
return session.createCriteria( persistentClass );
}