У меня есть класс, Местоположение. Location содержит список объектов BorderPoint, но это может быть ОГРОМНЫЙ список (20000 не является невозможным). Таблицы для этого: LOCATION и BORDERPOINT.
Я изначально заполнил Location с помощью импорта из шейп-файла ESRI. Вот фрагмент кода:
try {
while (featureIterator.hasNext()) {
Location location = new Location();
SimpleFeatureImpl feature = (SimpleFeatureImpl) featureIterator.next();
// set the information in location based on stuff in the feature, lets me clean up this
// method a bit
setLocationInfo(location, feature);
List<BorderPoint> borderPointList = getBorderPoints(feature, location);
//saveBorderPoints(location, feature);
location.setBorderPointList(borderPointList);
try {
locationRepository.persist(location);
} catch (RepositoryException e) {
throw new ServiceException("processShapefile() threw RepositoryException", e);
}
}
} finally {
featureIterator.close();
}
Поскольку в списке так много объектов BorderPoint, но я сохраняю их только путем вызова persist для объекта Location, могу ли я автоматически установить какой-либо размер пакета для сохранения BorderPoints?