In OQL Queries strings must be escaped: String id = "\"7f653507-0a28-0c51-0153-e0c0206f7a20\"";
Thomas > -----Original Message----- > From: Robert J Celestino [mailto:[EMAIL PROTECTED] > Sent: Monday, October 27, 2003 10:20 PM > To: OJB Users List > Subject: Custom SequenceManager > > > Hello, > > I am new to OJB and in the process of evaluating it for use > on our project. So far I am very impressed and looking > forward to using it in production. > > To that end, I have written my own sequence manager. It > appears to work (records are created correctly with GUIDs > correctly generated). > > But the Guids that we generate have imbedded dashes and that > seems to cause the queries a problem. A very simple example: > > String id = "7f653507-0a28-0c51-0153-e0c0206f7a20" ; > oqlQuery = "select p from " + Person.class.getName() + " > where Id = " + id ; > OQLQuery query = _omdg.newOQLQuery(); > query.create( oqlQuery ) ; <-- throws exception here : > > org.odmg.QueryInvalidException: expecting '>', found '0' > at org.apache.ojb.odmg.oql.OQLQueryImpl.create(Unknown Source) > at org.apache.ojb.odmg.oql.OQLQueryImpl.create(Unknown Source) > . > . > . > > Should I escape the string in some fashion? Escape the > dashes? Does "-" signify something in particular? > > Any help greatly appreciated! > > Thanks, > Bob c > ---------------------------------------------------------------- > Bob Celestino > SAS Research and Development > 919 - 531 - 9425 > [EMAIL PROTECTED] > > SAS - The Power to Know > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]