public Object save(Object entity){
  Object key=PropertyUtils.getPropertyValue(entity,repositoryMetadata.getIdentifierProperty());
  log.info("The entity that is to be saved has a key with value " + key);
  if (key == null && keyGenerator != null) {
    log.info("The key was null, but the generator was not, so we are going to get a key for the entity");
    key=keyGenerator.generate();
    log.debug("The generated key for the entity was " + key);
    PropertyUtils.setPropertyValue(entity,repositoryMetadata.getIdentifierProperty(),key);
  }
  if (key == null) {
    log.warn("Attempting to save an entity without a key. This might result in an error. To fix this, specify a key generator.");
  }
  dataStore.save((Serializable)key,entity);
  return entity;
}

public Object save ( Object entity ) { Object key = PropertyUtils . getPropertyValue ( entity , repositoryMetadata . getIdentifierProperty ( ) ) ; log . info ( "The entity that is to be saved has a key with value " + key ) ; if ( key == null && keyGenerator != null ) { log . info ( "The key was null, but the generator was not, so we are going to get a key for the entity" ) ; key = keyGenerator . generate ( ) ; log . debug ( "The generated key for the entity was " + key ) ; PropertyUtils . setPropertyValue ( entity , repositoryMetadata . getIdentifierProperty ( ) , key ) ; } if ( key == null ) { log . warn ( "Attempting to save an entity without a key. This might result in an error. To fix this, specify a key generator." ) ; } dataStore . save ( ( Serializable ) key , entity ) ; return entity ; }
saves the entity in the underlying data store , creating keys in the process , if necessary .
