Package org.h2.command.ddl
Class CreateUser
- java.lang.Object
-
- org.h2.command.Prepared
-
- org.h2.command.ddl.DefineCommand
-
- org.h2.command.ddl.CreateUser
-
public class CreateUser extends DefineCommand
This class represents the statement CREATE USER
-
-
Field Summary
Fields Modifier and Type Field Description private booleanadminprivate java.lang.Stringcommentprivate Expressionhashprivate booleanifNotExistsprivate Expressionpasswordprivate Expressionsaltprivate java.lang.StringuserName-
Fields inherited from class org.h2.command.ddl.DefineCommand
transactional
-
Fields inherited from class org.h2.command.Prepared
create, parameters, prepareAlways, session, sqlStatement, sqlTokens
-
-
Constructor Summary
Constructors Constructor Description CreateUser(SessionLocal session)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static byte[]getByteArray(SessionLocal session, Expression e)intgetType()Get the command type as defined in CommandInterfacevoidsetAdmin(boolean b)voidsetComment(java.lang.String comment)voidsetHash(Expression e)voidsetIfNotExists(boolean ifNotExists)(package private) static voidsetPassword(User user, SessionLocal session, Expression password)Set the password for the given user.voidsetPassword(Expression password)voidsetSalt(Expression e)(package private) static voidsetSaltAndHash(User user, SessionLocal session, Expression salt, Expression hash)Set the salt and hash for the given user.voidsetUserName(java.lang.String userName)longupdate()Execute the statement.-
Methods inherited from class org.h2.command.ddl.DefineCommand
isReadOnly, isTransactional, queryMeta, setTransactional
-
Methods inherited from class org.h2.command.Prepared
checkCanceled, checkParameters, collectDependencies, getCteCleanups, getCurrentRowNumber, getObjectId, getParameters, getPersistedObjectId, getPlanSQL, getSession, getSimpleSQL, getSQL, getSQLTokens, isCacheable, isQuery, needRecompile, prepare, query, setCommand, setCteCleanups, setCurrentRowNumber, setParameterList, setPersistedObjectId, setPrepareAlways, setRow, setSession, setSQL, toString
-
-
-
-
Field Detail
-
userName
private java.lang.String userName
-
admin
private boolean admin
-
password
private Expression password
-
salt
private Expression salt
-
hash
private Expression hash
-
ifNotExists
private boolean ifNotExists
-
comment
private java.lang.String comment
-
-
Constructor Detail
-
CreateUser
public CreateUser(SessionLocal session)
-
-
Method Detail
-
setIfNotExists
public void setIfNotExists(boolean ifNotExists)
-
setUserName
public void setUserName(java.lang.String userName)
-
setPassword
public void setPassword(Expression password)
-
setSaltAndHash
static void setSaltAndHash(User user, SessionLocal session, Expression salt, Expression hash)
Set the salt and hash for the given user.- Parameters:
user- the usersession- the sessionsalt- the salthash- the hash
-
getByteArray
private static byte[] getByteArray(SessionLocal session, Expression e)
-
setPassword
static void setPassword(User user, SessionLocal session, Expression password)
Set the password for the given user.- Parameters:
user- the usersession- the sessionpassword- the password
-
update
public long update()
Description copied from class:PreparedExecute the statement.
-
setSalt
public void setSalt(Expression e)
-
setHash
public void setHash(Expression e)
-
setAdmin
public void setAdmin(boolean b)
-
setComment
public void setComment(java.lang.String comment)
-
-