Package javax.jcr

Examples of javax.jcr.ReferentialIntegrityException


            {
               throw new AccessDeniedException("Access denied " + rpd.getQPath().getAsString() + " for "
                  + userState.getIdentity().getUserId() + " (get reference property parent by id)");
            }

            throw new ReferentialIntegrityException("This node " + node.getQPath().getAsString()
               + " is currently the target of a REFERENCE property " + rpd.getQPath().getAsString()
               + " located in this workspace. Session id: " + userState.getIdentity().getUserId());
         }
      }
   }
View Full Code Here


               {
                  throw new AccessDeniedException("Can not delete node " + refNode.getQPath() + " ("
                     + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property and "
                     + refProp.getQPath().getAsString());
               }
               throw new ReferentialIntegrityException("Can not delete node " + refNode.getQPath() + " ("
                  + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property "
                  + refProp.getQPath().getAsString());
            }
         }
      }
View Full Code Here

      // check references.
      // Note: References from /jcr:system/jcr:versionStorage never included to
      // getReferences!
      List<PropertyData> refs = dataManager.getReferencesData(version.getInternalIdentifier(), true);
      if (refs.size() > 0)
         throw new ReferentialIntegrityException("There are Reference property pointed to this Version "
            + refs.get(0).getQPath().getAsString());

      PlainChangesLog changes = new PlainChangesLogImpl(session.getId());

      // remove labels first
View Full Code Here

      // Note: References from /jcr:system/jcr:versionStorage never included to
      // getReferences!
      List<PropertyData> refs = dataManager.getReferencesData(version.getInternalIdentifier(), true);
      if (refs.size() > 0)
      {
         throw new ReferentialIntegrityException("There are Reference property pointed to this Version "
            + refs.get(0).getQPath().getAsString());
      }

      PlainChangesLog changes = new PlainChangesLogImpl(session.getId());
View Full Code Here

               {
                  throw new AccessDeniedException("Can not delete node " + refNode.getQPath() + " ("
                     + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property and "
                     + refProp.getQPath().getAsString());
               }
               throw new ReferentialIntegrityException("Can not delete node " + refNode.getQPath() + " ("
                  + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property "
                  + refProp.getQPath().getAsString());
            }
         }
      }
View Full Code Here

         throw new ItemExistsException(e);
      }
      catch (ReferentialIntegrityException e)
      {
         remainChangesBack(cLog);
         throw new ReferentialIntegrityException(e);
      }
      catch (RepositoryException e)
      {
         remainChangesBack(cLog);
         throw new RepositoryException(e);
View Full Code Here

      // check references.
      // Note: References from /jcr:system/jcr:versionStorage never included to
      // getReferences!
      List<PropertyData> refs = dataManager.getReferencesData(version.getInternalIdentifier(), true);
      if (refs.size() > 0)
         throw new ReferentialIntegrityException("There are Reference property pointed to this Version "
            + refs.get(0).getQPath().getAsString());

      PlainChangesLog changes = new PlainChangesLogImpl(session.getId());

      // remove labels first
View Full Code Here

               {
                  throw new AccessDeniedException("Can not delete node " + refNode.getQPath() + " ("
                     + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property and "
                     + refProp.getQPath().getAsString());
               }
               throw new ReferentialIntegrityException("Can not delete node " + refNode.getQPath() + " ("
                  + refNode.getIdentifier() + ")" + ". It is currently the target of a REFERENCE property "
                  + refProp.getQPath().getAsString());
            }
         }
      }
View Full Code Here

                        // same UUID, i.e. the node is still referenceable.
                        if (refs.hasReferences() && !local.has(targetId)) {
                            String msg = node.getNodeId()
                                    + ": the node cannot be removed because it is still being referenced.";
                            log.debug(msg);
                            throw new ReferentialIntegrityException(msg);
                        }
                    }
                }
            }

            // check whether targets of modified node references exist
            for (NodeReferences refs : local.modifiedRefs()) {
                // no need to check existence of target if there are no references
                if (refs.hasReferences()) {
                    // please note:
                    // virtual providers are indirectly checked via 'hasItemState()'
                    NodeId id = refs.getTargetId();
                    if (!local.has(id) && !hasItemState(id)) {
                        String msg = "Target node " + id
                                + " of REFERENCE property does not exist";
                        log.debug(msg);
                        throw new ReferentialIntegrityException(msg);
                    }
                }
            }
        }
View Full Code Here

                        if (refs.hasReferences() && !local.has(targetId)) {
                            String msg =
                                node.getNodeId() + " cannot be removed"
                                + " because it is still being referenced";
                            log.debug("{} from {}", msg, refs.getReferences());
                            throw new ReferentialIntegrityException(msg);
                        }
                    }
                }
            }

            // check whether targets of modified node references exist
            for (NodeReferences refs : local.modifiedRefs()) {
                // no need to check existence of target if there are no references
                if (refs.hasReferences()) {
                    // please note:
                    // virtual providers are indirectly checked via 'hasItemState()'
                    NodeId id = refs.getTargetId();
                    if (!local.has(id) && !hasItemState(id)) {
                        String msg = "Target node " + id
                                + " of REFERENCE property does not exist";
                        log.debug(msg);
                        throw new ReferentialIntegrityException(msg);
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of javax.jcr.ReferentialIntegrityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.