Class CreateUser


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

      • userName

        private java.lang.String userName
      • admin

        private boolean admin
      • ifNotExists

        private boolean ifNotExists
      • comment

        private java.lang.String comment
    • Constructor Detail

    • 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 user
        session - the session
        salt - the salt
        hash - the hash
      • 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
      • setAdmin

        public void setAdmin​(boolean b)
      • setComment

        public void setComment​(java.lang.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