use of org.hibernate.tool.schema.extract.spi.ForeignKeyInformation.ColumnReferenceMapping in project hibernate-orm by hibernate.
the class CheckForExistingForeignKeyTest method getForeignKeyInformation.
/**
* @param referencedTableName - String
* @param referencingColumnName - String
* @param keyName - String
* @return ForeignKeyInformation
*/
private ForeignKeyInformation getForeignKeyInformation(String referencedTableName, String referencingColumnName, String keyName) {
List<ColumnReferenceMapping> columnMappingList = new ArrayList<>();
ColumnInformation referencingColumnMetadata = getColumnInformation("-", referencingColumnName);
ColumnInformation referencedColumnMetadata = getColumnInformation(referencedTableName, "-");
ColumnReferenceMapping columnReferenceMapping = new ColumnReferenceMappingImpl(referencingColumnMetadata, referencedColumnMetadata);
columnMappingList.add(columnReferenceMapping);
ForeignKeyInformationImpl foreignKeyInformation = new ForeignKeyInformationImpl(new Identifier(keyName, false), columnMappingList);
return foreignKeyInformation;
}
Aggregations