Package com.webobjects.eoaccess

Examples of com.webobjects.eoaccess.EOAdaptor


   * @return the database the database product name ("FrontBase",
   *         "PostgreSQL")
   */
  public static String databaseProductName(EOModel model) {
    EODatabaseContext databaseContext = EODatabaseContext.registeredDatabaseContextForModel(model, ERXEC.newEditingContext());
    EOAdaptor adaptor = databaseContext.database().adaptor();
    String databaseProductName;
    if (adaptor instanceof JDBCAdaptor) {
      databaseProductName = ((JDBCAdaptor) adaptor).plugIn().databaseProductName();
    }
    else {
      databaseProductName = adaptor.name();
    }
    return databaseProductName;
  }
View Full Code Here


      else {
        selectBuf.append(tableName);
      }
      EOQualifier qualifier = entity.restrictingQualifier();
      if (qualifier != null) {
        EOAdaptor adaptor = EOAdaptor.adaptorWithName("JDBC");
        adaptor.setConnectionDictionary(_sourceDictionary);
        EOSQLExpressionFactory factory = adaptor.expressionFactory();
        EOSQLExpression sqlExpression = factory.createExpression(entity);
        String sqlString = EOQualifierSQLGeneration.Support._sqlStringForSQLExpression(qualifier, sqlExpression);
        selectBuf.append(" where ").append(sqlString);
      }
      selectBuf.append(';');
View Full Code Here

     */
    // CHECKME: Is this still needed now?
    public boolean databaseContextShouldHandleDatabaseException(EODatabaseContext dbc, Exception e) throws Throwable {
      if(!reportingError.canEnter(dbc)) return true;
      try {
        EOAdaptor adaptor=dbc.adaptorContext().adaptor();
        boolean shouldHandleConnection = false;
        if(e instanceof EOGeneralAdaptorException)
          log.error(((EOGeneralAdaptorException)e).userInfo());
        else
          log.error(e);
        if (adaptor.isDroppedConnectionException(e))
          shouldHandleConnection = true;
        // FIXME: Should provide api to extend the list of bad exceptions.
        else if (e.toString().indexOf("ORA-01041")!=-1) {
          // just returning true here does not seem to do the trick. why !?!?
          log.error("ORA-01041 detecting -- forcing reconnect");
View Full Code Here

   * Not the best test, but it will work. Uses the select statement from the method being tested to fetch from the ERXTest model. Then, after inserting
   * a few objects, makes sure that the results are greater than the last time.
   */
  public void testRawRowsForSQLExpressionEOEditingContextStringEOSQLExpression() {

    EOAdaptor adaptor = EOAdaptor.adaptorWithName(EOModelGroup.defaultGroup().modelNamed(ERXTestSuite.ERXTEST_MODEL).adaptorName());
    if (skipTestsForAdaptor.objectForKey(adaptor.name()).contains("testRawRowsForSQLExpressionEOEditingContextStringEOSQLExpression")) return;
    EOSQLExpressionFactory factory = new EOSQLExpressionFactory(adaptor);
    NSArray<EOEntity> entities = EOModelGroup.defaultGroup().modelNamed(ERXTestSuite.ERXTEST_MODEL).entities();
    NSMutableDictionary<String,Number> counts = new NSMutableDictionary<String,Number>();

    for (EOEntity entity : entities) {
View Full Code Here

TOP

Related Classes of com.webobjects.eoaccess.EOAdaptor

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.