These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: *** ERROR: <AST>:0:0: unexpected AST node
PostPosted: Thu Oct 06, 2005 2:48 pm 
Beginner
Beginner

Joined: Tue Nov 02, 2004 1:34 pm
Posts: 45
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.05

I'm getting: *** ERROR: <AST>:0:0: unexpected AST node

I'm writing my own sql as I'm using the Oracle Text to search xml documents.


Code:
SELECT distinct new com.sbc.netrics.struts.database.NddMetric( NddMetric.metricId, NddMetric.metricNumber,NddMetric.metricName,NddMetric.metricDescription,NddMetric.dataSteward)  FROM  com.sbc.netrics.struts.database.NddMetric NddMetric  WHERE CONTAINS(xml_doc, 'searchText);


I'm assuming it's similar to my last problem in that I'm using "contains" which is not an ansi standard sql statement.

I get the following error messages:

Code:
ERROR - [ErrorCounter.reportError] *** ERROR: <AST>:0:0: unexpected AST node: (
ERROR - [MetricCRUDAction.prepareBrowse] metricList failed: org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: ( [SELECT distinct new com.sbc.netrics.struts.database.NddMetric( NddMetric.metricId, NddMetric.metricNumber,NddMetric.metricName,NddMetric.metricDescription,NddMetric.dataSteward)  FROM  com.sbc.netrics.struts.database.NddMetric NddMetric  WHERE CONTAINS(xml_doc, 'shobha')  order by metric_name ASC]


Is there a way I can just sent straight jdbc query and bypass hibernate's parsing? Yes...I can by doing a straight jdbc code and not using hibernate at all -- I know. Is there another way to attack this problem?

Lee


Top
 Profile  
 
 Post subject: Re: *** ERROR: <AST>:0:0: unexpected AST node
PostPosted: Thu Oct 06, 2005 3:32 pm 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
leebase wrote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.05

I'm getting: *** ERROR: <AST>:0:0: unexpected AST node

I'm writing my own sql as I'm using the Oracle Text to search xml documents.


Code:
SELECT distinct new com.sbc.netrics.struts.database.NddMetric( NddMetric.metricId, NddMetric.metricNumber,NddMetric.metricName,NddMetric.metricDescription,NddMetric.dataSteward)  FROM  com.sbc.netrics.struts.database.NddMetric NddMetric  WHERE CONTAINS(xml_doc, 'searchText);


I'm assuming it's similar to my last problem in that I'm using "contains" which is not an ansi standard sql statement.

I get the following error messages:

Code:
ERROR - [ErrorCounter.reportError] *** ERROR: <AST>:0:0: unexpected AST node: (
ERROR - [MetricCRUDAction.prepareBrowse] metricList failed: org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: ( [SELECT distinct new com.sbc.netrics.struts.database.NddMetric( NddMetric.metricId, NddMetric.metricNumber,NddMetric.metricName,NddMetric.metricDescription,NddMetric.dataSteward)  FROM  com.sbc.netrics.struts.database.NddMetric NddMetric  WHERE CONTAINS(xml_doc, 'shobha')  order by metric_name ASC]


Is there a way I can just sent straight jdbc query and bypass hibernate's parsing? Yes...I can by doing a straight jdbc code and not using hibernate at all -- I know. Is there another way to attack this problem?

Lee


Try sesssion.createSQLQuery("sql-query-goes-here").

_________________
Preston

Please don't forget to give credit if/when you get helpful information.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 06, 2005 4:22 pm 
Beginner
Beginner

Joined: Tue Nov 02, 2004 1:34 pm
Posts: 45
That helped. I had already coded a staight JDBC method to handle this situation....which certainly reminded me why it's so nice to work with hibernate.

I ran into other issues with the SqlQuery...but will use my straight jdbc method for now...I may revisit this later.

Thanks again,

Lee


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.