[ http://issues.apache.org/jira/browse/OJB-9?page=comments#action_12313094 
] 

Jakob Braeuchi commented on OJB-9:
----------------------------------

OJB 1.1 uses an other way to resolve an attribute, thus multi-attribute 
expressions like 'count(distinct mandant || ID)'  are supposed to work.

> Missing table qualifier in count sql preceding distinct QueryByCriteria
> -----------------------------------------------------------------------
>
>          Key: OJB-9
>          URL: http://issues.apache.org/jira/browse/OJB-9
>      Project: OJB
>         Type: Bug
>   Components: PB-API
>     Versions: 1.0.x CVS
>  Environment: SAPDB 7.5
> Win XP
> OJB 1.0.1
>     Reporter: S. Schlösser

>
> Hi,
> When doing an sql with with distinct=true such as:
> Query:QueryByCriteria from class 
> de.intermediate.components.generated.projekt.ProjektValue  where 
> [fk_hauptProjekt < 1, [subProjekte.workorders.fk_statusList <> 105], mandant 
> = 001, deleted = false]
> org.apache.ojb.broker.PersistenceBrokerSQLException: 
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5014] (at 23): Missing 
> definite column name:MANDANT
> com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5014] (at 23): Missing 
> definite column name:MANDANT
> [-5014] (at 23): Missing definite column name:MANDANT
> OJB does the following count SQL statement:
> SELECT count(distinct mandant || ID) FROM projekt A0,projekt A1,workorder A2 
> WHERE A1.mandant=A2.mandant(+) AND A1.ID=A2.fk_projekt(+) AND 
> A0.mandant=A1.mandant(+) AND A0.ID=A1.fk_hauptProjekt(+) AND (((( 
> A0.fk_hauptProjekt < ?) AND  (A2.fk_statuslist <> ?)) AND A0.mandant = ?) AND 
> A0.DELETED = ?)
> This obviously fails since the usual A?.* table specifier is missing from the 
> select clause.
> I post this as a bug since it is OJB which issues the offending count 
> statement. What I am trying to do is to retrieve all projects which have 
> subprojects which have workorders with a certain status. Since each project 
> may have mutliple subprojects and workorders I issue the distinct to retrieve 
> each project at most once.
> Yours
>   S.Schlösser

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to