Re: [Hibernate] session.createQuery ERROR

2005-03-17 Thread Tobias Järlund
I think that you are correct.
I tried this with my patched version of Hibernate (see  HHH-244 or my 
earlier email), and it seemed to work just fine.

To allow for the full Unicode BMP, the charVocabulary line could be 
something like
charVocabulary='\u' .. '\u';
but there might be some reserved characters by ANTLN that should be 
excluded.

/4
Joshua Davis wrote:
The lexer rules for quoted strings look fine, so I think the problem might
be this suspicious looking option on the lexer on line 643 in hql.g:
charVocabulary='\u'..'\u007F'; // allow ascii
I bet if we changed this to allow other characters it would work.  Most of
the ANTLR options were copied from an SQL ANTLR grammar when I first created
the HQL grammar, so it makes sense that some of them might be a little off.
:)
 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On 
Behalf Of Glauber Andrade
Sent: Thursday, March 17, 2005 7:24 AM
To: hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] session.createQuery ERROR

Hibernate throws a QueryException when I use letters like "á, é, ..."
List result = sess.createQuery("FROM  Bem b  WHERE b.plqta ='máx' AND 
b.situo=2 ORDER BY  b.plqta").list();

org.hibernate.QueryException: expecting ''', found 'á' [FROM 
com.maxiti.data.Bem b WHERE b.plqta ='máx' AND b.situo=2 
ORDER BY b.plqta]

WHAT IS WRONG ?
In Hibernate 2.1.7, using session.find, this error does not occur.
Thanks,
Glauber Andrade
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from 
real users. Discover which products truly live up to the 
hype. Start reading now. 
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

   



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
 


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Issues with the antlr parser

2005-03-17 Thread Tobias Järlund
Ok, I opened a Jira issue with some actual information about the 
problem, with the AST trees attached.
http://opensource.atlassian.com/projects/hibernate/browse/HHH-242

I don't have time to create a proper test case at the moment, sorry 
about that.
/Tobias

Gavin King wrote:
What *particular* queries?
Maybe you need to submit a test case to JIRA...
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tobias Järlund
Sent: Thursday, 17 March 2005 4:45 AM
To: hibernate-devel@lists.sourceforge.net
Subject: [Hibernate] Issues with the antlr parser
3. A few of our existing queries are creating invalid sql (inserting an 
extra comma), something like "... from foo as foo1_, inner join ...". Is 
this a known problem? Otherwise I'll try to have a closer look at what's 
causing this.

 


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


RE: [Hibernate] session.createQuery ERROR

2005-03-17 Thread Joshua Davis
The lexer rules for quoted strings look fine, so I think the problem might
be this suspicious looking option on the lexer on line 643 in hql.g:

charVocabulary='\u'..'\u007F'; // allow ascii

I bet if we changed this to allow other characters it would work.  Most of
the ANTLR options were copied from an SQL ANTLR grammar when I first created
the HQL grammar, so it makes sense that some of them might be a little off.
:)

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Glauber Andrade
> Sent: Thursday, March 17, 2005 7:24 AM
> To: hibernate-devel@lists.sourceforge.net
> Subject: [Hibernate] session.createQuery ERROR
> 
> 
> Hibernate throws a QueryException when I use letters like "á, é, ..."
> 
> List result = sess.createQuery("FROM  Bem b  WHERE b.plqta ='máx' AND 
> b.situo=2 ORDER BY  b.plqta").list();
> 
>  org.hibernate.QueryException: expecting ''', found 'á' [FROM 
> com.maxiti.data.Bem b WHERE b.plqta ='máx' AND b.situo=2 
> ORDER BY b.plqta]
> 
> WHAT IS WRONG ?
> 
> In Hibernate 2.1.7, using session.find, this error does not occur.
> 
> Thanks,
> 
> Glauber Andrade
> 
> 
> ---
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from 
> real users. Discover which products truly live up to the 
> hype. Start reading now. 
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> ___
> hibernate-devel mailing list hibernate-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hibernate-devel
> 




---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] session.createQuery ERROR

