Re: ERXBatchingDisplayGroup - qualifier variable '$acctId' is unbound
Re: ERXBatchingDisplayGroup - qualifier variable '$acctId' is unbound
- Subject: Re: ERXBatchingDisplayGroup - qualifier variable '$acctId' is unbound
- From: Baiss Eric Magnusson <email@hidden>
- Date: Mon, 22 Mar 2010 12:50:23 -0700
> And we don't either unless you show us what you are doing.
> Chuck
I'll try.
>
********************WOComponent Constructor *******************
public ERXDisplayGroup<Transaction> curTrans;
public CurrentSit(WOContext context) {
super(context);
curTrans.queryBindings().setObjectForKey( session.userId(), "acctId");
NSTimestamp startMonth = new NSTimestamp( start.getTime() );
curTrans.queryBindings().setObjectForKey( startMonth, "startMonth" ); // 1st day of month
start.add( GregorianCalendar.MONTH, 1 );
curTrans.queryBindings().setObjectForKey( new NSTimestamp( start.getTime()), "endMonth" ); // 1st day of next month
try {
curTrans.qualifyDataSource(); // throws
********************Display Group *******************
variables = {
curTrans = {
class = ERXBatchingDisplayGroup;
dataSource = {
class = EODatabaseDataSource;
editingContext = "session.defaultEditingContext";
fetchSpecification = {
class = EOFetchSpecification;
entityName = Transaction;
fetchLimit = 0;
isDeep = YES;
qualifier = {
class = EOAndQualifier;
qualifiers = (
{
class = EOKeyValueQualifier;
key = acctId;
selectorName = "isEqualTo:";
value = {"_key" = acctId; class = EOQualifierVariable; };
},
{
class = EOKeyValueQualifier;
key = date;
selectorName = "isGreaterThanOrEqualTo:";
value = {"_key" = startMonth; class = EOQualifierVariable; };
},
{
class = EOKeyValueQualifier;
key = date;
selectorName = "isLessThan:";
value = {"_key" = endMonth; class = EOQualifierVariable; };
}
);
};
sortOrderings = ({class = EOSortOrdering; key = date; selectorName = "compareDescending:"; });
};
fetchSpecificationName = matchLoginAndDate;
};
fetchesOnLoad = NO;
formatForLikeQualifier = "%@*";
numberOfObjectsPerBatch = 99;
selectsFirstObjectAfterFetch = NO;
sortOrdering = ({class = EOSortOrdering; key = date; selectorName = "compareDescending:"; });
};
};
********************Fetch spec *******************
acctId = $acctId and date >= $startMonth and date < $endMonth
>> Caused by: com.webobjects.foundation.NSForwardException [java.lang.IllegalStateException] sqlStringForKeyValueQualifier:
>> attempt to generate SQL for com.webobjects.eocontrol.EOKeyValueQualifier (acctId = $acctId) failed because the qualifier variable '$acctId' is unbound.
>>
>> at com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression.sqlStringForKeyValueQualifier(FrontbasePlugIn.java:1351)
>> ...
>> at com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463)
>> at er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.sqlStringForSQLExpression(ERXExtensions.java:312)
>> at com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165)
>> at com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAttributes(EOSQLExpression.java:997)
>> at com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithAttributes(JDBCExpression.java:146)
>> at com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttributes(EOSQLExpressionFactory.java:225)
>> at er.extensions.jdbc.ERXSQLHelper.sqlExpressionForFetchSpecification(ERXSQLHelper.java:635)
>> at er.extensions.jdbc.ERXSQLHelper.sqlExpressionForFetchSpecification(ERXSQLHelper.java:569)
>> at er.extensions.jdbc.ERXSQLHelper.rowCountForFetchSpecification(ERXSQLHelper.java:1110)
>> at er.extensions.eof.ERXEOAccessUtilities.rowCountForFetchSpecification(ERXEOAccessUtilities.java:428)
>> at er.extensions.batching.ERXBatchingDisplayGroup.rowCount(ERXBatchingDisplayGroup.java:279)
>> at er.extensions.batching.ERXBatchingDisplayGroup.refetch(ERXBatchingDisplayGroup.java:384)
>> at er.extensions.batching.ERXBatchingDisplayGroup.fetch(ERXBatchingDisplayGroup.java:460)
>> at com.webobjects.appserver.WODisplayGroup.qualifyDataSource(WODisplayGroup.java:2455)
>> at Components.CurrentSit.<init>(CurrentSit.java:65) ... 45 more
>>
>>> On Mar 18, 2010, at 6:20 PM, Chuck Hill wrote:
>>> Yes. And it has been done and it is called ERXBatchingDisplayGroup. :-)
>>>
>>
>>
>> Now <acctId> is a foreign key to the <owner>.
>> And I could do <owner.accounts()> and get what I want except unsorted.
>>
>> ----
>> Baiss Eric Magnusson
>> http://www.CascadeWebDesign.com
>>
>>
>>
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> 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/products/practical_webobjects
>
>
>
>
>
>
>
_______________________________________________
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