// $LastChangedRevision: 4748 $ DO NOT EDIT.  Make changes to WiwoNameSpaceDefinition2WiwoPage.java instead.
package mildo.wiwo.data;

import com.webobjects.eoaccess.*;
import com.webobjects.eocontrol.*;
import com.webobjects.foundation.*;
import java.math.*;
import java.util.*;

public abstract class _WiwoNameSpaceDefinition2WiwoPage extends  EOGenericRecord {
	public static final String ENTITY_NAME = "WiwoNameSpaceDefinition2WiwoPage";

	// Attributes

	// Relationships

  public WiwoNameSpaceDefinition2WiwoPage localInstanceOfWiwoNameSpaceDefinition2WiwoPageIn(EOEditingContext editingContext) {
    WiwoNameSpaceDefinition2WiwoPage localInstance = (WiwoNameSpaceDefinition2WiwoPage)EOUtilities.localInstanceOfObject(editingContext, this);
    if (localInstance == null) {
      throw new IllegalStateException("You attempted to localInstance " + this + ", which has not yet committed.");
    }
    return localInstance;
  }


  public static WiwoNameSpaceDefinition2WiwoPage createWiwoNameSpaceDefinition2WiwoPage(EOEditingContext editingContext) {
    WiwoNameSpaceDefinition2WiwoPage eo = (WiwoNameSpaceDefinition2WiwoPage) EOUtilities.createAndInsertInstance(editingContext, _WiwoNameSpaceDefinition2WiwoPage.ENTITY_NAME);    
    return eo;
  }

  public static NSArray fetchAllWiwoNameSpaceDefinition2WiwoPages(EOEditingContext editingContext) {
    return _WiwoNameSpaceDefinition2WiwoPage.fetchAllWiwoNameSpaceDefinition2WiwoPages(editingContext, null);
  }

  public static NSArray fetchAllWiwoNameSpaceDefinition2WiwoPages(EOEditingContext editingContext, NSArray sortOrderings) {
    return _WiwoNameSpaceDefinition2WiwoPage.fetchWiwoNameSpaceDefinition2WiwoPages(editingContext, null, sortOrderings);
  }

  public static NSArray fetchWiwoNameSpaceDefinition2WiwoPages(EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings) {
    EOFetchSpecification fetchSpec = new EOFetchSpecification(_WiwoNameSpaceDefinition2WiwoPage.ENTITY_NAME, qualifier, sortOrderings);
    fetchSpec.setIsDeep(true);
    NSArray eoObjects = (NSArray)editingContext.objectsWithFetchSpecification(fetchSpec);
    return eoObjects;
  }

  public static WiwoNameSpaceDefinition2WiwoPage fetchWiwoNameSpaceDefinition2WiwoPage(EOEditingContext editingContext, String keyName, Object value) {
    return _WiwoNameSpaceDefinition2WiwoPage.fetchWiwoNameSpaceDefinition2WiwoPage(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

  public static WiwoNameSpaceDefinition2WiwoPage fetchWiwoNameSpaceDefinition2WiwoPage(EOEditingContext editingContext, EOQualifier qualifier) {
    NSArray eoObjects = _WiwoNameSpaceDefinition2WiwoPage.fetchWiwoNameSpaceDefinition2WiwoPages(editingContext, qualifier, null);
    WiwoNameSpaceDefinition2WiwoPage eoObject;
    int count = eoObjects.count();
    if (count == 0) {
      eoObject = null;
    }
    else if (count == 1) {
      eoObject = (WiwoNameSpaceDefinition2WiwoPage)eoObjects.objectAtIndex(0);
    }
    else {
      throw new IllegalStateException("There was more than one WiwoNameSpaceDefinition2WiwoPage that matched the qualifier '" + qualifier + "'.");
    }
    return eoObject;
  }

  public static WiwoNameSpaceDefinition2WiwoPage fetchRequiredWiwoNameSpaceDefinition2WiwoPage(EOEditingContext editingContext, String keyName, Object value) {
    return _WiwoNameSpaceDefinition2WiwoPage.fetchRequiredWiwoNameSpaceDefinition2WiwoPage(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

  public static WiwoNameSpaceDefinition2WiwoPage fetchRequiredWiwoNameSpaceDefinition2WiwoPage(EOEditingContext editingContext, EOQualifier qualifier) {
    WiwoNameSpaceDefinition2WiwoPage eoObject = _WiwoNameSpaceDefinition2WiwoPage.fetchWiwoNameSpaceDefinition2WiwoPage(editingContext, qualifier);
    if (eoObject == null) {
      throw new NoSuchElementException("There was no WiwoNameSpaceDefinition2WiwoPage that matched the qualifier '" + qualifier + "'.");
    }
    return eoObject;
  }

  public static WiwoNameSpaceDefinition2WiwoPage localInstanceOfWiwoNameSpaceDefinition2WiwoPageIn(EOEditingContext editingContext, WiwoNameSpaceDefinition2WiwoPage eo) {
    WiwoNameSpaceDefinition2WiwoPage localInstance = (eo == null) ? null : (WiwoNameSpaceDefinition2WiwoPage)EOUtilities.localInstanceOfObject(editingContext, eo);
    if (localInstance == null && eo != null) {
      throw new IllegalStateException("You attempted to localInstance " + eo + ", which has not yet committed.");
    }
    return localInstance;
  }
}
