[#6838] The User type for GRANT statement

This commit is contained in:
Timur Shaidullin 2017-11-23 16:51:30 +03:00
parent 119f5ffce4
commit 09df218577
3 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,13 @@
package org.jooq;
/**
* The User to be used by GRANT statement
*
* @author Timur Shaidullin
*/
public interface User {
/**
* The name of user
*/
public String getName();
}

View File

@ -290,6 +290,7 @@ import org.jooq.TruncateIdentityStep;
import org.jooq.UDTRecord;
import org.jooq.Update;
import org.jooq.UpdateSetFirstStep;
import org.jooq.User;
import org.jooq.WindowIgnoreNullsStep;
import org.jooq.WindowOverStep;
import org.jooq.WindowSpecification;
@ -7852,6 +7853,18 @@ public class DSL {
return new QuantifiedSelectImpl<Record1<T>>(Quantifier.ANY, array);
}
// -------------------------------------------------------------------------
// XXX Access control
// -------------------------------------------------------------------------
public static User user(String name) {
return new UserImpl(name);
}
public static User user(Name name) {
return new UserImpl(name.toString());
}
// -------------------------------------------------------------------------
// XXX Conversion of objects into tables
// -------------------------------------------------------------------------

View File

@ -0,0 +1,21 @@
package org.jooq.impl;
import org.jooq.User;
/**
* A common implementation of the User type
*
* @author Timur Shaidullin
*/
public class UserImpl implements User {
private String name;
public UserImpl(String name) {
this.name = name;
}
@Override
public String getName() {
return name;
}
}