Fetch on Dates
Fetch on Dates
- Subject: Fetch on Dates
- From: Nick Burton <email@hidden>
- Date: Sun, 7 Sep 2003 16:31:01 +0100
Just started using WebObjects and Im having problems with dates.
I setup a query using EOModeler named: FetchCurrentProjects
(startDate >= $myCurrentTime)
The External Type for startDate is datetime Internal Type is NSTimestamp
But the fetch qualifier seems to be ignore and I get all dates returned.
Thanks for any hints!
Nick
System- OS X v10.2.6 WebObjects 5.2.1 OpenBase SQL
public class AvailableProjectList extends WOComponent {
/** @TypeInfo ProjectDates */
public NSArray availableProjects;
public ProjectDate projectDateItem;
public NSTimestamp curentTime;
public NSTimestamp myCurentTimeInput;
private Session currentSession;
private EOEditingContext ec;
public EOModelGroup modelGroup;
public EOFetchSpecification fs;
public EOFetchSpecification fsBound;
public NSMutableDictionary dictionary;
public AvailableProjectList(WOContext context) {
super(context);
currentSession = (Session) session();
ec = currentSession.defaultEditingContext();
curentTime = new NSTimestamp();
modelGroup = EOModelGroup.defaultGroup();
fs = modelGroup.fetchSpecificationNamed("FetchCurrentProjects",
"ProjectDate");
dictionary = new NSMutableDictionary();
dictionary.takeValueForKey(curentTime, "myCurrentTime");
fsBound = fs.fetchSpecificationWithQualifierBindings(dictionary);
availableProjects= ec.objectsWithFetchSpecification(fsBound);
System.out.println("Initialized ============ " + this.name() );
System.out.println("dictionary: "+dictionary );
System.out.println("fs: "+fs );
System.out.println("fsBound: "+fsBound );
System.out.println("availableProjects: "+availableProjects );
}
}
output
Initialized ============ AvailableProjectList
dictionary: {myCurrentTime = 2003-09-07 14:37:57 Etc/GMT; }
fs: <class
com.webobjects.eocontrol.EOFetchSpecification(entityName=ProjectDate,
qualifier=(startDate >= $myCurrentTime),
isDeep=true, usesDistinct=false,
sortOrdering=(),
hints=null,
_prefetchingRelationshipKeyPaths = null)>
fsBound: <class
com.webobjects.eocontrol.EOFetchSpecification(entityName=ProjectDate,
qualifier=(startDate >=
(com.webobjects.foundation.NSTimestamp)'2003-09-07 14:37:57 Etc/GMT'),
isDeep=true, usesDistinct=false,
sortOrdering=(),
hints={},
_prefetchingRelationshipKeyPaths = ())>
availableProjects: ({values = {startDate = 2003-08-01 11:00:00
Etc/GMT; projectsubs =
"<com.webobjects.eocontrol._EOCheapCopyMutableArray 97f5f
(<EOAccessArrayFaultHandler projectsubs
_EOIntegralKeyGlobalID[ProjectDate (java.lang.Long)1]>)>"; note =
"First Project"; ........ etc
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.