static NucleusObjectNotFoundException wrapEntityNotFoundException( EntityNotFoundException e, Key key) { return new NucleusObjectNotFoundException( "Could not retrieve entity of kind " + key.getKind() + " with key " + key); }
throw new NucleusObjectNotFoundException(); throw new NucleusObjectNotFoundException(e.getMessage(), e);
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);
throw new NucleusObjectNotFoundException("No object found with type " + type + " and filter " + attributeFilter);
public static Object getObjectByDN(StoreManager storeMgr, ExecutionContext om, Class type, String dnAsString) { AbstractClassMetaData cmd = om.getMetaDataManager().getMetaDataForClass(type, om.getClassLoaderResolver()); LdapName base = getSearchBase(cmd, om.getMetaDataManager()); try { LdapName dn = new LdapName(dnAsString); Rdn rdn = dn.getRdn(dn.size() - 1); String filter = "(" + rdn.getType() + "=" + rdn.getValue() + ")"; List<Object> objects = LDAPUtils.getObjectsOfCandidateType(storeMgr, om, cmd, base, filter, true, false); if (objects.size() == 1) { return objects.get(0); } else if (objects.size() == 0) { // TODO: localise throw new NucleusObjectNotFoundException("No object found with type " + type + " and filter " + filter); } else { // TODO: localise throw new NucleusDataStoreException("Unambiguous match with type " + type + " and filter " + filter); } } catch (NamingException e) { throw new NucleusDataStoreException(e.getMessage(), e); } }
throw new NucleusObjectNotFoundException("Object not found", op.getInternalObjectId());
throw new NucleusObjectNotFoundException("Exception thrown finding object with id=" + id, ndse.getNestedExceptions());
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);
.buildQueryWithPK(table, objectProvider.getClassMetaData(), fieldNumbers, (String) pkValue, 0)); if (qr.getSize() == 0) { throw new NucleusObjectNotFoundException();
if (!HBaseUtils.objectExistsInTable(op, htable, table)) throw new NucleusObjectNotFoundException();
/** * Locates this object in the datastore. * * @param op The ObjectProvider for the object to be found */ @Override public void locateObject(ObjectProvider op) { ForceManagedConnection mconn = (ForceManagedConnection) storeManager.getConnection(op.getExecutionContext()); try { AbstractClassMetaData acmd = op.getClassMetaData(); TableImpl table = storeManager.getTable(acmd); QueryResult qr = ((PartnerConnection) mconn.getConnection()) .query("select count() from " + table.getTableName().getForceApiName() + " where id='" + op.provideField(op.getClassMetaData().getPKMemberPositions()[0]) + "'"); if (qr.getSize() == 0) { throw new NucleusObjectNotFoundException(); } } catch (ConnectionException x) { throw new NucleusDataStoreException(x.getMessage(), x); } finally { mconn.release(); } }
.buildQueryWithPK(table, objectProvider.getClassMetaData(), fieldNumbers, (String) pkValue, 0)); if (qr.getSize() == 0) { throw new NucleusObjectNotFoundException();
/** * Locates this object in the datastore. * * @param op The ObjectProvider for the object to be found */ @Override public void locateObject(ObjectProvider op) { ForceManagedConnection mconn = (ForceManagedConnection) storeManager.getConnection(op.getExecutionContext()); try { AbstractClassMetaData acmd = op.getClassMetaData(); TableImpl table = storeManager.getTable(acmd); QueryResult qr = ((PartnerConnection) mconn.getConnection()) .query("select count() from " + table.getTableName().getForceApiName() + " where id='" + op.provideField(op.getClassMetaData().getPKMemberPositions()[0]) + "'"); if (qr.getSize() == 0) { throw new NucleusObjectNotFoundException(); } } catch (ConnectionException x) { throw new NucleusDataStoreException(x.getMessage(), x); } finally { mconn.release(); } }
public void locateObject(ObjectProvider op) { final AbstractClassMetaData cmd = op.getClassMetaData(); if (cmd.getIdentityType() == IdentityType.APPLICATION || cmd.getIdentityType() == IdentityType.DATASTORE) { ExecutionContext ec = op.getExecutionContext(); ManagedConnection mconn = storeMgr.getConnectionManager().getConnection(ec); try { StoreData sd = storeMgr.getStoreDataForClass(cmd.getFullClassName()); if (sd == null) { storeMgr.manageClasses(op.getExecutionContext().getClassLoaderResolver(), cmd.getFullClassName()); } GraphDatabaseService db = (GraphDatabaseService)mconn.getConnection(); PropertyContainer propObj = Neo4jUtils.getPropertyContainerForObjectProvider(db, op); if (propObj == null) { throw new NucleusObjectNotFoundException("Object not found for id=" + op.getInternalObjectId()); } } finally { mconn.release(); } } }
if (dbObject == null) throw new NucleusObjectNotFoundException();
throw new NucleusObjectNotFoundException("Object not found", op.getInternalObjectId());
throw new NucleusObjectNotFoundException("Object not found",op.getInternalObjectId());