2005-03-17 Thread Glauber Andrade
Hibernate throws a QueryException when I use letters like "á, é, ..."
List result = sess.createQuery("FROM  Bem b  WHERE b.plqta ='máx' AND 
b.situo=2 ORDER BY  b.plqta").list();

org.hibernate.QueryException: expecting ''', found 'á' [FROM 
com.maxiti.data.Bem b WHERE b.plqta ='máx' AND b.situo=2 ORDER BY b.plqta]

WHAT IS WRONG ?
In Hibernate 2.1.7, using session.find, this error does not occur.
Thanks,
Glauber Andrade
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] antlr class.forname

2005-03-17 Thread Max Rydahl Andersen
For the "fun" of it I have patched and built a antlr-2.7.5H3.jar
which has proper classloading. It seems to work ok with the unit tests  
etc.,

Does anyone have a weblogic install and could try it out ?
you must probably replace their antlr.jar with this jar.
see http://opensource.atlassian.com/projects/hibernate/browse/HHH-218
Thank you
/max
On Wed, 16 Mar 2005 22:28:59 +0100, Max Rydahl Andersen  
<[EMAIL PROTECTED]> wrote:

I've added a section in the migration guide on this issue.
http://hibernate.org/250.html
I don't feel much for hacking hibernate to fix other products
errors.
-max
BEA has a history of users prepending to the classpath.  For example,  
here is
how users are told to configure the latest WebLogic to work with their  
oldest
sqlserver driver
(http://e-docs.bea.com/wls/docs81/mssqlserver4/install_jmsq4.html#413811):

Microsoft SQL Server is bundled with your WebLogic Server distribution.
For Version 7.0 and 2000, the weblogic.jar file includes the Micrososft
SQL Server classes. No further steps are required. However, if you are
using Version 6.5, you must pre-pend the mssqlserver4v65.jar file in  
the
classpath as follows:

set CLASSPATH=%WL_HOME%\server\lib\mssqlserver4v65.JAR;
%WL_HOME%\server\lib\weblogic.jar;%CLASSPATH%
In the past I've seen external needs that required such a prepend to  
get around
BEA's webservices.jar.  I think BEA is stuck supporting people  
prepending to the
classpath.

However there is a major issue for Windows environments.  Because of  
limits on
the length of registry keys, the CLASSPATH argument needs to be kept  
short in
order to run WebLogic as an NT Service.
As a result many shared production environments don't let individual
applications touch the startup classpath.  I would think it would be  
best if we
could find a way to make the fix look like a patch rather than an  
application
library, as this would yield less resistance in complicated deployment
environments.

_evan

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



--
--
Max Rydahl Andersen
callto://max.rydahl.andersen
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Re: [Hibernate] Issues with the antlr parser

2005-03-17 Thread Christian Bauer
Tobias Järlund wrote:
2. From what I can tell the older syntax (from foo in class bar.Foo) is 
not supported. If this is by design, I think it would be a good idea to 
mention this in the upgrade notes, and update the documentation (it is 
still used in at least two places).
Done
--
Christian Bauer
callto://christian-bauer
Hibernate
[EMAIL PROTECTED]
http://hibernate.org
JBoss Inc
[EMAIL PROTECTED]
http://jboss.com
---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
___
hibernate-devel mailing list
hibernate-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


[Hibernate] Issues with the antlr parser

2005-03-17 Thread Tobias Järlund
Hello!
I'm having a few issues with the new antlr parser.
1. In the grammar, IDENT is restricted to ( 'a' .. 'z' | '_' ) ( 'a' .. 
'z' | '0' .. '9' | '_' | '$' )*, which I believe is too limited. Since 
we are dealing with Java, this should be expanded to the full range of 
valid Java identifiers. Se attached patch for a closer look at what I mean.

2. From what I can tell the older syntax (from foo in class bar.Foo) is 
not supported. If this is by design, I think it would be a good idea to 
mention this in the upgrade notes, and update the documentation (it is 
still used in at least two places).

3. A few of our existing queries are creating invalid sql (inserting an 
extra comma), something like "... from foo as foo1_, inner join ...". Is 
this a known problem? Otherwise I'll try to have a closer look at what's 
causing this.

All of the above works great with the classic parser.
/4
Index: grammar/hql.g
===
RCS file: /cvsroot/hibernate/Hibernate3/grammar/hql.g,v
retrieving revision 1.51
diff -u -r1.51 hql.g
--- grammar/hql.g   2 Mar 2005 16:57:17 -   1.51
+++ grammar/hql.g   17 Mar 2005 08:54:09 -
@@ -680,7 +680,18 @@
 
 IDENT options { testLiterals=true; }
:
-   ( 'a' .. 'z' | '_' ) ( 'a' .. 'z' | '0' .. '9' | '_' | '$' )*
+   ('\u0024' | '\u005f' | 
+   '\u0061' .. '\u007a' | '\u00c0' .. '\u00d6' | 
+   '\u00d8' .. '\u00f6' | '\u00f8' .. '\u00ff' | 
+   '\u0100' .. '\u1fff' | '\u3040' .. '\u318f' | 
+   '\u3300' .. '\u337f' | '\u3400' .. '\u3d2d' | 
+   '\u4e00' .. '\u9fff' | '\uf900' .. '\ufaff')
+   ('\u0024' | '\u0030' .. '\u0039' | '\u005f' | 
+   '\u0061' .. '\u007a' | '\u00c0' .. '\u00d6' | 
+   '\u00d8' .. '\u00f6' | '\u00f8' .. '\u00ff' | 
+   '\u0100' .. '\u1fff' | '\u3040' .. '\u318f' | 
+   '\u3300' .. '\u337f' | '\u3400' .. '\u3d2d' | 
+   '\u4e00' .. '\u9fff' | '\uf900' .. '\ufaff')*
// Setting this flag allows the grammar to use keywords as 
identifiers, if necessary.
{
setPossibleID(true);