Apache JDO Project - [jira] Commented: (JDO-176) JPOX fails when a query calls String.matches

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > October 2005 > [jira] Commented: (JDO-176) JPOX fails when a query calls String.matches





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author [jira] Commented: (JDO-176) JPOX fails when a query calls String.matches
Erik Bengtson (JIRA)

2005-10-24, 8:54 am

[ http://issues.apache.org/jira/brows...action_12332213 ]

Erik Bengtson commented on JDO-176:
-----------------------------------

"*First" is invalid as regular expression.


Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*First
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.matches(Unknown Source)
at java.lang.String.matches(Unknown Source)
at Test.main(Test.java:11)



public class Test
{

/**
* @param args
*/
public static void main(String[] args)
{
System.out.println("kjdsd deoide First".matches("*First"));
System.out.println("kjdsd deoide First".matches(".*First"));
// TODO Auto-generated method stub

}

}

> JPOX fails when a query calls String.matches
> --------------------------------------------
>
> Key: JDO-176
> URL: http://issues.apache.org/jira/browse/JDO-176
> Project: JDO
> Type: Bug
> Components: tck20
> Reporter: Michael Watzek
> Assignee: Erik Bengtson


>
> JPOX fails when a query calls String.matches. This bug may be reproduced applying patch JDO-159. The SQL generation of the following query is incorrect:
> SELECT FROM org.apache.jdo.tck.pc.company.Person WHERE firstname.matches('*First')
> The LIKE clause of the generated SQL statement contains '*First'. This is a bug. It should contain '%First'.


--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com