* com.webobjects.foundation.NSDictionary)
*/
public EOEntity subEntityForEntity(EOEntity entity, NSDictionary pkDict) {
if (encodeEntityInPkValue()) {
//get the code, we assume that the pkDict contains only one pk value!
NSArray values = pkDict.allValues();
if (values.count() > 1) throw new IllegalArgumentException("subEntityForEntity in its default implementation"+
" works only with single pk long values " + entity.name()+ " has " + pkDict);
long pkValueWithCode;
try {
Number n = (Number) values.objectAtIndex(0);
pkValueWithCode = n.longValue();
} catch (ClassCastException e) {
throw new IllegalArgumentException("subEntityForEntity in its default implementation"+
" works only with single pk long values, expected a java.lang.Number but got a "+values.objectAtIndex(0));
}
long entityCode = pkValueWithCode & ((1 << ERXLongPrimaryKeyFactory.CODE_LENGTH) - 1);
if (entityCode == 0) return null;
for (Enumeration subEntities = entity.subEntities().objectEnumerator(); subEntities.hasMoreElements();) {
EOEntity subEntity = (EOEntity) subEntities.nextElement();