Description
If you want to create a query with Criterias and have to set a UserAlias for certain paths and you set your UserAlias Object like this:
Criteria crit = new Criteria ();
UserAlias alias = new UserAlias ("alias1");
alias.add ("details.item");
crit.setAlias (alias);
Only the name of the alias is stored in the Criteria Object as shown in the original source below:
// PAW
/**
- Sets the alias using a userAlias object.
- @param userAlias The alias to set
*/
public void setAlias(UserAlias userAlias)
{
m_alias = userAlias.getName();
// propagate to SelectionCriteria,not to Criteria
for (int i = 0; i < m_criteria.size(); i++)
{
if (!(m_criteria.elementAt instanceof Criteria))
}
}
This leads to automatically aliasing all added attribute paths.
I fixed this issue locally by inserting the line
m_userAlias = userAlias;
This solves my problem with current ojb releases.