de.akquinet.jbosscc.guttenbase.hints.impl.DefaultColumnMapper Maven / Gradle / Ivy
package de.akquinet.jbosscc.guttenbase.hints.impl;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import de.akquinet.jbosscc.guttenbase.mapping.ColumnMapper;
import de.akquinet.jbosscc.guttenbase.meta.ColumnMetaData;
import de.akquinet.jbosscc.guttenbase.meta.TableMetaData;
/**
* By default return column with same name ignoring case.
*
*
* © 2012 akquinet tech@spree
*
*
* @author M. Dahm
*/
public class DefaultColumnMapper implements ColumnMapper {
@Override
public List map(final ColumnMetaData source, final TableMetaData targetTableMetaData) throws SQLException {
final String columnName = source.getColumnName();
final ColumnMetaData columnMetaData = targetTableMetaData.getColumnMetaData(columnName);
return columnMetaData != null ? new ArrayList(Arrays.asList(columnMetaData)) : new ArrayList();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy