hi mauricio,

well, imo it would be better to solve it in PersistenceBrokerImpl#getRsIteratorFromQuery where a query is executed for each extent.
only if the extents sit in the same table ojbconcreteclass is required.
i'm not sure wether a rowreader could solve the problem, it may be too late because the query fails.


hth
jakob

Mauricio CASTRO wrote:

Jakob, thank you a lot for your response. I will try to fix it writing my
own RowReader. Do you think that's a correct solution?



Thank you, Mauricio Castro.


"Until they become conscious they will never rebel, and until after they
have rebelled they cannot become conscious"
--Orwell 1984
----- Original Message ----- From: "Jakob Braeuchi" <[EMAIL PROTECTED]>
To: "OJB Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 3:29 PM
Subject: Re: possible bug for OQLQuery's and ojbconcreteclass





hi mauricio,

this is a problem in the current implementation. ojb adds the attribute
ojbconcreteclass to the query when _building_ the query not
when executing it.

jakob

Mauricio CASTRO wrote:



Hi,

There is a problem when I try to use an OQLQuery that mixes tables that


have


the column ojbConcreteClass and tables that don't have it.

If I extends different classes from resources and only to classes are


stored


in the same table and there is another class that is stored in his own


table


I get the error (Attribute "ojbconcreteclass" not found).

The query might be:

query.create("select all from "+Resource.getName());

If you do a Query with a class that involves classes on the same table


there


is no problem.

If you do a Query with a class that involves classes that are stored each


on


his own table there is no problem.

How can I overcome that? Is it really a bug? I am missing something?

Thank you.
Mauricio CASTRO.


[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Adding


RsIterator


of class [interface lms.common.LearningUnit] to ChainingIterator

[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Creating
ChainingIterator for class [lms.common.LearningUnit]

[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Adding


RsIterator


of class [class lms.common.LearningUnitImplementation] to


ChainingIterator


[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Creating
RsIterator for class [lms.common.LearningUnitImplementation]

[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Adding


RsIterator


of class [interface workflow.common.Workspace] to ChainingIterator

[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Creating
ChainingIterator for class [workflow.common.Workspace]

[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Adding


RsIterator


of class [class workflow.common.WorkspaceImplementation] to


ChainingIterator


[org.apache.ojb.broker.core.PersistenceBrokerImpl] DEBUG: Creating
RsIterator for class [workflow.common.WorkspaceImplementation]

java.sql.SQLException: ERROR: Attribute "ojbconcreteclass" not found


at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)


at


org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connectio


n


.java:505)

at


org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.


j


ava:320)

[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: SQLException
during the execution of the query (for a
workflow.common.WorkspaceImplementation): ERROR:  Attribute
"ojbconcreteclass" not found


ERROR: Attribute "ojbconcreteclass" not found



at


org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.


j


ava:48)

at


org.postgresql.jdbc1.AbstractJdbc1Statement.executeQuery(AbstractJdbc1State


m


ent.java:153)

at org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown
Source)

at org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown Source)

at
org.apache.ojb.broker.core.RsIteratorFactoryImpl.createRsIterator(Unknown
Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unk


n


own Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unk


n


own Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unk


n


own Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getRsIteratorFromQuery(Unk


n


own Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getIteratorFromQuery(Unkno


w


n Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unkno


w


n Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unkno


w


n Source)

at


org.apache.ojb.broker.core.PersistenceBrokerImpl.getCollectionByQuery(Unkno


w


n Source)

at


org.apache.ojb.broker.core.DelegatingPersistenceBroker.getCollectionByQuery


(


Unknown Source)

at org.apache.ojb.odmg.oql.OQLQueryImpl.execute(Unknown Source)

at workflow.manager.WorkflowManager.printAll(WorkflowManager.java:270)

at workflow.manager.WorkflowManager.main(WorkflowManager.java:354)

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






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





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






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



Reply via email to