Hello Otis,
Thank you for your fast response
. I tried the following:
public DataTable getConfigurationHistoryView(IPredicateExpression filter)
{
DataAccessAdapter adapter = new DataAccessAdapter();
try
{
//Define view fields
ResultsetFields fields = new ResultsetFields(5);
fields.DefineField(ConfigurationhistoryFieldIndex.Dateadded,0,"Dateadded");
fields.DefineField(ConfigurationhistoryFieldIndex.Datedeleted,1,"Datedeleted");
fields.DefineField(ResourceFieldIndex.Name,2,"Resourcename","ParentResource");
fields.DefineField(ResourceFieldIndex.Name,3,"Childresourcename","ChildResource");
fields.DefineField(GroupFieldIndex.Name,4,"Groupname");
//Define used relations
IRelationPredicateBucket relationBucket = new RelationPredicateBucket();
relationBucket.Relations.Add (ConfigurationhistoryEntity.Relations.ResourceEntityUsingResourceid,"ParentResource");
relationBucket.Relations.Add(ConfigurationhistoryEntity.Relations.ResourceEntityUsingChildresourceid,"ChildResource");
relationBucket.Relations.Add(ConfigurationhistoryEntity.Relations.GroupEntityUsingGroupid);
//Create datable wich will contain the configuration history view
DataTable allConfigurations = new DataTable();
//Sort on date added descending
ISortExpression sorter = new SortExpression(SortClauseFactory.Create(ConfigurationhistoryFieldIndex.Dateadded, SortOperator.Descending));
adapter.FetchTypedList(fields,allConfigurations,relationBucket,0,sorter,false);
return allConfigurations;
}
finally
{
adapter.Dispose();
}
}
I specified the alias "ParentResource" for the resultfield wich holds the name of the parentresource and the alias "ChildResource" for the resultfield wich holds the name of the childresource. I also specified the endaliasses for the relations.
When I run this code I get the following error message "ORA-00904: invalid column name".
What am I doing wrong?