Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import jakarta.persistence.metamodel.BasicType;

import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;

/**
* Hibernate extension to the JPA {@link BasicType} contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

import org.hibernate.MappingException;
import org.hibernate.query.SynchronizeableQuery;
import org.hibernate.procedure.spi.NamedCallableQueryMemento;
import org.hibernate.query.CommonQueryContract;
import org.hibernate.query.procedure.ProcedureParameter;
import org.hibernate.query.named.NameableQuery;
import org.hibernate.type.BasicTypeReference;

/**
Expand All @@ -32,10 +30,7 @@
* <p>
* Unless explicitly specified, the ProcedureCall is assumed to follow the
* procedure call syntax. To explicitly specify that this should be a function
* call, use {@link #markAsFunctionCall}. JPA users could either:<ul>
* <li>use {@code storedProcedureQuery.unwrap( ProcedureCall.class }.markAsFunctionCall()</li>
* <li>set the {@link #FUNCTION_RETURN_TYPE_HINT} hint (avoids casting to Hibernate-specific classes)</li>
* </ul>
* call, use {@link #markAsFunctionCall}.
* <p>
* When using function-call syntax:<ul>
* <li>parameters must be registered by position (not name)</li>
Expand All @@ -56,12 +51,7 @@
* @author Steve Ebersole
*/
public interface ProcedureCall
extends CommonQueryContract, SynchronizeableQuery, StoredProcedureQuery, NameableQuery, AutoCloseable {
/**
* The hint key (for use with JPA's "hint system") indicating the function's return JDBC type code
* (aka, {@link java.sql.Types} code)
*/
String FUNCTION_RETURN_TYPE_HINT = "hibernate.procedure.function_return_jdbc_type_code";
extends CommonQueryContract, SynchronizeableQuery, StoredProcedureQuery, AutoCloseable {

/**
* Get the name of the stored procedure (or function) to be called.
Expand Down Expand Up @@ -246,9 +236,6 @@ default void close() {
@Override
ProcedureCall addSynchronizedEntityClass(@SuppressWarnings("rawtypes") Class entityClass) throws MappingException;

@Override
NamedCallableQueryMemento toMemento(String name);

@Override
ProcedureCall setHint(String hintName, Object value);

Expand Down Expand Up @@ -287,4 +274,12 @@ default void close() {

@Override
ProcedureCall registerStoredProcedureParameter(String parameterName, Class<?> type, ParameterMode mode);

/**
* The hint key indicating the function's return {@linkplain java.sql.Types JDBC type code}.
*
* @deprecated This hint no longer has any effect. Use {@link #markAsFunctionCall(int)}.
*/
@Deprecated(since="7", forRemoval = true)
String FUNCTION_RETURN_TYPE_HINT = "hibernate.procedure.function_return_jdbc_type_code";
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.hibernate.procedure.spi.NamedCallableQueryMemento;
import org.hibernate.procedure.spi.ProcedureCallImplementor;
import org.hibernate.query.BindableType;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.sql.exec.internal.JdbcCallFunctionReturnImpl.RefCurserJdbcCallFunctionReturnImpl;
import org.hibernate.sql.exec.internal.JdbcCallFunctionReturnImpl.RegularJdbcCallFunctionReturnImpl;
import org.hibernate.sql.exec.internal.JdbcCallParameterExtractorImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.hibernate.procedure.spi.FunctionReturnImplementor;
import org.hibernate.procedure.spi.ProcedureCallImplementor;
import org.hibernate.procedure.spi.ProcedureParameterImplementor;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.query.spi.ProcedureParameterMetadataImplementor;
import org.hibernate.sql.exec.internal.JdbcCallImpl;
import org.hibernate.sql.exec.spi.JdbcCallParameterRegistration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.hibernate.query.BindableType;
import org.hibernate.query.KeyedPage;
import org.hibernate.query.KeyedResultList;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.query.Query;
import org.hibernate.query.QueryParameter;
import org.hibernate.query.internal.QueryOptionsImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.hibernate.procedure.spi.ProcedureCallImplementor;
import org.hibernate.procedure.spi.ProcedureParameterImplementor;
import org.hibernate.query.BindableType;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.query.internal.BindingTypeHelper;
import org.hibernate.query.spi.AbstractQueryParameter;
import org.hibernate.query.spi.QueryParameterBinding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.List;

import org.hibernate.procedure.ProcedureCall;
import org.hibernate.query.named.NameableQuery;
import org.hibernate.query.spi.ProcedureParameterMetadataImplementor;
import org.hibernate.query.spi.QueryImplementor;
import org.hibernate.type.BasicTypeReference;
Expand All @@ -23,7 +24,7 @@
/**
* @author Steve Ebersole
*/
public interface ProcedureCallImplementor<R> extends ProcedureCall, QueryImplementor<R> {
public interface ProcedureCallImplementor<R> extends ProcedureCall, NameableQuery, QueryImplementor<R> {
@Override
default List<R> getResultList() {
return list();
Expand Down Expand Up @@ -93,4 +94,6 @@ default List<R> getResultList() {
@Override
ProcedureCallImplementor<R> registerStoredProcedureParameter(String parameterName, Class<?> type, ParameterMode mode);

@Override
NamedCallableQueryMemento toMemento(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import jakarta.persistence.CacheRetrieveMode;
import jakarta.persistence.CacheStoreMode;
import jakarta.persistence.EntityGraph;

import org.hibernate.CacheMode;
import org.hibernate.FlushMode;
import org.hibernate.Incubating;
Expand All @@ -27,13 +28,11 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.UnknownProfileException;
import org.hibernate.dialect.Dialect;

import jakarta.persistence.FlushModeType;
import jakarta.persistence.LockModeType;
import jakarta.persistence.Parameter;
import jakarta.persistence.TemporalType;
import org.hibernate.engine.profile.DefaultFetchProfile;
import org.hibernate.graph.GraphSemantic;

/**
Expand Down Expand Up @@ -95,9 +94,10 @@
* </ul>
* <p>
* The special built-in fetch profile named
* {@value DefaultFetchProfile#HIBERNATE_DEFAULT_PROFILE} adds a fetch join for
* every {@link jakarta.persistence.FetchType#EAGER eager} {@code @ManyToOne} or
* {@code @OneToOne} association belonging to an entity returned by the query.
* {@value org.hibernate.engine.profile.DefaultFetchProfile#HIBERNATE_DEFAULT_PROFILE}
* adds a fetch join for every {@link jakarta.persistence.FetchType#EAGER eager}
* {@code @ManyToOne} or {@code @OneToOne} association belonging to an entity
* returned by the query.
* <p>
* Finally, three alternative approaches to pagination are available:
* <ol>
Expand Down Expand Up @@ -146,8 +146,8 @@ default List<R> getResultList() {

/**
* Returns scrollable access to the query results, using the
* {@linkplain Dialect#defaultScrollMode() default scroll mode
* of the SQL dialect.}
* {@linkplain org.hibernate.dialect.Dialect#defaultScrollMode
* default scroll mode of the SQL dialect.}
*
* @see #scroll(ScrollMode)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
package org.hibernate.sql.exec.internal;

import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.sql.exec.spi.JdbcCallFunctionReturn;

import jakarta.persistence.ParameterMode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.sql.SQLException;

import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.sql.exec.spi.JdbcCallParameterExtractor;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import org.hibernate.engine.jdbc.cursor.spi.RefCursorSupport;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.sql.exec.spi.JdbcCallParameterExtractor;
import org.hibernate.sql.exec.spi.JdbcCallParameterRegistration;
import org.hibernate.sql.exec.spi.JdbcParameterBinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import jakarta.persistence.ParameterMode;

import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.OutputableType;
import org.hibernate.type.OutputableType;
import org.hibernate.sql.exec.internal.JdbcCallRefCursorExtractorImpl;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.query;
package org.hibernate.type;

import java.sql.CallableStatement;
import java.sql.SQLException;

import org.hibernate.Incubating;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.query.BindableType;
import org.hibernate.type.descriptor.jdbc.JdbcType;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
*/
package org.hibernate.type;

import org.hibernate.query.OutputableType;

/**
* Optional {@link Type} contract for implementations that are aware of how to extract values from
* store procedure OUT/INOUT parameters.
* Optional {@link Type} contract for implementations that are aware of
* how to extract values from stored procedure OUT/INOUT parameters.
*
* @author Steve Ebersole
*/
Expand Down
Loading