This content has been marked as final.
Show 8 replies
-
1. Re: how to use QL to have a case insensitive String compare?
aloubyansky Jul 4, 2004 3:24 AM (in response to websel)You can use ucase and lcase in JBossQL. select object(o) from O o where lcase(o.name) = lcase(?1)
-
2. Re: how to use QL to have a case insensitive String compare?
chlabreu Jul 21, 2004 4:13 PM (in response to websel)I have a similar problem in the order clause. JBossQL seems to not support ucase there. Is there a workaround for it?
-
3. Re: how to use QL to have a case insensitive String compare?
aloubyansky Jul 22, 2004 3:08 AM (in response to websel)It seems like there is no...
-
4. Re: how to use QL to have a case insensitive String compare?
websel Aug 16, 2004 8:25 AM (in response to websel)For the XDoclet users here's my 5$
This is the finder in jboss* @jboss.query * query="SELECT OBJECT(o) FROM Person o WHERE LCASE(o.lastName) = LCASE(?1) ORDER BY o.foreName" * signature="java.util.Collection findByInitialsLastNameBirthDate(java.lang.String lastName)"
As was written above the UCASE and LCASE did the trick
Thanks!
Wessel -
5. Re: how to use QL to have a case insensitive String compare?
svadu Aug 24, 2004 6:45 AM (in response to websel)"WebSel" wrote:
For the XDoclet users here's my 5$
This is the finder in jboss* @jboss.query * query="SELECT OBJECT(o) FROM Person o WHERE LCASE(o.lastName) = LCASE(?1) ORDER BY o.foreName" * signature="java.util.Collection findByInitialsLastNameBirthDate(java.lang.String lastName)"
As was written above the UCASE and LCASE did the trick
Thanks!
Wessel
I confirm that this works. For some unknown to me reason UCASE didn't work but LCASE did the trick (jboss 3.2.3)... -
6. Re: how to use QL to have a case insensitive String compare?
camel Aug 25, 2004 3:59 AM (in response to websel)I like the UCASE solutions posted here better, but what I'm doing for MySQL has been working:
I changed the standardjbosscmp-jdbc.xml file, changing the java.lang.String mapping from a "VARCHAR(250) BINARY" to just "VARCHAR(250)", and MySQL does a case-insensitive compare by default I guess. It was a quick and dirty fix, but has been working fine. -
7. Re: how to use QL to have a case insensitive String compare?
svadu Sep 1, 2004 9:53 AM (in response to websel)"svadu" wrote:
"WebSel" wrote:
For the XDoclet users here's my 5$
This is the finder in jboss* @jboss.query * query="SELECT OBJECT(o) FROM Person o WHERE LCASE(o.lastName) = LCASE(?1) ORDER BY o.foreName" * signature="java.util.Collection findByInitialsLastNameBirthDate(java.lang.String lastName)"
As was written above the UCASE and LCASE did the trick
Thanks!
Wessel
I confirm that this works. For some unknown to me reason UCASE didn't work but LCASE did the trick (jboss 3.2.3)...
Unfortunately I found that this works only if the fiild value in the database i s in lowercase (that's why LCASE worked for me). Unfrotunately I am not sure how else to make it working (not sure if changing the mapping is the best solution. Was anyone else successfull in this? -
8. Re: how to use QL to have a case insensitive String compare?
aloubyansky Sep 2, 2004 2:56 AM (in response to websel)How does the SQL look like? Is it correct? If so, it's not a JBoss problem.