diff --git a/hibernate-core/src/main/java/org/hibernate/Session.java b/hibernate-core/src/main/java/org/hibernate/Session.java index 59120ec90a75..355cf7963f5c 100644 --- a/hibernate-core/src/main/java/org/hibernate/Session.java +++ b/hibernate-core/src/main/java/org/hibernate/Session.java @@ -1101,7 +1101,12 @@ public interface Session extends SharedSessionContract, EntityManager { * @return an instance of {@link IdentifierLoadAccess} for executing the lookup * * @throws HibernateException If the given class does not resolve as a mapped entity + * + * @deprecated This method will be removed. + * Use {@link #find(Class, Object, FindOption...)} instead. + * See {@link FindOption}. */ + @Deprecated(since = "7.1", forRemoval = true) IdentifierLoadAccess byId(Class entityClass); /** @@ -1113,7 +1118,12 @@ public interface Session extends SharedSessionContract, EntityManager { * @return an instance of {@link IdentifierLoadAccess} for executing the lookup * * @throws HibernateException If the given name does not resolve to a mapped entity + * + * @deprecated This method will be removed. + * Use {@link #find(Class, Object, FindOption...)} instead. + * See {@link FindOption}. */ + @Deprecated(since = "7.1", forRemoval = true) IdentifierLoadAccess byId(String entityName); /**