NSDates, NSTimestamps and the Java-bridge

Ricardo Strausz <[email protected]> Mon, 12 May 2003 21:52:54 -0500
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hola tod@s!

I hope some one can help me with this one:

I nead to build a qualifier which bounds some dates... I am writing 
almost everything in ObjC (doing Cocoa/EO) but some objects 
initializers (like NSTimestamp) don't jump the bridge, so I have also a 
Util.java object in charge of those pins...

the code is:

- (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
     NSString* nss = [NSString stringWithFormat:@"fecha>='%@'",[nst 
toString]];

     id eoq = [EOQualifier qualifierWithQualifierFormat:nss:nil];

     [[dgFacturas dataSource] setAuxiliaryQualifier:eoq];
     [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;
     }


and the error is:

  ** Error JDBCColumn for setting date type for 2003-04-12 05:00:00 
Etc/GMT- class = class java.lang.String.



Dino
http://homepage.mac.com/strausz