wherehows-dao/src/main/java/wherehows/dao/table/DatasetOwnerDao.java
public void insertUpdateOwnership(DatasetIdentifier identifier, int datasetId, ChangeAuditStamp auditStamp,
      List<OwnerInfo> owners) throws Exception {

    String datasetUrn = toWhDatasetUrn(identifier);

    if (owners.size() == 0) {
      throw new IllegalArgumentException("OwnerInfo array is empty!");
    }

    // find dataset owners of same source if exist
    List<DsOwner> dsOwners = findByIdAndSource(datasetId, owners.get(0).ownershipProvider.name());

    List<List<DsOwner>> updatedList =
        diffOwnerList(dsOwners, owners, datasetId, datasetUrn, (int) (auditStamp.time / 1000));

    if (updatedList.get(1).size() > 0) {
      removeList(updatedList.get(1));
    }

    if (updatedList.get(0).size() > 0) {
      updateList(updatedList.get(0));
    }
  }
/**
   * Insert or update dataset owners given information from MetadataChangeEvent
   * @param identifier DatasetIdentifier
   * @param datasetId int
   * @param auditStamp ChangeAuditStamp
   * @param owners List<OwnerInfo>
   */
Insert or update dataset owners given information from MetadataChangeEvent
@param identifier DatasetIdentifier
@param datasetId int
@param auditStamp ChangeAuditStamp
@param owners List
Insert or update dataset owners given information from MetadataChangeEvent @param identifier DatasetIdentifier @param datasetId int @param auditStamp ChangeAuditStamp @param owners List
public void insertUpdateOwnership(DatasetIdentifier identifier, int datasetId, ChangeAuditStamp auditStamp,
      List<OwnerInfo> owners) throws Exception {
    String datasetUrn = toWhDatasetUrn(identifier);
    if (owners.size() == 0) {
      throw new IllegalArgumentException("OwnerInfo array is empty!");
    }
    List<DsOwner> dsOwners = findByIdAndSource(datasetId, owners.get(0).ownershipProvider.name());
    List<List<DsOwner>> updatedList =
        diffOwnerList(dsOwners, owners, datasetId, datasetUrn, (int) (auditStamp.time / 1000));
    if (updatedList.get(1).size() > 0) {
      removeList(updatedList.get(1));
    }
    if (updatedList.get(0).size() > 0) {
      updateList(updatedList.get(0));
    }
  }
public void insertUpdateOwnership ( DatasetIdentifier identifier , int datasetId , ChangeAuditStamp auditStamp , List < OwnerInfo > owners ) throws Exception { String datasetUrn = toWhDatasetUrn ( identifier ) ; if ( owners . size ( ) == 0 ) { throw new IllegalArgumentException ( "OwnerInfo array is empty!" ) ; } List < DsOwner > dsOwners = findByIdAndSource ( datasetId , owners . get ( 0 ) . ownershipProvider . name ( ) ) ; List < List < DsOwner > > updatedList = diffOwnerList ( dsOwners , owners , datasetId , datasetUrn , ( int ) ( auditStamp . time / 1000 ) ) ; if ( updatedList . get ( 1 ) . size ( ) > 0 ) { removeList ( updatedList . get ( 1 ) ) ; } if ( updatedList . get ( 0 ) . size ( ) > 0 ) { updateList ( updatedList . get ( 0 ) ) ; } }
Insert or update dataset owners given information from MetadataChangeEvent
 @param identifier DatasetIdentifier
 @param datasetId int
 @param auditStamp ChangeAuditStamp
 @param owners List<OwnerInfo>
Insert or update dataset owners given information from MetadataChangeEvent @param identifier DatasetIdentifier @param datasetId int @param auditStamp ChangeAuditStamp @param owners List<OwnerInfo >
// find dataset owners of same source if exist