HHH-7841 - Redesign Loader

This commit is contained in:
Steve Ebersole 2013-03-12 10:57:25 -05:00
parent 3d332371bd
commit 8b7091e1c7
4 changed files with 19 additions and 17 deletions

View File

@ -31,6 +31,7 @@ import java.util.List;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.hibernate.cfg.NotYetImplementedException;
import org.hibernate.dialect.pagination.LimitHelper; import org.hibernate.dialect.pagination.LimitHelper;
import org.hibernate.engine.FetchStyle; import org.hibernate.engine.FetchStyle;
import org.hibernate.engine.spi.QueryParameters; import org.hibernate.engine.spi.QueryParameters;
@ -45,7 +46,7 @@ import org.hibernate.loader.plan.spi.LoadPlanVisitor;
import org.hibernate.loader.plan.spi.Return; import org.hibernate.loader.plan.spi.Return;
import org.hibernate.loader.spi.AfterLoadAction; import org.hibernate.loader.spi.AfterLoadAction;
import org.hibernate.loader.spi.NamedParameterContext; import org.hibernate.loader.spi.NamedParameterContext;
import org.hibernate.loader.spi.OnDemandResultSetProcessor; import org.hibernate.loader.spi.ScrollableResultSetProcessor;
import org.hibernate.loader.spi.ResultSetProcessor; import org.hibernate.loader.spi.ResultSetProcessor;
import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.pretty.MessageHelper; import org.hibernate.pretty.MessageHelper;
@ -70,8 +71,9 @@ public class ResultSetProcessorImpl implements ResultSetProcessor {
} }
@Override @Override
public OnDemandResultSetProcessor toOnDemandForm() { public ScrollableResultSetProcessor toOnDemandForm() {
return null; //To change body of implemented methods use File | Settings | File Templates. // todo : implement
throw new NotYetImplementedException();
} }
@Override @Override

View File

@ -27,12 +27,12 @@ import java.sql.ResultSet;
import org.hibernate.engine.spi.QueryParameters; import org.hibernate.engine.spi.QueryParameters;
import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.loader.spi.OnDemandResultSetProcessor; import org.hibernate.loader.spi.ScrollableResultSetProcessor;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public class OnDemandResultSetProcessorImpl implements OnDemandResultSetProcessor { public class ScrollableResultSetProcessorImpl implements ScrollableResultSetProcessor {
@Override @Override
public Object extractSingleRow( public Object extractSingleRow(
ResultSet resultSet, ResultSet resultSet,
@ -42,13 +42,13 @@ public class OnDemandResultSetProcessorImpl implements OnDemandResultSetProcesso
} }
@Override @Override
public Object extractSequentialRowsForward( public Object extractLogicalRowForward(
ResultSet resultSet, SessionImplementor session, QueryParameters queryParameters) { ResultSet resultSet, SessionImplementor session, QueryParameters queryParameters) {
return null; //To change body of implemented methods use File | Settings | File Templates. return null; //To change body of implemented methods use File | Settings | File Templates.
} }
@Override @Override
public Object extractSequentialRowsReverse( public Object extractLogicalRowReverse(
ResultSet resultSet, ResultSet resultSet,
SessionImplementor session, SessionImplementor session,
QueryParameters queryParameters, QueryParameters queryParameters,

View File

@ -41,7 +41,7 @@ import org.hibernate.transform.ResultTransformer;
*/ */
public interface ResultSetProcessor { public interface ResultSetProcessor {
public OnDemandResultSetProcessor toOnDemandForm(); public ScrollableResultSetProcessor toOnDemandForm();
/** /**
* Process an entire ResultSet, performing all extractions. * Process an entire ResultSet, performing all extractions.

View File

@ -37,12 +37,12 @@ import org.hibernate.engine.spi.SessionImplementor;
* *
* @author Steve Ebersole * @author Steve Ebersole
*/ */
public interface OnDemandResultSetProcessor { public interface ScrollableResultSetProcessor {
/** /**
* Give a ResultSet, extract just a single result row. * Give a ResultSet, extract just a single result row.
* *
* Copy of {@link org.hibernate.loader.Loader#loadSingleRow(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean)} * Copy of {@link org.hibernate.loader.Loader#loadSingleRow(ResultSet, SessionImplementor, QueryParameters, boolean)}
* but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in
* false...) * false...)
* *
@ -60,11 +60,11 @@ public interface OnDemandResultSetProcessor {
QueryParameters queryParameters); QueryParameters queryParameters);
/** /**
* Given a ResultSet extract "sequential rows". This is used in cases where we have multi-row fetches that * Given a scrollable ResultSet, extract a logical row. The assumption here is that the ResultSet is already
* are sequential within the ResultSet due to ordering. Multiple ResultSet rows are read into a single query * properly ordered to account for any to-many fetches. Multiple ResultSet rows are read into a single query
* result "row". * result "row".
* *
* Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsForward(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean)} * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsForward(ResultSet, SessionImplementor, QueryParameters, boolean)}
* but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in
* false...) * false...)
* *
@ -76,15 +76,15 @@ public interface OnDemandResultSetProcessor {
* *
* @throws org.hibernate.HibernateException Indicates a problem extracting values from the result set. * @throws org.hibernate.HibernateException Indicates a problem extracting values from the result set.
*/ */
public Object extractSequentialRowsForward( public Object extractLogicalRowForward(
final ResultSet resultSet, final ResultSet resultSet,
final SessionImplementor session, final SessionImplementor session,
final QueryParameters queryParameters); final QueryParameters queryParameters);
/** /**
* Like {@link #extractSequentialRowsForward} but here moving back through the ResultSet. * Like {@link #extractLogicalRowForward} but here moving through the ResultSet in reverse.
* *
* Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsReverse(java.sql.ResultSet, org.hibernate.engine.spi.SessionImplementor, org.hibernate.engine.spi.QueryParameters, boolean, boolean)} * Copy of {@link org.hibernate.loader.Loader#loadSequentialRowsReverse(ResultSet, SessionImplementor, QueryParameters, boolean, boolean)}
* but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in * but dropping the 'returnProxies' (that method has only one use in the entire codebase and it always passes in
* false...). * false...).
* *
@ -99,7 +99,7 @@ public interface OnDemandResultSetProcessor {
* *
* @throws org.hibernate.HibernateException Indicates a problem extracting values from the result set. * @throws org.hibernate.HibernateException Indicates a problem extracting values from the result set.
*/ */
public Object extractSequentialRowsReverse( public Object extractLogicalRowReverse(
ResultSet resultSet, ResultSet resultSet,
SessionImplementor session, SessionImplementor session,
QueryParameters queryParameters, QueryParameters queryParameters,