1 | |
package liquibase.sqlgenerator.core; |
2 | |
|
3 | |
import liquibase.database.Database; |
4 | |
import liquibase.database.core.SybaseASADatabase; |
5 | |
import liquibase.sql.Sql; |
6 | |
import liquibase.sql.UnparsedSql; |
7 | |
import liquibase.sqlgenerator.SqlGeneratorChain; |
8 | |
import liquibase.statement.core.GetViewDefinitionStatement; |
9 | |
|
10 | 10 | public class GetViewDefinitionGeneratorSybaseASA extends GetViewDefinitionGenerator { |
11 | |
@Override |
12 | |
public int getPriority() { |
13 | 1 | return PRIORITY_DATABASE; |
14 | |
} |
15 | |
|
16 | |
@Override |
17 | |
public boolean supports(GetViewDefinitionStatement statement, Database database) { |
18 | 0 | return database instanceof SybaseASADatabase; |
19 | |
} |
20 | |
|
21 | |
@Override |
22 | |
public Sql[] generateSql(GetViewDefinitionStatement statement, Database database, |
23 | |
SqlGeneratorChain sqlGeneratorChain) { |
24 | 0 | return new Sql[] { new UnparsedSql("select viewtext from sysviews where upper(viewname)='" |
25 | |
+ statement.getViewName().toUpperCase() + "' and upper(vcreator) = '" |
26 | |
+ statement.getSchemaName().toUpperCase() + '\'') }; |
27 | |
} |
28 | |
} |