}
@Override
public Chronicle findChronicle(String fullName, boolean mustExist) throws T2DBException {
DatabaseCache cache = getDatabase().getCache();
Chronicle chronicle = cache.lookUpChronicle(fullName);
if (chronicle == null) {
String[] parts = getDatabase().getNamingPolicy().split(fullName);
if (parts[0] == null) {
chronicle = getDatabase().getTopChronicle();
boolean isNameSpace = chronicle.getName(true).equals(fullName);
if (getDatabase().isStrictNameSpaceMode()) {
// it must be the name space itself
if (!isNameSpace)
throw T2DBMsg.exception(D.D40103, chronicle.getName(true), fullName);
} else {
// tolerate name space
if (!isNameSpace) {
chronicle = chronicle.getChronicle(parts[1], mustExist);
// cache top level entities
if (chronicle != null)
cache.store((ChronicleImpl)chronicle);
}
}
} else {
chronicle = findChronicle(parts[0], true);
// cache entities with children
cache.store((ChronicleImpl)chronicle);
chronicle = chronicle.getChronicle(parts[1], mustExist);
// cache the chronicle if it has a schema ?
}
}
return chronicle;
}