Package org.datanucleus.exceptions

Examples of org.datanucleus.exceptions.NucleusObjectNotFoundException


            try
            {
                if (doc.getDocumentElement() == null)
                {
                    // Nothing in the document so no point searching!
                    throw new NucleusObjectNotFoundException();
                }
                // Get the XPath for the objects of this class
                String expression = XMLUtils.getXPathForClass(acmd);
                if (expression == null)
                {
View Full Code Here


    if (entityMap.size() != keys.size()) {
      NucleusObjectNotFoundException[] excs = new NucleusObjectNotFoundException[keys.size()-entityMap.size()];
      int excNum = 0;
      for (Key key : keys) {
        if (!entityMap.containsKey(key)) {
          excs[excNum++] = new NucleusObjectNotFoundException("Entity with key not found", key);
          excNum++;
        }
      }
      throw new NucleusObjectNotFoundException("Some entities could not be found", excs);
    }

    List<Entity> entities = Utils.newArrayList();
    for (Key key : keys) {
      entities.add(entityMap.get(key));
View Full Code Here

        } else {
          // Check that is for this tenant
          String name = op.getExecutionContext().getStoreManager().getNamingFactory().getColumnName(op.getClassMetaData(),
              ColumnType.MULTITENANCY_COLUMN);
          if (!entity.hasProperty(name)) {
            throw new NucleusObjectNotFoundException(
                "Could not retrieve entity of kind " + key.getKind() + " with key " + key);
          } else {
            String tenantVal = (String)entity.getProperty(name);
            if (!op.getExecutionContext().getStoreManager().getStringProperty(PropertyNames.PROPERTY_TENANT_ID).equals(tenantVal)) {
              throw new NucleusObjectNotFoundException(
                  "Could not retrieve entity of kind " + key.getKind() + " with key " + key + " : was for different tenant " + tenantVal);
            }
          }
        }
      }
View Full Code Here

    return new NucleusDataStoreException("Concurrent Modification", e);
  }

  static NucleusObjectNotFoundException wrapEntityNotFoundException(
      EntityNotFoundException e, Key key) {
    return new NucleusObjectNotFoundException(
        "Could not retrieve entity of kind " + key.getKind() + " with key " + key);
  }
View Full Code Here

    return new NucleusDataStoreException("Concurrent Modification", e);
  }

  static NucleusObjectNotFoundException wrapEntityNotFoundException(
      EntityNotFoundException e, Key key) {
    return new NucleusObjectNotFoundException(
        "Could not retrieve entity of kind " + key.getKind() + " with key " + key);
  }
View Full Code Here

            DBCollection collection = db.getCollection(MongoDBUtils.getCollectionName(cmd));
            DBObject dbObject = MongoDBUtils.getObjectForObjectProvider(collection, op, false);
            if (dbObject == null)
            {
                throw new NucleusObjectNotFoundException("Could not find object with id " + op.getInternalObjectId() + " op="+op);
            }

            if (cmd.hasVersionStrategy() && op.getTransactionalVersion() == null)
            {
                // No version set, so retrieve it
View Full Code Here

                DB db = (DB)mconn.getConnection();
                DBCollection collection = db.getCollection(MongoDBUtils.getCollectionName(cmd));
                DBObject dbObject = MongoDBUtils.getObjectForObjectProvider(collection, op, false);
                if (dbObject == null)
                {
                    throw new NucleusObjectNotFoundException();
                }
            }
            finally
            {
                mconn.release();
View Full Code Here

        if (pkValue != null) {
            QueryResult qr = ((PartnerConnection) mconn.getConnection()).query(
                    new ForceQueryUtils(objectProvider.getExecutionContext(), mconn, null, null, null, null)
                    .buildQueryWithPK(table, objectProvider.getClassMetaData(), fieldNumbers, (String) pkValue, 0));
            if (qr.getSize() == 0) {
                throw new NucleusObjectNotFoundException();
            }
            this.sobject = qr.getRecords()[0];
        } else {
            this.sobject = new SObject();
        }
View Full Code Here

        ClassLoaderResolver clr = myOM.getClassLoaderResolver();
        String className = getStoreManager().getClassNameForObjectID(myID, clr, myOM);
        if (className == null)
        {
            // className is null when id class exists, and object has been validated and doesn't exist.
            throw new NucleusObjectNotFoundException(LOCALISER.msg("026013", myOM.getIdentityAsString(myID)), myID);
        }
        else if (!cmd.getFullClassName().equals(className))
        {
            Class pcClass;
            try
View Full Code Here

    return new NucleusDataStoreException("Concurrent Modification", e);
  }

  static NucleusObjectNotFoundException wrapEntityNotFoundException(
      EntityNotFoundException e, Key key) {
    return new NucleusObjectNotFoundException(
        "Could not retrieve entity of kind " + key.getKind() + " with key " + key);
  }
View Full Code Here

TOP

Related Classes of org.datanucleus.exceptions.NucleusObjectNotFoundException

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.