Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOKeyGlobalID


            return true;
        }
        EOFaulting fault = (EOFaulting)obj;
        if (fault.faultHandler() instanceof EOAccessArrayFaultHandler) {
            EOAccessArrayFaultHandler handler = (EOAccessArrayFaultHandler) fault.faultHandler();
            EOKeyGlobalID sourceGid = handler.sourceGlobalID();
            EOEditingContext ec = handler.editingContext();
            synchronized (cache) {
                NSDictionary entries = relationshipCacheEntriesForEntity(sourceGid.entityName(), handler.relationshipName());
                if(entries != null) {
                    NSArray gids = (NSArray) entries.objectForKey(sourceGid);
                    if(gids != null) {
                        NSMutableArray eos = new NSMutableArray(gids.count());
                        for (Enumeration enumerator = gids.objectEnumerator(); enumerator.hasMoreElements();) {
View Full Code Here


      NSMutableDictionary dbcs = new NSMutableDictionary();

      for (Enumeration gids = objects.objectEnumerator(); gids.hasMoreElements();) {
        EOGlobalID gid = (EOGlobalID) gids.nextElement();
        if (gid instanceof EOKeyGlobalID) {
          EOKeyGlobalID globalID = (EOKeyGlobalID) gid;
          String entityName = globalID.entityName();
          String key = entityName + "/" + System.identityHashCode(osc);
          EODatabaseContext dbc = (EODatabaseContext) dbcs.objectForKey(key);
          if (dbc == null) {
            dbc = ERXEOAccessUtilities.databaseContextForEntityNamed(osc, entityName);
            dbcs.setObjectForKey(dbc, key);
View Full Code Here

                                    log.error("We currently don't support unsaved related objects for this entity: " + entityName);
                                    _warned.addObject(entityName);
                                }
                            } else {
                                EORelationship rel = source.anyRelationshipNamed(key);
                                EOKeyGlobalID sourceGlobalID = (EOKeyGlobalID) ec.globalIDForObject(eo);
                                // AK: I wish I could, but when a relationship
                                // is
                                // not a class prop, there's nothing we can do.
                                // value =
                                // ec.arrayFaultWithSourceGlobalID(sourceGlobalID,
View Full Code Here

    _score = score;
  }
 
  public EOKeyGlobalID eoKeyGlobalId() {
    String gidString = _doc.get(GID);
    EOKeyGlobalID gid = ERXKeyGlobalID.fromString(gidString).globalID();
    return gid;
  }
View Full Code Here

      public RelationshipSnapshotProcessor() {}

      public void processRelationships(EODatabase database, NSArray gids, NSDictionary snapshots, Object context, SynchronizerSettings settings) {
        Enumeration gidsEnum = gids.objectEnumerator();
        while (gidsEnum.hasMoreElements()) {
          EOKeyGlobalID gid = (EOKeyGlobalID) gidsEnum.nextElement();
          processGID(database, gid, context, settings);
          EOEntity entity = database.entityNamed(gid.entityName());
          NSDictionary snapshot = (NSDictionary) snapshots.objectForKey(gid);
          Enumeration relationshipsEnum = entity.relationships().objectEnumerator();
          while (relationshipsEnum.hasMoreElements()) {
            EORelationship relationship = (EORelationship) relationshipsEnum.nextElement();
            if (!relationship.isToMany()) {
View Full Code Here

        }
        return documents;
    }

    protected Document createDocumentForObject(EOEnterpriseObject eo) {
        EOKeyGlobalID gid = ((ERXGenericRecord) eo).permanentGlobalID();
        IndexDocument document = createDocumentForGlobalID(gid);
        Document doc = document.document();
        for (IndexAttribute info : attributes()) {
            String key = info.name();
            Object value = eo.valueForKeyPath(key);
View Full Code Here

        term = new Term(GID, pk);
        return term;
    }

    private String gidStringForObject(EOEnterpriseObject eo) {
        EOKeyGlobalID gid = ((ERXGenericRecord) eo).permanentGlobalID();
        String pk = ERXKeyGlobalID.globalIDForGID(gid).asString();
        return pk;
    }
View Full Code Here

        String pk = ERXKeyGlobalID.globalIDForGID(gid).asString();
        return pk;
    }

    private EOEnterpriseObject objectForGidString(EOEditingContext ec, String gidString) {
        EOKeyGlobalID gid = ERXKeyGlobalID.fromString(gidString).globalID();
        return ec.faultForGlobalID(gid, ec);
    }
View Full Code Here

      sort = sort == null ? new Sort() : sort;
      TopFieldDocs topFielsDocs = searcher.search(query, filter, end, sort);
      log.info("Searched for: " + query + " in  " + (System.currentTimeMillis() - startTime) + " ms");
      for (int i = start; i < topFielsDocs.scoreDocs.length; i++) {
        String gidString = searcher.doc(topFielsDocs.scoreDocs[i].doc).getField(GID).stringValue();
        EOKeyGlobalID gid = ERXKeyGlobalID.fromString(gidString).globalID();
        result.addObject(gid);
      }
            log.info("Returning " + result.count() + " after " + (System.currentTimeMillis() - startTime) + " ms");
      return result;
    } catch (IOException e) {
View Full Code Here

            Hits hits = searcher.search(query);
            log.info("Searched for: " + query + " in  " + (System.currentTimeMillis() - start) + " ms");
            for (Iterator iter = hits.iterator(); iter.hasNext();) {
                Hit hit = (Hit) iter.next();
                String gidString = hit.getDocument().getField(GID).stringValue();
                EOKeyGlobalID gid = ERXKeyGlobalID.fromString(gidString).globalID();
                result.addObject(gid);
            }
            log.info("Returning " + result.count() + " after " + (System.currentTimeMillis() - start) + " ms");
            return result;
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOKeyGlobalID

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.