Class CreateUser


public class CreateUser extends DefineCommand
This class represents the statement CREATE USER
  • Field Details

    • userName

      private String userName
    • admin

      private boolean admin
    • password

      private Expression password
    • salt

      private Expression salt
    • hash

      private Expression hash
    • ifNotExists

      private boolean ifNotExists
    • comment

      private String comment
  • Constructor Details

  • Method Details

    • setIfNotExists

      public void setIfNotExists(boolean ifNotExists)
    • setUserName

      public void setUserName(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 user
      session - the session
      salt - the salt
      hash - 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 user
      session - the session
      password - the password
    • update

      public long update()
      Description copied from class: Prepared
      Execute the statement.
      Overrides:
      update in class Prepared
      Returns:
      the update count
    • setSalt

      public void setSalt(Expression e)
    • setHash

      public void setHash(Expression e)
    • setAdmin

      public void setAdmin(boolean b)
    • setComment

      public void setComment(String comment)
    • getType

      public int getType()
      Description copied from class: Prepared
      Get the command type as defined in CommandInterface
      Specified by:
      getType in class Prepared
      Returns:
      the statement type