Beispiel #1
0
 public static Group fetchGroup(EOEditingContext editingContext, EOQualifier qualifier) {
   NSArray<Group> eoObjects = _Group.fetchGroups(editingContext, qualifier, null);
   Group eoObject;
   int count = eoObjects.count();
   if (count == 0) {
     eoObject = null;
   } else if (count == 1) {
     eoObject = (Group) eoObjects.objectAtIndex(0);
   } else {
     throw new IllegalStateException(
         "There was more than one Group that matched the qualifier '" + qualifier + "'.");
   }
   return eoObject;
 }
Beispiel #2
0
 public static Employee fetchEmployee(EOEditingContext editingContext, EOQualifier qualifier) {
   NSArray<Employee> eoObjects = _Employee.fetchEmployees(editingContext, qualifier, null);
   Employee eoObject;
   int count = eoObjects.count();
   if (count == 0) {
     eoObject = null;
   } else if (count == 1) {
     eoObject = (Employee) eoObjects.objectAtIndex(0);
   } else {
     throw new IllegalStateException(
         "There was more than one Employee that matched the qualifier '" + qualifier + "'.");
   }
   return eoObject;
 }
Beispiel #3
0
 public static Category fetchCategory(EOEditingContext editingContext, EOQualifier qualifier) {
   NSArray<Category> eoObjects = _Category.fetchCategories(editingContext, qualifier, null);
   Category eoObject;
   int count = eoObjects.count();
   if (count == 0) {
     eoObject = null;
   } else if (count == 1) {
     eoObject = (Category) eoObjects.objectAtIndex(0);
   } else {
     throw new IllegalStateException(
         "There was more than one Category that matched the qualifier '" + qualifier + "'.");
   }
   return eoObject;
 }
 public static MovieRole fetchMovieRole(EOEditingContext editingContext, EOQualifier qualifier) {
   NSArray<MovieRole> eoObjects = _MovieRole.fetchMovieRoles(editingContext, qualifier, null);
   MovieRole eoObject;
   int count = eoObjects.count();
   if (count == 0) {
     eoObject = null;
   } else if (count == 1) {
     eoObject = (MovieRole) eoObjects.objectAtIndex(0);
   } else {
     throw new IllegalStateException(
         "There was more than one MovieRole that matched the qualifier '" + qualifier + "'.");
   }
   return eoObject;
 }
 public static PDBPresentation fetchPDBPresentation(
     EOEditingContext editingContext, EOQualifier qualifier) {
   NSArray<PDBPresentation> eoObjects =
       _PDBPresentation.fetchPDBPresentations(editingContext, qualifier, null);
   PDBPresentation eoObject;
   int count = eoObjects.count();
   if (count == 0) {
     eoObject = null;
   } else if (count == 1) {
     eoObject = eoObjects.objectAtIndex(0);
   } else {
     throw new IllegalStateException(
         "There was more than one PDBPresentation that matched the qualifier '"
             + qualifier
             + "'.");
   }
   return eoObject;
 }