if ( primaryKeys instanceof Enumeration ) {
// create Enumeration of objrefs from Enumeration of primaryKeys
Enumeration e = (Enumeration)primaryKeys;
// this is a portable Serializable Enumeration
ObjrefEnumeration objrefs = new ObjrefEnumeration();
while ( e.hasMoreElements() ) {
Object primaryKey = e.nextElement();
Object ref;
if( primaryKey != null ) {
if ( inv.isLocal )
ref = getEJBLocalObjectForPrimaryKey(primaryKey);
else
ref = getEJBObjectStub(primaryKey, null);
objrefs.add(ref);
} else {
objrefs.add(null);
}
}
return objrefs;
} else if ( primaryKeys instanceof Collection ) {
// create Collection of objrefs from Collection of primaryKeys
Collection c = (Collection)primaryKeys;
Iterator it = c.iterator();
ArrayList objrefs = new ArrayList(); // a Serializable Collection
while ( it.hasNext() ) {
Object primaryKey = it.next();
Object ref;
if( primaryKey != null ) {
if ( inv.isLocal )
ref = getEJBLocalObjectForPrimaryKey(primaryKey);
else
ref = getEJBObjectStub(primaryKey, null);
objrefs.add(ref);
} else {
objrefs.add(null);
}
}
return objrefs;
} else {
if( primaryKeys != null ) {