use of org.jooq.RevokeFromStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseRevoke.
private final DDLQuery parseRevoke() {
parseKeyword("REVOKE");
boolean grantOptionFor = parseKeywordIf("GRANT OPTION FOR");
Privilege privilege = parsePrivilege();
List<Privilege> privileges = null;
while (parseIf(',')) {
if (privileges == null) {
privileges = new ArrayList<>();
privileges.add(privilege);
}
privileges.add(parsePrivilege());
}
parseKeyword("ON");
parseKeywordIf("TABLE");
Table<?> table = parseTableName();
RevokeOnStep s1 = grantOptionFor ? privileges == null ? dsl.revokeGrantOptionFor(privilege) : dsl.revokeGrantOptionFor(privileges) : privileges == null ? dsl.revoke(privilege) : dsl.revoke(privileges);
parseKeyword("FROM");
User user = parseKeywordIf("PUBLIC") ? null : parseUser();
RevokeFromStep s2 = s1.on(table);
return user == null ? s2.fromPublic() : s2.from(user);
}
Aggregations