while(collectionItr.hasNext()) {
Object obj = collectionItr.next();
if(alreadyVisitedEntities == null) {
+ //AM: does this really ever happen?
result[count] = load(obj, false, update);
} else {
result[count] = loadRecursive(obj, alreadyVisitedEntities, update);
//TODO improve generics for deproxyOrNull, probably need to split the method
@SuppressWarnings("unchecked")
T deproxiedEntity = (T)ProxyUtils.deproxyOrNull(cdmEntity);
- if(deproxiedEntity != null){
+ if(deproxiedEntity == null){
+ if (logger.isDebugEnabled()){logger.debug("ignoring uninitlialized proxy " + cdmEntity.getClass() + "#" + cdmEntity.getId());}
+ }else{
String className = deproxiedEntity.getClass().getName();
CdmModelFieldPropertyFromClass cmfpfc = getFromCdmlibModelCache(className);
if(cmfpfc != null) {
throw new CdmClientCacheException("CdmEntity with class " + cdmEntity.getClass().getName() + " is not found in the cdmlib model cache. " +
"The cache may be corrupted or not in sync with the latest model version" );
}
- } else { //deproxiedEntity == null
- logger.debug("ignoring uninitlialized proxy " + cdmEntity.getClass() + "#" + cdmEntity.getId());
}
return cachedCdmEntity;
if(CdmBase.class.isAssignableFrom(obj.getClass())) {
logger.debug("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
- cdmEntityInSubGraph = (CdmBase)obj;
+ cdmEntityInSubGraph = (CdmBase)obj;
CdmBase cachedCdmEntityInSubGraph = cdmCacher.getFromCache(cdmEntityInSubGraph);
if(cachedCdmEntityInSubGraph != null) {
}
@Override
- public boolean exists(CdmBase cdmBase) {
- return exists(generateKey(cdmBase));
+ public boolean exists(CdmBase cdmEntity) {
+ return exists(generateKey(cdmEntity));
}
}
*
* @author cmathew
*/
-
public abstract class CdmCacher implements ICdmUuidCacher {
public static final Logger logger = Logger.getLogger(CdmCacher.class);
import eu.etaxonomy.cdm.persistence.query.MatchMode;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
\r
-\r
-/**\r
- * @author a.mueller\r
- *\r
- */\r
/**\r
* @author a.kohlbecker\r
* @since 23.03.2009\r
*/\r
public DeleteResult delete(UUID persistentObjectUUID) ;\r
\r
-\r
-\r
/**\r
* Returns true if an entity of type <T> with a unique identifier matching the\r
* identifier supplied exists in the database, or false if no such entity can be\r
*/\r
public T find(UUID uuid);\r
\r
-\r
-\r
/**\r
* Return a persisted entity that matches the unique identifier\r
* supplied as an argument, or null if the entity does not exist.\r
*
* @author a.kohlbecker
* @since May 23, 2017
- *
*/
public interface UserHelper {
boolean userIs(RoleProbe roleProbe);
/**
- *
* @param username
* @param cdmEntity
* @param crud
public CdmAuthority createAuthorityFor(String username, CdmBase cdmEntity, EnumSet<CRUD> crud, String property);
/**
- *
* @param username
* @param cdmType
* @param entitiyId
*/
public CdmAuthority createAuthorityFor(String username, Class<? extends CdmBase> cdmType, Integer entitiyId, EnumSet<CRUD> crud, String property);
-
- /**
- *
+ /**
* @param username
* @param cdmType
* @param entitiyUuid
*/
public CdmAuthority createAuthorityFor(String username, Class<? extends CdmBase> cdmType, UUID entitiyUuid, EnumSet<CRUD> crud, String property);
-
/**
* @param cdmType
* @param entitiyId
/**
* Scans the currently authenticated user for CdmAuthorities which match the given parameters
- *
- * @param cdmEntity
- * @param crud
- * @return
*/
public Collection<CdmAuthority> findUserPermissions(CdmBase cdmEntity, EnumSet<CRUD> crud);
/**
* Scans the currently authenticated user for CdmAuthorities which match the given parameters
- *
- * @param cdmType
- * @param crud
- * @return
*/
public <T extends CdmBase> Collection<CdmAuthority> findUserPermissions(Class<T> cdmType, EnumSet<CRUD> crud);
- /**
- * @param newAuthority
- */
public void removeAuthorityForCurrentUser(CdmAuthority newAuthority);
- /**
- * @param username
- * @param newAuthority
- */
public void removeAuthorityForCurrentUser(String username, CdmAuthority newAuthority);
- /**
- *
- */
public void logout();
void setSecurityContextAccess(SecurityContextAccess securityContextAccess);
- /**
- * @return
- */
public Authentication getAuthentication();
public CdmUserHelper withCache(ICdmEntityUuidCacher iCdmCacher);
-
-
}