Examples of model()


Examples of com.webobjects.eoaccess.EOEntity.model()

    Enumeration modelsEnum = modelGroup.models().objectEnumerator();
    while (modelsEnum.hasMoreElements()) {
      EOModel model = (EOModel) modelsEnum.nextElement();
      EOEntity eoAdaptorPrototypesEntity = _modelGroup.entityNamed("EO" + model.adaptorName() + "Prototypes");
      if (eoAdaptorPrototypesEntity != null) {
        prototypesModel = eoAdaptorPrototypesEntity.model();
        // System.out.println("EOFSQLGenerator.EOFSQLGenerator:
        // removing " + eoAdaptorPrototypesEntity.name() + " from "
        // + prototypesModel.name());
        prototypesModel.removeEntity(eoAdaptorPrototypesEntity);
        removedPrototypeEntities.takeValueForKey(eoAdaptorPrototypesEntity, eoAdaptorPrototypesEntity.name());
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

      }
    }

    EOEntity eoPrototypesEntity = _modelGroup.entityNamed("EOPrototypes");
    if (eoPrototypesEntity != null) {
      prototypesModel = eoPrototypesEntity.model();
      prototypesModel.removeEntity(eoPrototypesEntity);
      // System.out.println("EOFSQLGenerator.EOFSQLGenerator: removing
      // " + eoPrototypesEntity.name() + " from " +
      // prototypesModel.name());
      removedPrototypeEntities.takeValueForKey(eoPrototypesEntity, eoPrototypesEntity.name());
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

    EOEntity prototypesEntity = _modelGroup.entityNamed(prototypeEntityName);
    if (prototypesEntity == null) {
      prototypesEntity = (EOEntity) removedPrototypeEntities.valueForKey(prototypeEntityName);
    } else {
      prototypesModel = prototypesEntity.model();
      prototypesModel.removeEntity(prototypesEntity);
    }
    if (prototypesEntity != null && prototypesModel != null) {
      // System.out.println("EOFSQLGenerator.EOFSQLGenerator: setting
      // " + prototypesEntity.name() + " to EOPrototypes in " +
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

     * @param i number of primary keys to generate
     * @return array of new primary keys
     */
    public NSArray newPrimaryKeys(EOEditingContext ec, int i) {
        EOEntity entity = entity(ec);
        EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec);
        dbc.lock();
        try {
          return dbc.availableChannel().adaptorChannel().primaryKeysForNewRowsWithEntity(i, entity);
        } finally {
          dbc.unlock();
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

          + "' in the entity named '" + object.entityName() +"' is not a toMany relationship!");
    }

    // --- (3) Case of a fault and a snapshot exists to provide a count
    final EOGlobalID gid = ec.globalIDForObject(object);
    String modelName = entity.model().name();
    final EODatabaseContext dbc = EOUtilities.databaseContextForModelNamed(ec, modelName);

    NSArray toManySnapshot = ERXEOAccessUtilities.executeDatabaseContextOperation(dbc, 2,
        new DatabaseContextOperation<NSArray>() {
          public NSArray execute(EODatabaseContext databaseContext) throws Exception {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

     * @param aggregateAttribute the attribute that contains the "count(*)" definition
     * @return the number of objects
     */
    public static Object _aggregateFunctionWithQualifierAndAggregateAttribute(EOEditingContext ec, String entityName, EOQualifier qualifier, EOAttribute aggregateAttribute) {
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        EOModel model = entity.model();
        EODatabaseContext dbc = EODatabaseContext.registeredDatabaseContextForModel(model, ec);
        Object aggregateValue = null;
       
        dbc.lock();
        try {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

    public static NSArray sharedObjectsForEntityNamed(String entityName) {
        EOSharedEditingContext sharedEC = EOSharedEditingContext.defaultSharedEditingContext();
        NSArray sharedEos = (NSArray)sharedEC.objectsByEntityName().objectForKey(entityName);
        if (sharedEos == null) { //call registeredDatabaseContextForModel() to trigger loading the model's shared EOs (if set to happen automatically), then try again
            EOEntity entity = ERXEOAccessUtilities.entityNamed(sharedEC, entityName);
            EODatabaseContext.registeredDatabaseContextForModel(entity.model(), sharedEC);
            sharedEos = (NSArray)sharedEC.objectsByEntityName().objectForKey(entityName);
        }

        if (sharedEos == null) {
            log.warn("Unable to find any shared objects for the entity named: " + entityName);
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

     *    entity.
     */
    @SuppressWarnings("unchecked")
    public static NSDictionary<String, Object> newPrimaryKeyDictionaryForEntityNamed(EOEditingContext ec, String entityName) {
        EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName);
        EODatabaseContext dbContext = EODatabaseContext.registeredDatabaseContextForModel(entity.model(), ec);
        NSDictionary<String, Object> primaryKey = null;
        try {
            dbContext.lock();
           
            boolean willRetryAfterHandlingDroppedConnection = true;
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

     *
     * @author David Avendasora
     */
    public static <T extends ERXCopyable<T>> T modelCopy(NSMutableDictionary<EOGlobalID, ERXCopyable<?>> copiedObjects, T source) {
      EOEntity entity = Utility.entity(source);
      EOModel model = entity.model();
      NSDictionary<String, Object> entityUserInfo = entity.userInfo();
      String entityName = entity.name();
      String modelName = model.name();

      if (!entityUserInfo.containsKey(ERXCopyable.ERXCOPYABLE_KEY)) {
View Full Code Here

Examples of com.webobjects.eoaccess.EOEntity.model()

      NSArray<String> copyTypes = (NSArray<String>) CopyType.copyTypesFor(property).valueForKey("type");
      String validCopyTypes = copyTypes.componentsJoinedByString(", ");
      String propertyName = property.name();
      EOEntity entity = property.entity();
      String entityName = entity.name();
      EOModel model = entity.model();
      String modelName = model.name();
      String exceptionMessage = "ERXCopyable's modelCopy requires the \"" + ERXCopyable.COPY_TYPE_KEY + "\" key must be set in the UserInfo dictionary of \"" + entityName + "." + propertyName + "\" " + propertyType + " in " + modelName + " AND it must be set to one of these values: {" + validCopyTypes + "}. \"" + copyType + "\" is not a valid value.";
      throw new IllegalStateException(exceptionMessage);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.