Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EODatabaseDataSource


    /**
     * Utility to return a new database datasource
     * @param ec
     */
     public EODatabaseDataSource newDatabaseDataSource(EOEditingContext ec) {
      return new EODatabaseDataSource(ec, entityName());
    }
View Full Code Here


      }
      object.takeValueForKey(value, "value");

      d2wContext().takeValueForKey(object, "object");
      setObject(object);
      setDataSource(new EODatabaseDataSource(editingContext(), d2wContext().entity().name()));
      displayGroup.setDataSource(dataSource());
      d2wContext().setPropertyKey("value");
      d2wContext().takeValueForKey("D2WDisplayString", "innerComponentName");
      log.debug(d2wContext().entity().name() + " " + d2wContext().task()
          + ": " + d2wContext().componentsAvailable()
View Full Code Here

     * @return the prepared data source
     */
    public EODataSource defaultQueryDataSource() {
        EODataSource ds = dataSource();
        if (ds == null || !(ds instanceof EODatabaseDataSource)) {
            ds = new EODatabaseDataSource(session().defaultEditingContext(), entity().name());
            setDataSource(ds);
        }
        EOFetchSpecification fs = queryFetchSpecification();
        if (fs == null) {
            fs = ((EODatabaseDataSource) ds).fetchSpecification();
View Full Code Here

      String pickConfigurationName = (String) valueForBinding("pickConfigurationName");
      if(pickConfigurationName == null) {
        pickConfigurationName = "Pick" + pickEntity.name();
      }
      ERDPickPageInterface epi= (ERDPickPageInterface)D2W.factory().pageForConfigurationNamed(pickConfigurationName, session());
      epi.setDataSource(new EODatabaseDataSource(object().editingContext(), pickEntity.name()));
      epi.setSelectedObjects(((NSArray)object().valueForKeyPath(keyPath + ".@unique")).mutableClone());
      epi.setNextPageDelegate( new ERDPickIntermediateDelegate(object(), relationshipName, pickRelationshipName, context().page()));
     
      nextPage = (WOComponent)epi;
      return nextPage;
View Full Code Here

            WOComponent result=_nextPage;
            QueryPageInterface qpi=(QueryPageInterface)sender;
            EODataSource eds=qpi.queryDataSource();
            if (eds!=null) {
                if (eds instanceof EODatabaseDataSource) {
                    EODatabaseDataSource dbds=(EODatabaseDataSource)eds;
                    EOQualifier q=dbds.fetchSpecification().qualifier();
                    log.debug("Setting qualifier to "+q);
                    _displayGroup.setQualifier(q);
                    _displayGroup.updateDisplayedObjects();
                } else {
                    log.warn("Data source of unknown type: "+eds.getClass().getName());
View Full Code Here

        super(context);
    }

    public WOComponent showList() {
        ListPageInterface nextPage = (ListPageInterface) D2W.factory().pageForConfigurationNamed("ListAjaxBug", session());
        EODatabaseDataSource ds = new EODatabaseDataSource(session().defaultEditingContext(), "Bug");
        ds.setFetchSpecification(new EOFetchSpecification("Bug", null, null));
        ds.fetchSpecification().setFetchLimit(5);
        nextPage.setDataSource(ds);
        return (WOComponent) nextPage;
    }
View Full Code Here

        /* ** Put your per-session initialization code here ** */
    }


    public void getObjects(){
        EODatabaseDataSource ds = new EODatabaseDataSource(defaultEditingContext(), "Movie");
        EOFetchSpecification fs = ds.fetchSpecification();
        fs.setPrefetchingRelationshipKeyPaths(new NSArray("studio"));
        _objects = ds.fetchObjects();
        System.out.println("getRawRows: objects: "+ _objects.count());
    }
View Full Code Here

    // when we do a real fetch. This actually
    // belongs into ERXEC, but I'm reluctant to have this morphing done
    // every time a fetch occurs as it affects mainly sort ordering
    // from the display group
    if (dataSource() instanceof EODatabaseDataSource) {
      EODatabaseDataSource ds = (EODatabaseDataSource) dataSource();
      EOFetchSpecification old = ds.fetchSpecification();
      EOFetchSpecification fs = ERXEOAccessUtilities.localizeFetchSpecification(ds.editingContext(), old);
      ds.setFetchSpecification(fs);
      try {
        result = super.fetch();
      } finally {
        ds.setFetchSpecification(old);
      }
    } else {
      result = super.fetch();
    }
    return result;
View Full Code Here

   * qualifier.
   *
   * @return the fetch specification
   */
  protected EOFetchSpecification fetchSpecification() {
    EODatabaseDataSource ds = (EODatabaseDataSource) dataSource();
    EOFetchSpecification spec = (EOFetchSpecification) ds.fetchSpecificationForFetch().clone();
    spec.setSortOrderings(ERXArrayUtilities.arrayByAddingObjectsFromArrayWithoutDuplicates(sortOrderings(), spec.sortOrderings()));
    EOQualifier dgQualifier = qualifier();
    EOQualifier qualifier = spec.qualifier();
    if (dgQualifier != null) {
      if (qualifier != null) {
View Full Code Here

                    anEditingContext = ((EOEnterpriseObject)_source).editingContext();
                }
                if (anEditingContext == null) {
                    anEditingContext = session().defaultEditingContext() ;
                }
                EODatabaseDataSource aDatabaseDataSource = new EODatabaseDataSource(anEditingContext, destinationEntity.name());
                setDataSource(aDatabaseDataSource);
            }
        }

        return dataSource();
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EODatabaseDataSource

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.