public List<ExpectedPartitionValueEntity> createExpectedPartitionValueEntities(String partitionKeyGroupName,List<String> expectedPartitionValues){
  PartitionKeyGroupEntity partitionKeyGroupEntity=partitionKeyGroupDao.getPartitionKeyGroupByName(partitionKeyGroupName);
  if (partitionKeyGroupEntity == null) {
    partitionKeyGroupEntity=partitionKeyGroupDaoTestHelper.createPartitionKeyGroupEntity(partitionKeyGroupName);
  }
  List<ExpectedPartitionValueEntity> expectedPartitionValueEntities=new ArrayList<>();
  for (  String expectedPartitionValue : expectedPartitionValues) {
    ExpectedPartitionValueEntity expectedPartitionValueEntity=new ExpectedPartitionValueEntity();
    expectedPartitionValueEntity.setPartitionKeyGroup(partitionKeyGroupEntity);
    expectedPartitionValueEntity.setPartitionValue(expectedPartitionValue);
    expectedPartitionValueEntities.add(expectedPartitionValueDao.saveAndRefresh(expectedPartitionValueEntity));
  }
  return expectedPartitionValueEntities;
}

public List < ExpectedPartitionValueEntity > createExpectedPartitionValueEntities ( String partitionKeyGroupName , List < String > expectedPartitionValues ) { PartitionKeyGroupEntity partitionKeyGroupEntity = partitionKeyGroupDao . getPartitionKeyGroupByName ( partitionKeyGroupName ) ; if ( partitionKeyGroupEntity == null ) { partitionKeyGroupEntity = partitionKeyGroupDaoTestHelper . createPartitionKeyGroupEntity ( partitionKeyGroupName ) ; } List < ExpectedPartitionValueEntity > expectedPartitionValueEntities = new ArrayList < > ( ) ; for ( String expectedPartitionValue : expectedPartitionValues ) { ExpectedPartitionValueEntity expectedPartitionValueEntity = new ExpectedPartitionValueEntity ( ) ; expectedPartitionValueEntity . setPartitionKeyGroup ( partitionKeyGroupEntity ) ; expectedPartitionValueEntity . setPartitionValue ( expectedPartitionValue ) ; expectedPartitionValueEntities . add ( expectedPartitionValueDao . saveAndRefresh ( expectedPartitionValueEntity ) ) ; } return expectedPartitionValueEntities ; }
creates and persists specified partition value entities . this method also creates and persists a partition key group entity , if it does not exist .
