/*
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
*/
|
package com.megatim.fdxcommons.tools.database.queries.metadata;
|
|
import com.megatim.fdxcommons.tools.database.contrat.TypeFichierDataRow;
|
import com.megatim.fdxcommons.tools.database.contrat.TypeFichierInsertMetaData;
|
import java.util.List;
|
import java.util.stream.Collectors;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
public class ConsultationTypeFichierInsertData implements TypeFichierInsertMetaData {
|
|
private final List<TypeFichierDataRow> rows;
|
private final String tableName;
|
|
public ConsultationTypeFichierInsertData(List<TypeFichierDataRow> rows, String tableName) {
|
this.rows = rows;
|
this.tableName = tableName;
|
}
|
|
@Override
|
public List<String> columnNames() throws Exception {
|
return rows.get(0).columns()
|
.stream()
|
.map(e -> e.column())
|
.sorted((e1, e2) -> e1.compareTo(e2)) //On se rassure de classer le résultat
|
.collect(Collectors.toList());
|
}
|
|
@Override
|
public String tableName() {
|
return tableName;
|
}
|
|
@Override
|
public List<TypeFichierDataRow> rows() throws Exception {
|
return rows;
|
}
|
}
|