for (final Entry<String, String> forwardLink : model.getLinkedTo(superclassName)) { final CP linkProperty = new CP(superclassName, forwardLink.getValue()); if (model.getPropertyKind(linkProperty.className, linkProperty.propertyName) == PropertyKind.REQUIRED) { notNullable.add(linkProperty.toString()); linkedToDetails.put(linkProperty.toString(), linkedsDetails); final CPI linkSource = linkProperty.toCPI(object.id); for (final CI linked : planning.forwardLinksCached.get(linkSource)) { final CP linkProperty = new CP(backwardLink.getKey(), backwardLink.getValue()); if (model.getPropertyKind(linkProperty.className, linkProperty.propertyName) == PropertyKind.REQUIRED) { notNullable.add(linkProperty.toString()); linkedFromDetails.put(linkProperty.toString(), linkersDetails); final CPI linkTarget = linkProperty.toCPI(object.id); for (final CI linker : planning.backwardLinksCached.get(linkTarget)) {
for (final String superclassName : model.getSuperclassesOfReflexive(object.className)) { for (final Entry<String, String> forwardLink : model.getLinkedTo(superclassName)) { final CP linkProperty = new CP(superclassName, forwardLink.getValue()); final boolean isCollection = model.getPropertyKind(linkProperty.className, linkProperty.propertyName) == PropertyKind.COLLECTION; final CPI linkSource = linkProperty.toCPI(object.id); for (final CI linked : planning.forwardLinksCached.get(linkSource)) { final Action linkedAction = getAction(linked); addRemoval(linkerToIdToLinked, linkProperty.toCPI(object.id), linked); } else { toNullByCP.put(linkProperty, object.id); final CP linkProperty = new CP(backwardLink.getKey(), backwardLink.getValue()); final boolean isCollection = model.getPropertyKind(linkProperty.className, linkProperty.propertyName) == PropertyKind.COLLECTION; final CPI linkTarget = linkProperty.toCPI(object.id); for (final CI linker : planning.backwardLinksCached.get(linkTarget)) { final Action linkerAction = getAction(linker); addRemoval(linkerToIdToLinked, linkProperty.toCPI(linker.id), object); } else { toNullByCP.put(linkProperty, linker.id); for (final String superclassName : model.getSuperclassesOfReflexive(object.className)) { for (final Entry<String, String> backwardLink : model.getLinkedBy(superclassName)) { final CP linkProperty = new CP(backwardLink.getKey(), backwardLink.getValue()); final boolean isCollection = model.getPropertyKind(linkProperty.className, linkProperty.propertyName) == PropertyKind.COLLECTION;
for (final String inclusionCandidateSuperclassName : model.getSuperclassesOfReflexive(inclusionCandidate.className)) { for (final Entry<String, String> forwardLink : model.getLinkedTo(inclusionCandidateSuperclassName)) { final CP linkProperty = new CP(inclusionCandidateSuperclassName, forwardLink.getValue()); forwardLinksWanted.put(linkProperty, inclusionCandidate.id); final CP linkProperty = new CP(backwardLink.getKey(), backwardLink.getValue()); backwardLinksWanted.put(linkProperty, inclusionCandidate.id); "JOIN linker." + linkProperty.propertyName + " AS linked WHERE linker.id IN (:ids)"; for (final Entry<CI, CI> linkerLinked : getLinksToCache(linkProperty, query, forwardLink.getValue())) { planning.forwardLinksCached.put(linkProperty.toCPI(linkerLinked.getKey().id), linkerLinked.getValue()); "JOIN linker." + linkProperty.propertyName + " AS linked WHERE linked.id IN (:ids)"; for (final Entry<CI, CI> linkerLinked : getLinksToCache(linkProperty, query, backwardLink.getValue())) { planning.backwardLinksCached.put(linkProperty.toCPI(linkerLinked.getValue().id), linkerLinked.getKey());
log.debug(linkProperty.toCPI(linker.id) + " links to " + linked);
/** * Construct a {@link CP} from this {@link CPI}. * Repeated calls to this method may return the same {@link CP} instance. * @return a {@link CP} with the corresponding values */ CP toCP() { if (asCP == null) { asCP = new CP(className, propertyName); } return asCP; }