Hi Clovis,


Cl�vis Wichoski wrote:
Hi,

I'm using PersistenceBroker and need use OQL only for selecting objects, then I will use OQLQueryImpl, only to make the Query object for me, but I have two issues in doubt:

1) Executing query with broker
...
OQLQueryImpl oql = new OQLQueryImpl(broker.getPBKey());
oql.create(sbOQL.toString());
Collection results = broker.getCollectionByQuery(oql.getQuery());
...

2) Executing query with OQLQueryImpl
...
OQLQueryImpl oql = new OQLQueryImpl(broker.getPBKey());
oql.create(sbOQL.toString());
ManageableCollection results = oql.execute();
...

Then the doubts are:

What is better approach issue 1, issue 2 or exists a better way?

1 is faster, as 2 involves creating a dummy ODMG transaction and registering all result object to that transaction.
I see no better way to do this.

Since I will use the PB for me the best is issue 1, but for future compatibility don't be better to have a class QueryByOQL like QueryBySQL or QueryByCriteria?

I guess you are the first one to use oql queries with the PB API. So I guess noone had the idea to write a "QueryByOql" class yet.
But, yes, it could be a nice wrapper to your 1) approach.



Is correct instancing OQLQueryImpl programmatically?

I see no problems,

cheers,
Thomas


TIA

Cl�vis








--------------------------------------------------------------------- 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