|
25 | 25 |
|
26 | 26 | import java.util.Collection; |
27 | 27 | import java.util.List; |
28 | | -import java.util.function.Consumer; |
29 | 28 |
|
30 | 29 | /// The main runtime interface between a Java application and Hibernate. Represents the |
31 | 30 | /// notion of a _persistence context_, a set of managed entity instances associated |
|
150 | 149 | /// instance from the [SessionFactory]. |
151 | 150 | /// |
152 | 151 | /// An easy way to be sure that session and transaction management is being done correctly |
153 | | -/// is to [let the factory do it][SessionFactory#inTransaction(Consumer)]: |
| 152 | +/// is to [let the factory do it][SessionFactory#inTransaction(java.util.function.Consumer)]: |
154 | 153 | /// |
155 | 154 | /// ```java |
156 | 155 | /// sessionFactory.inTransaction(session -> { |
@@ -480,8 +479,12 @@ public interface Session extends SharedSessionContract, EntityManager { |
480 | 479 | /// @implNote Note that Hibernate's implementation of this method can |
481 | 480 | /// also be used for loading an entity by its [natural-id][org.hibernate.annotations.NaturalId] |
482 | 481 | /// by passing [KeyType#NATURAL] as a [FindOption] and the natural-id value as the `key` to load. |
| 482 | + /// |
| 483 | + /// @param entityType the entity type |
| 484 | + /// @param id an identifier |
| 485 | + /// @param options options controlling the behavior of the operation |
483 | 486 | @Override |
484 | | - <T> T find(Class<T> entityClass, Object key, FindOption... options); |
| 487 | + <T> T find(Class<T> entityType, Object id, FindOption... options); |
485 | 488 |
|
486 | 489 | /// Return the persistent instance of the named entity type with the given identifier, |
487 | 490 | /// or null if there is no such persistent instance. |
@@ -752,9 +755,16 @@ public interface Session extends SharedSessionContract, EntityManager { |
752 | 755 | @Override |
753 | 756 | void refresh(Object object); |
754 | 757 |
|
| 758 | + /// {@inheritDoc} |
| 759 | + /// |
| 760 | + /// @param object a persistent instance associated with this session |
| 761 | + /// @param options options controlling the behavior of the operation |
| 762 | + @Override |
| 763 | + void refresh(Object object, RefreshOption... options); |
| 764 | + |
755 | 765 | /// Mark a persistence instance associated with this session for removal from |
756 | | - /// the underlying database. Ths operation cascades to associated instances if |
757 | | - /// the association is mapped [jakarta.persistence.CascadeType#REMOVE]. |
| 766 | + /// the underlying database. This operation cascades to associated instances |
| 767 | + /// if the association is mapped [jakarta.persistence.CascadeType#REMOVE]. |
758 | 768 | /// |
759 | 769 | /// Except when operating in fully JPA-compliant mode, this operation does, |
760 | 770 | /// contrary to the JPA specification, accept a detached entity instance. |
|
0 commit comments