(dirty solved): NSDates, NSTimestamps and the Java-bridge
Ricardo Strausz <[email protected]> Wed, 14 May 2003 14:49:09 -0500
| Newsgroups | gmane.comp.web.webobjects.eof |
|---|---|
| Message-ID | <[email protected]> |
Gracias Joaquin!
Thanks Art, Seejo, Dirk!
I'd found a solution... dirty but it works.
Basically I have to assgin the qualifier in the Java side.
I hope Apple is doing something to get better Cocoa/EO... and the
Java-Bridge!
Here is the code:
- (NSArray*)facturasDe:(id)eo desde:(NSCalendarDate*)desde
{
[desde setCalendarFormat:@"%d %m %Y"];
id nst = [Util nst:[desde description]]; //this is an NSTimestamp
created by Util.java
[Util setAuxiliaryQualifierTo:[dgFacturas dataSource]:eo:nst];
[dgFacturas fetch:self];
return [dgFacturas displayedObjects];
}
public NSTimestamp nst(String dateString){
NSTimestampFormatter formatter=new NSTimestampFormatter("%d %m
%Y");
ParsePosition pp = new ParsePosition(0);
NSTimestamp
myNSTimestamp=(NSTimestamp)formatter.parseObject(dateString,pp);
return myNSTimestamp;
}
public void setAuxiliaryQualifierTo(EODatabaseDataSource ds,
Facturas eo, NSTimestamp nst){
NSMutableArray nsma = new NSMutableArray();
nsma.addObject(eo.folio());
nsma.addObject(nst);
EOQualifier eoq =
EOQualifier.qualifierWithQualifierFormat("cliente=%@ and fecha>=%@ and
estado>0",nsma);
ds.setAuxiliaryQualifier(eoq);
}
Dino
http://homepage.mac.com/strausz