public Optional < ColumnDefinitionSegment > findColumnDefinitionFromMetaData ( final String columnName , final ShardingTableMetaData shardingTableMetaData ) { if ( ! shardingTableMetaData . containsTable ( getTables ( ) . getSingleTableName ( ) ) ) { return Optional . absent ( ) ; } for ( ColumnMetaData each : shardingTableMetaData . get ( getTables ( ) . getSingleTableName ( ) ) . getColumns ( ) . values ( ) ) { if ( columnName . equalsIgnoreCase ( each . getColumnName ( ) ) ) { return Optional . of ( new ColumnDefinitionSegment ( columnName , each . getDataType ( ) , each . isPrimaryKey ( ) ) ) ; } } return Optional . absent ( ) ; }
Find column definition from meta data .