public Optional < StarSelectItem > findStarSelectItem ( final String tableNameOrAlias ) { Optional < Table > table = getTables ( ) . find ( tableNameOrAlias ) ; if ( ! table . isPresent ( ) ) { return Optional . absent ( ) ; } for ( SelectItem each : items ) { if ( ! ( each instanceof StarSelectItem ) ) { continue ; } StarSelectItem starSelectItem = ( StarSelectItem ) each ; if ( starSelectItem . getOwner ( ) . isPresent ( ) && getTables ( ) . find ( starSelectItem . getOwner ( ) . get ( ) ) . equals ( table ) ) { return Optional . of ( starSelectItem ) ; } } return Optional . absent ( ) ; }
Find star select item via table name or alias .