public static TopiaEntity[] getEntities(TopiaPersistenceContext srcCtxt, String... entityList) throws TopiaException { TopiaEntity[] srcList = new TopiaEntity[entityList.length]; int index = 0; for (String id : entityList) { TopiaEntity e2 = srcCtxt.findByTopiaId(id); srcList[index++] = e2; } return srcList; }
public static List<? extends TopiaEntity> getEntitiesList( TopiaPersistenceContext srcCtxt, String... entityList) throws TopiaException { List<TopiaEntity> srcList = new ArrayList<TopiaEntity>(entityList.length); for (String id : entityList) { TopiaEntity e2 = srcCtxt.findByTopiaId(id); srcList.add(e2); } return srcList; }
@SuppressWarnings({"unchecked"}) public static <E extends TopiaEntity> List<E> getEntities( TopiaPersistenceContext srcCtxt, List<E> entityList, boolean canBeNull) throws TopiaException { List<E> srcList = new ArrayList<E>(entityList.size()); for (E e : entityList) { E e2 = (E) srcCtxt.findByTopiaId(e.getTopiaId()); if (e2 == null && !canBeNull) { continue; } srcList.add(e2); } return srcList; }