[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Problem while using Inner Query

amit.patel do-not-reply at jboss.com
Thu Aug 24 07:04:23 EDT 2006


Hi All,

[CDATA[SELECT OBJECT(obj) FROM UpdateWebMessageText obj WHERE obj.messageType = ?1 and    obj.effectiveStartDate = (SELECT min(obj1.effectiveStartDate) FROM UpdateWebMessageText obj1 
	  					   	  WHERE obj1.messageType = ?1 and obj1.effectiveStartDate > ?2 )]].

While using above query, jboss is giving follwing error

Problem starting service jboss.j2ee:jndiName=ejb/bean/WebMessageTextEJB,service=EJB
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'Select OBJECT(obj) FROM UpdateWebMessageText obj WHERE obj.messa
geType = ?1 and    obj.effectiveStartDate = (SELECT max(obj1.effectiveStartDate) FROM UpdateWebMessageText obj1
                                                          WHERE obj1.messageType = ?1 and obj1.effectiveStartDate < ?2 )'; - nested throwabl
e: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "(" at line 1, column 109.
Was expecting one of:
    <DATETIME_VALUED_PARAMETER> ...
    <DATETIME_VALUED_PATH> ...
    ).

It seems from the message that jboss expects date value(in query, i have made that portion red) but it found '(' there. 

Actually after '(' is a query which returns date, but jboss doesn't allows to write inner queries. 

Please provide me help how to solve  this.

Thanks in Advance,
Amit.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967198#3967198

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967198



More information about the jboss-user mailing list