{
// First token is not the alias of this type, so reset the tokeniser
tokeniser = new StringTokenizer(attrName, ".");
}
AttributeImpl currentAttr = null;
while (tokeniser.hasMoreTokens())
{
token = tokeniser.nextToken();
currentAttr = (AttributeImpl)currentType.getAttribute(token);
if (currentAttr == null)
{
throw new IllegalArgumentException("Unable to access attribute " + token + " of " + currentType + " for join");
}
if (tokeniser.hasMoreTokens())
{
if (currentAttr.getPersistentAttributeType() == PersistentAttributeType.BASIC)
{
throw new IllegalArgumentException("Cannot resolve attribute " + attrName + " since " +
token + " is not a relation field and the attribute name goes beyond it!");
}
currentType = (ManagedType)currentAttr.getType();
}
}
return currentAttr;
}