-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-15522 Implement a LazyInitializable interface that PersistentColl…
…ection and Envers collections extend or implement. Improve related tests.
- Loading branch information
Showing
9 changed files
with
109 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
hibernate-core/src/main/java/org/hibernate/collection/spi/LazyInitializable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Hibernate, Relational Persistence for Idiomatic Java | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later. | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.collection.spi; | ||
|
||
import org.hibernate.Incubating; | ||
|
||
/** | ||
* Hibernate "wraps" a java collection in an instance of PersistentCollection. Envers uses custom collection | ||
* wrappers (ListProxy, SetProxy, etc). All of them need to extend LazyInitializable, so the | ||
* Hibernate.isInitialized method can check if the collection is initialized or not. | ||
* | ||
* @author Fabricio Gregorio | ||
*/ | ||
@Incubating | ||
public interface LazyInitializable { | ||
|
||
/** | ||
* Is this instance initialized? | ||
* | ||
* @return Was this collection initialized? Or is its data still not (fully) loaded? | ||
*/ | ||
boolean wasInitialized(); | ||
|
||
/** | ||
* To be called internally by the session, forcing immediate initialization. | ||
*/ | ||
void forceInitialization(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters