Class Name

  • All Implemented Interfaces:
    QueryPart

    public class Name
    extends java.lang.Object
    implements QueryPart
    The Name class represents a name used in a query, for example a table name, column name or function name.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.Set<java.lang.String> KEYWORDS
      The KEYWORDS set is used to identify database keywords in names to apply escaping to avoid errors when executing the query.
    • Constructor Summary

      Constructors 
      Constructor Description
      Name()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isKeyword​(java.lang.String str)
      Returns true if the passed string is recognized as a keyword.
      java.lang.String string​(QueryOptions options)
      Transforms this statement into an SQL string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.github.eikecochu.sqlbuilder.QueryPart

        string
    • Field Detail

      • KEYWORDS

        public static java.util.Set<java.lang.String> KEYWORDS
        The KEYWORDS set is used to identify database keywords in names to apply escaping to avoid errors when executing the query.
    • Constructor Detail

      • Name

        public Name()
    • Method Detail

      • string

        public java.lang.String string​(QueryOptions options)
        Description copied from interface: QueryPart
        Transforms this statement into an SQL string
        Specified by:
        string in interface QueryPart
        Parameters:
        options - The QueryOptions to apply for transformation
        Returns:
        The created SQL string
      • isKeyword

        public static boolean isKeyword​(java.lang.String str)
        Returns true if the passed string is recognized as a keyword. This is an estimation, as the target database is not taken into account. To modify the keyword list, change or overwrite Name.KEYWORDS
        Parameters:
        str - The name to check
        Returns:
        true if it is a keyword