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 boolean
admin
private java.lang.String
comment
private Expression
hash
private boolean
ifNotExists
private Expression
password
private Expression
salt
private java.lang.String
userName
-
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)
int
getType()
Get the command type as defined in CommandInterfacevoid
setAdmin(boolean b)
void
setComment(java.lang.String comment)
void
setHash(Expression e)
void
setIfNotExists(boolean ifNotExists)
(package private) static void
setPassword(User user, SessionLocal session, Expression password)
Set the password for the given user.void
setPassword(Expression password)
void
setSalt(Expression e)
(package private) static void
setSaltAndHash(User user, SessionLocal session, Expression salt, Expression hash)
Set the salt and hash for the given user.void
setUserName(java.lang.String userName)
long
update()
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:Prepared
Execute 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)
-
-