EJB-454 implements the default PPR strategy

EJB-453 use resolver held by PPRH
fix issues with Hibernate's isLoaded

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17201 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2009-07-25 05:24:55 +00:00
parent 49e53e81e1
commit c05509be7c
1 changed files with 10 additions and 2 deletions

View File

@ -170,13 +170,21 @@ public class HibernatePersistence implements javax.persistence.spi.PersistencePr
final boolean isInitialized = interceptor == null || interceptor.isInitialized( property );
LoadState state;
if (isInitialized && interceptor != null) {
state = LoadState.LOADED;
//property is loaded according to bytecode enhancement, but is it loaded as far as association?
//it's ours, we can read
state = isLoaded( get( entity, property ) );
//it's ours so we know it's loaded
if (state == LoadState.UNKNOWN) state = LoadState.LOADED;
}
else if ( interceptor != null && (! isInitialized)) {
state = LoadState.NOT_LOADED;
}
else if ( sureFromUs ) { //interceptor == null
state = LoadState.LOADED;
//property is loaded according to bytecode enhancement, but is it loaded as far as association?
//it's ours, we can read
state = isLoaded( get( entity, property ) );
//it's ours so we know it's loaded
if (state == LoadState.UNKNOWN) state = LoadState.LOADED;
}
else {
state = LoadState.UNKNOWN;