Re: EOAndQualifier on child entity property
Re: EOAndQualifier on child entity property
- Subject: Re: EOAndQualifier on child entity property
- From: Chuck Hill <email@hidden>
- Date: Fri, 18 Aug 2006 16:05:42 -0700
I can see any problems in the code. My three suggestions:
1. Check your model to ensure that all of attributes have names and
column names
2. Try using another one like InSetQualifier. Not sure if that will
work here, but I have had problems where one of these qualifiers
would not work, but expressing it a different way in a different
qualifier did work.
3. Ask Pierre if he can help. :-)
Chuck
On Aug 18, 2006, at 12:29 PM, Yann Bizeul wrote:
A safer bet is to use some extensions to WO. See Pierre Bernards
excellent qualifier extensions at
http://www.bernard-web.com/pierre/webobjects/code.html
I tried that with the following code :
public Main doFind()
{
Main nextPage = (Main)pageWithName("Main");
NSArray tags = NSArray.componentsSeparatedByString(tag," ");
NSMutableArray tagsQualifiers = new NSMutableArray();
int i;
for (i=0;i<tags.count();i++)
{
EOQualifier q = EOQualifier.qualifierWithQualifierFormat("tag = %
@",new NSArray(tags.objectAtIndex(i)));
tagsQualifiers.addObject(new ExistsInRelationshipQualifier
("tags",q));
}
EOAndQualifier tagsQualifier = new EOAndQualifier(tagsQualifiers);
EOFetchSpecification f = new EOFetchSpecification
("Location",tagsQualifier,null);
nextPage.searchResults = session().defaultEditingContext
().objectsWithFetchSpecification(f);
return nextPage;
}
All I get is the following exception :
[2006-08-18 21:25:15 CEST] <WorkerThread0>
java.lang.NullPointerException
at
com.webobjects.eoaccess.EOSQLExpression._aliasForRelationshipPath
(EOSQLExpression.java:324)
at
com.webobjects.eoaccess.EOSQLExpression._aliasForRelatedAttributeRelat
ionshipPath(EOSQLExpression.java:259)
at
com.houdah.webobjects.eoaccess.qualifiers.ExistsInRelationshipQualifie
rSupport.sqlStringForSQLExpression
(ExistsInRelationshipQualifierSupport.java:100)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(
EOSQLExpression.java:1562)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifier
s(EOSQLExpression.java:1597)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$_AndQualifierSupport.sqlStringForSQLExpression
(EOQualifierSQLGeneration.java:512)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForArrayOfQualifiers(
EOSQLExpression.java:1562)
at
com.webobjects.eoaccess.EOSQLExpression.sqlStringForConjoinedQualifier
s(EOSQLExpression.java:1597)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$_AndQualifierSupport.sqlStringForSQLExpression
(EOQualifierSQLGeneration.java:512)
at com.webobjects.eoaccess.EOQualifierSQLGeneration
$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:151)
at
com.webobjects.eoaccess.EOSQLExpression.prepareSelectExpressionWithAtt
ributes(EOSQLExpression.java:1024)
at
com.webobjects.jdbcadaptor.JDBCExpression.prepareSelectExpressionWithA
ttributes(JDBCExpression.java:273)
at
com.webobjects.eoaccess.EOSQLExpressionFactory.selectStatementForAttri
butes(EOSQLExpressionFactory.java:226)
at com.webobjects.jdbcadaptor.JDBCChannel.selectAttributes
(JDBCChannel.java:178)
at
com.webobjects.eoaccess.EODatabaseChannel._selectWithFetchSpecificatio
nEditingContext(EODatabaseChannel.java:878)
at
com.webobjects.eoaccess.EODatabaseChannel.selectObjectsWithFetchSpecif
ication(EODatabaseChannel.java:215)
at
com.webobjects.eoaccess.EODatabaseContext._objectsWithFetchSpecificati
onEditingContext(EODatabaseContext.java:3205)
at
com.webobjects.eoaccess.EODatabaseContext.objectsWithFetchSpecificatio
n(EODatabaseContext.java:3346)
at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsWithFetchSpec
ification(EOObjectStoreCoordinator.java:539)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
n(EOEditingContext.java:4114)
at
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecificatio
n(EOEditingContext.java:4500)
at FindRightComponent.doFind(FindRightComponent.java:36)
Yann Bizeul • yann at tynsoe.org
Cocoa Developer
--
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