Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOModel


   * Returns a blank EOModel with the connection dictionary from the adaptor.
   *
   * @return a blank EOModel
   */
  public EOModel _blankModel() {
    EOModel blankModel = new EOModel();
    NSDictionary connectionDictionary = null;
    if (_model != null) {
      connectionDictionary = _model.connectionDictionary();
    }
    if (connectionDictionary == null) {
      connectionDictionary = _adaptorChannel.adaptorContext().adaptor().connectionDictionary();
    }
    blankModel.setConnectionDictionary(connectionDictionary);
    blankModel.setAdaptorName(_adaptorChannel.adaptorContext().adaptor().name());
    return blankModel;
  }
View Full Code Here


      return dict;
    }

    protected void addEntitiesFromModelGroup(EOModelGroup group) {
      for (Enumeration enumeration = group.models().objectEnumerator(); enumeration.hasMoreElements();) {
        EOModel model = (EOModel) enumeration.nextElement();
        if ("JDBC".equalsIgnoreCase(model.adaptorName())) {
          addEntitiesFromModel(model);
        }
      }
    }
View Full Code Here

    // quotes the identifier in the array
   
    String sourceKeyList = quoteArrayContents(sourceColumns).componentsJoinedByString(", ");
    String destinationKeyList = quoteArrayContents(destinationColumns).componentsJoinedByString(", ");
   
    EOModel sourceModel = entity.model();
    EOModel destModel = relationship.destinationEntity().model();
    if (sourceModel != destModel && !sourceModel.connectionDictionary().equals(destModel.connectionDictionary())) {
      throw new IllegalArgumentException(new StringBuilder().append("prepareConstraintStatementForRelationship unable to create a constraint for ").append(relationship.name()).append(" because the source and destination entities reside in different databases").toString());
    }
    setStatement(new StringBuilder()
        .append("ALTER TABLE ")
        .append(sqlStringForSchemaObjectName(tableName))
View Full Code Here

    private ERXJDBCConnectionBroker _broker;
    private EOSQLExpressionFactory _factory;

    public DatabaseSequence(EOEditingContext ec, String modelName, String name, long initialValue) {
      super(name, initialValue);
      EOModel model = ERXEOAccessUtilities.modelGroup(ec).modelNamed(modelName);
      _broker = ERXJDBCConnectionBroker.connectionBrokerForModel(model);
        _factory = new EOSQLExpressionFactory(EOAdaptor.adaptorWithModel(model));
      _lastValue = increasedMaxValue(0);
      _maxValue = _lastValue;
    }
View Full Code Here

      }
      String exceptionsRegex = ERXProperties.stringForKeyWithDefault(ERX_ADAPTOR_EXCEPTIONS_REGEX, ERX_ADAPTOR_EXCEPTIONS_REGEX_DEFAULT);
      if(!handled && throwable.getMessage() != null && throwable.getMessage().matches(exceptionsRegex)) {
        NSArray models = databaseContext.database().models();
        for(Enumeration e = models.objectEnumerator(); e.hasMoreElements(); ) {
          EOModel model = (EOModel)e.nextElement();
          NSDictionary connectionDictionary = model.connectionDictionary();
          if (connectionDictionary != null) {
            NSMutableDictionary mutableConnectionDictionary = connectionDictionary.mutableClone();
            mutableConnectionDictionary.setObjectForKey("<password deleted for log>", "password");
            connectionDictionary = mutableConnectionDictionary;
          }
          log.info(model.name() + ": " + (connectionDictionary == null ? "No connection dictionary!" : connectionDictionary.toString()));
        }
        if ("JDBC".equals(databaseContext.adaptorContext().adaptor().name())) {
          new ERXJDBCConnectionAnalyzer(databaseContext.database().adaptor().connectionDictionary());
        }
      }
View Full Code Here

    // do nothing, it will trigger static class initializer
  }
 
  public static void cleanup() {
    Neo4JContext context = context();
    EOModel model = ERXModelGroup.globalModelGroup().modelNamed(MODEL_NAME);
   
    context.beginTransaction();
    try {
      for (EOEntity e : model.entities()) {
        Store<?, Neo4JErsatz> store = context.entityStoreForEntity(e);
       
        Cursor<Neo4JErsatz> cursor = store.query(null);
       
        try {
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EOModel

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.