on 07-19-2007 12:46 PM
Hallo together,
has anybody experiences in searching in qualifier tables?
I have a repository with a main table and a qualifier table. Now I want to get all datasets which contain a special qualifier value.
I tried to use the QualifierSearchDimension and searching on the main table but I do not get any results. Does anybody have an idea?
Thanks
Thomas
Hi Thomas,
following code can fetch the data for qualified field
QualifiedLinkArray qla_pr_co = null;
Search search_qual = new Search(MAINTABLE);
QualifiedLinkArray qla_pr_co = null;
qla_pr_co = catalog.GetQualifiedLinks(search_qual,MAINTABLE ,MAIN TABLE QUALIFIED LINK,RECORDID OF THE MAIN RECORD);
int size_co = qla_pr_co.GetSize();
if(size_co>0)
{
for(int x=0;x<size_co;x++)
{
QualifiedLink ql_pr = qla_pr_co.GetQualifiedLinkAt(x);
A2iFields a2i_pr = ql_pr.GetQualifiers();
A2iField a2if_purchase;
try {
a2if_purchase = a2i_pr.GetAt(0);//value of qualified field..
} catch (NullPointerException e9) {
a2if_purchase = null;
e9.printStackTrace();
}catch (RuntimeException e9) {
a2if_purchase = null;
e9.printStackTrace();
}
If still it does not work u can get back to me.
Regards,
Shruti.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello togehter
thanks for helping. It looks like there is an error in the API.
Thanks
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That should be the way to go. Make sure your search and the result set are both pointing to the main table.
Search search = new Search(MainTableId);
//the main table field is the qualified lookup field pointing the the qualified table
QualifierSearchDimension qsd = new QualifierSearchDimension(MainTableFieldId, QualifiedTableFieldId);
TextSearchConstraint tsc = new TextSearchConstraint("test", TextSearchConstraint.EQUALS);
search.addSearchItem(qsd,tsc);
ResultDefinition rd = new ResultDefinition(MainTableId);
rd.addSelectField(MainTableFieldId);
RetrieveLimitedRecordsCommand cmd = new RetrieveLimitedRecordsCommand(connectionAccessor);
cmd.setSession(userSession);
cmd.setSearch(search);
cmd.setResultDefinition(rd);
try{
cmd.execute()
}catch(CommandException e){
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.