// $LastChangedRevision: 4748 $ DO NOT EDIT.  Make changes to WiwoNameSpace2WiwoUser.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 _WiwoNameSpace2WiwoUser extends  EOGenericRecord {
	public static final String ENTITY_NAME = "WiwoNameSpace2WiwoUser";

	// Attributes

	// Relationships

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


  public static WiwoNameSpace2WiwoUser createWiwoNameSpace2WiwoUser(EOEditingContext editingContext) {
    WiwoNameSpace2WiwoUser eo = (WiwoNameSpace2WiwoUser) EOUtilities.createAndInsertInstance(editingContext, _WiwoNameSpace2WiwoUser.ENTITY_NAME);    
    return eo;
  }

  public static NSArray fetchAllWiwoNameSpace2WiwoUsers(EOEditingContext editingContext) {
    return _WiwoNameSpace2WiwoUser.fetchAllWiwoNameSpace2WiwoUsers(editingContext, null);
  }

  public static NSArray fetchAllWiwoNameSpace2WiwoUsers(EOEditingContext editingContext, NSArray sortOrderings) {
    return _WiwoNameSpace2WiwoUser.fetchWiwoNameSpace2WiwoUsers(editingContext, null, sortOrderings);
  }

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

  public static WiwoNameSpace2WiwoUser fetchWiwoNameSpace2WiwoUser(EOEditingContext editingContext, String keyName, Object value) {
    return _WiwoNameSpace2WiwoUser.fetchWiwoNameSpace2WiwoUser(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

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

  public static WiwoNameSpace2WiwoUser fetchRequiredWiwoNameSpace2WiwoUser(EOEditingContext editingContext, String keyName, Object value) {
    return _WiwoNameSpace2WiwoUser.fetchRequiredWiwoNameSpace2WiwoUser(editingContext, new EOKeyValueQualifier(keyName, EOQualifier.QualifierOperatorEqual, value));
  }

  public static WiwoNameSpace2WiwoUser fetchRequiredWiwoNameSpace2WiwoUser(EOEditingContext editingContext, EOQualifier qualifier) {
    WiwoNameSpace2WiwoUser eoObject = _WiwoNameSpace2WiwoUser.fetchWiwoNameSpace2WiwoUser(editingContext, qualifier);
    if (eoObject == null) {
      throw new NoSuchElementException("There was no WiwoNameSpace2WiwoUser that matched the qualifier '" + qualifier + "'.");
    }
    return eoObject;
  }

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