private String toSQLPattern ( String attribute ) { String pattern = attribute . replace ( "*" , "%" ) ; if ( ! pattern . startsWith ( "%" ) ) { pattern = "%" + pattern ; } if ( ! pattern . endsWith ( "%" ) ) { pattern = pattern . concat ( "%" ) ; } return pattern ; }
To sql pattern .