Re: Searching for non-empty toMany relationships...
Re: Searching for non-empty toMany relationships...
- Subject: Re: Searching for non-empty toMany relationships...
- From: Louis Demers <email@hidden>
- Date: Tue, 23 Jul 2013 23:44:57 -0400
Hi,
On 2013-07-17, at 14:42 , Chuck Hill <email@hidden> wrote:
> Hi Louis,
>
> On 2013-07-17, at 11:22 AM, Louis Demers wrote:
>
>> Hi,
>>
>> I'm trying to create an EOQualifer to filter and array where I have only the EOs that have a toMany relationship not empty. I tried many things, including a thread "qualifier to check for empty toMany" of May 11, 2011 without success.
>
> I think maybe you want the ERXExistsQualifier. I don't think there is an ERQ short-hand for that one.
Following your advice, I tried but it requires an EOQualifier that it applies to the EO's of the relationships, not the principal EO. I tired passing null or all kind of stuff, but it failed at run-time. Nonetheless, I looked at the code and spied on the sql generated to get inspiration to craft some SQL (by the monkey method) that I now use in raw row fetches....
Thanks for the tip.
PS: the "monkey method" states that if you have enough monkeys, enough typewriters and enough times, one of them will eventually type a page from Shakespeare's work.
>
> Chuck
>
>> My code was
>>
>> ERXQ.isNotNull(Transaction.COMPONENT_TRANSACTIONS_KEY + "." + Transaction.PK_KEY)
>>
>> I then tried what I thought was the most promising ERXQ.hasAtLeast
>>
>> ERXQ.hasAtLeast(Transaction.COMPONENT_TRANSACTIONS_KEY, null, 1)
>>
>> componentTransactions being my modelled toMany relationship. The doc says that the array can be null.
>>
>>
>>
>> but I get the following exception at run-time which surprised me a bit. I run latest Wonder (integration) and PostgreSQL as my database. Inspecting the code seems to poin to having a badly defined joins which brings me in my ignorance zone about inner/outer/upper/sideway joins....
>> Pointers to a tutorial on those would be appreciated.
>>
>>
>> Even a solution based upon straight SQL would make me happy 8-).
>>
>>
>> Application: Alexandria
>> Error: java.lang.RuntimeException: not implemented!!
>> Reason: not implemented!!
>> Stack trace:
>> File Line# Method Package
>> ERXToManyQualifier.java 234 sqlStringForSQLExpression er.extensions.eof.qualifiers
>> EOQualifierSQLGeneration.java 165 _sqlStringForSQLExpression com.webobjects.eoaccess
>> EOSQLExpression.java 1528 sqlStringForArrayOfQualifiers com.webobjects.eoaccess
>> EOSQLExpression.java 1560 sqlStringForConjoinedQualifiers com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 541 sqlStringForSQLExpression com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 165 _sqlStringForSQLExpression com.webobjects.eoaccess
>> EOSQLExpression.java 1528 sqlStringForArrayOfQualifiers com.webobjects.eoaccess
>> EOSQLExpression.java 1574 sqlStringForDisjoinedQualifiers com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 578 sqlStringForSQLExpression com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 165 _sqlStringForSQLExpression com.webobjects.eoaccess
>> EOSQLExpression.java 1528 sqlStringForArrayOfQualifiers com.webobjects.eoaccess
>> EOSQLExpression.java 1560 sqlStringForConjoinedQualifiers com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 541 sqlStringForSQLExpression com.webobjects.eoaccess
>> EOQualifierSQLGeneration.java 165 _sqlStringForSQLExpression com.webobjects.eoaccess
>> EOSQLExpression.java 997 prepareSelectExpressionWithAttributes com.webobjects.eoaccess
>> JDBCExpression.java 146 prepareSelectExpressionWithAttributes com.webobjects.jdbcadaptor
>> PostgresqlExpression.java 770 prepareSelectExpressionWithAttributes com.webobjects.jdbcadaptor
>> EOSQLExpressionFactory.java 225 selectStatementForAttributes com.webobjects.eoaccess
>> JDBCChannel.java 213 selectAttributes com.webobjects.jdbcadaptor
>> EODatabaseChannel.java 897 _selectWithFetchSpecificationEditingContext com.webobjects.eoaccess
>> EODatabaseChannel.java 234 selectObjectsWithFetchSpecification com.webobjects.eoaccess
>> EODatabaseContext.java 3055 _objectsWithFetchSpecificationEditingContext com.webobjects.eoaccess
>> EODatabaseContext.java 3195 objectsWithFetchSpecification com.webobjects.eoaccess
>> EOObjectStoreCoordinator.java 488 objectsWithFetchSpecification com.webobjects.eocontrol
>> EOEditingContext.java 4069 objectsWithFetchSpecification com.webobjects.eocontrol
>> ERXEC.java 1308 objectsWithFetchSpecification er.extensions.eof
>> EOEditingContext.java 4444 objectsWithFetchSpecification com.webobjects.eocontrol
>> _Transaction.java 604 fetchTransactions com.obzerv.eo
>> Transaction.java 112 wipTransactions com.obzerv.eo
>> PeriodFinancialReportTask.java 91 call com.obzerv.task
>> PeriodFinancialReportTask.java 1 call com.obzerv.task
>> FutureTask.java 303 innerRun java.util.concurrent
>> FutureTask.java 138 run java.util.concurrent
>> ThreadPoolExecutor.java 895 runTask java.util.concurrent
>> ThreadPoolExecutor.java 918 run java.util.concurrent
>> Thread.java 680 run java.lang
>> NA : Non applicable, JIT activated
>>
>>
>>
>>
>> Louis Demers eng.
>> www.obzerv.com
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> --
> Chuck Hill
> Executive Managing Partner, VP Development and Technical Services
>
> Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
> http://www.global-village.net/gvc/practical_webobjects
>
> Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest Growing Companies in B.C!
>
> Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>
>
>
>
>
>
>
>
>
>
>
>
Louis Demers eng.
www.obzerv.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden