EOEntity entity = EOUtilities.entityNamed(ec, entityName()); EOQualifier qual = entity.qualifierForPrimaryKey(primaryKeyDictionary(false)); EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName(), qual, null); fetchSpec.setRefreshesRefetchedObjects(true); NSArray results = ec.objectsWithFetchSpecification(fetchSpec); ERXGenericRecord freshObject = null; if(results.count()>0){ freshObject = (ERXGenericRecord)results.objectAtIndex(0); } return freshObject; }
EOEntity entity = ERXEOAccessUtilities.entityNamed(ec, entityName()); EOQualifier qual = entity.qualifierForPrimaryKey(primaryKeyDictionary(false)); EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName(), qual, null); fetchSpec.setRefreshesRefetchedObjects(true); NSArray results = ec.objectsWithFetchSpecification(fetchSpec); ERXGenericRecord freshObject = null; if(results.count()>0){ freshObject = (ERXGenericRecord)results.objectAtIndex(0); } return freshObject; }
	 public ERXGenericRecord refetchObjectFromDBinEditingContext(EOEditingContext ec){		 EOEntity entity = EOUtilities.entityNamed(ec, entityName());		 EOQualifier qual = entity.qualifierForPrimaryKey(primaryKeyDictionary(false));		 EOFetchSpecification fetchSpec = new EOFetchSpecification(entityName(), qual, null);		 fetchSpec.setRefreshesRefetchedObjects(true);		 NSArray results = ec.objectsWithFetchSpecification(fetchSpec);		 ERXGenericRecord freshObject = null;		 if(results.count()>0){			 freshObject = (ERXGenericRecord)results.objectAtIndex(0);		 }		 return freshObject;	 }