.getNamingfields(jdoClass);
if (nfs != null) {
ctx.put("namingFields", nfs);
}
} catch (PException e) {
throw new SpeedoException(
"Impossible to manage the naming of the class '"
+ jdoClass.getFQName() + "'", e);
}
//Compute user caches
Map userCaches = computeUserCaches(jdoClass);
ctx.put("hasUserCache", Boolean.valueOf(!userCaches.isEmpty()));
ctx.put("userCacheNames", new ArrayList(userCaches.keySet()));
for (Iterator iter = userCaches.entrySet().iterator(); iter.hasNext();) {
Map.Entry me = (Map.Entry) iter.next();
List fields = (List) me.getValue();
StringBuffer sb = new StringBuffer();
if (fields.size() > 1) {
sb.append("new UserCacheKey(new Object[] {");
}
String sep = "";
for (int j = 0; j < fields.size(); j++) {
sb.append(sep);
sep = ", ";
SpeedoField sf = (SpeedoField) fields.get(j);
Class clazz;
try {
clazz = Util.getClass(Type.getType(sf.type), null);
} catch (Exception e1) {
throw new SpeedoException("Field '" + sf.name
+ "' cannot be used in an index: ", e1);
}
if (clazz.isPrimitive()) {
sb.append("new ").append(getJavaLangType(clazz));
sb.append("(").append(sf.name).append(")");