-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HHH-15060 - Associations with @NotFound should always be left joined …
…when de-referenced in HQL/Criteria - `@NotFound` no longer exports a physical foreign-key - tests showing bugs and inconsistencies wrt `@NotFound` handling - added `FetchNotFoundException` - force association to EAGER
- Loading branch information
Showing
25 changed files
with
700 additions
and
399 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
hibernate-core/src/main/java/org/hibernate/FetchNotFoundException.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,43 @@ | ||
/* | ||
* 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; | ||
|
||
import java.util.Locale; | ||
import javax.persistence.EntityNotFoundException; | ||
|
||
/** | ||
* Exception for {@link org.hibernate.annotations.NotFoundAction#EXCEPTION} | ||
* | ||
* @see org.hibernate.annotations.NotFound | ||
* | ||
* @author Steve Ebersole | ||
*/ | ||
public class FetchNotFoundException extends EntityNotFoundException { | ||
private final String entityName; | ||
private final Object identifier; | ||
|
||
public FetchNotFoundException(String entityName, Object identifier) { | ||
super( | ||
String.format( | ||
Locale.ROOT, | ||
"Entity `%s` with identifier value `%s` does not exist", | ||
entityName, | ||
identifier | ||
) | ||
); | ||
this.entityName = entityName; | ||
this.identifier = identifier; | ||
} | ||
|
||
public String getEntityName() { | ||
return entityName; | ||
} | ||
|
||
public Object getIdentifier() { | ||
return identifier; | ||
} | ||
} |
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
Oops, something went wrong.