Merge pull request #6853 from timur-sh/6838

[#6838] The User type for GRANT statement
This commit is contained in:
Lukas Eder 2017-11-23 16:48:11 +01:00 committed by GitHub
commit 89c8624d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 48 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 Name 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(name));
}
public static User user(Name name) {
return new UserImpl(name);
}
// -------------------------------------------------------------------------
// XXX Conversion of objects into tables
// -------------------------------------------------------------------------

View File

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