Constructor and Description |
---|
Name(java.lang.String unescapedName)
Constructs a properly escaped SQL name.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Name other)
Compares this name with the specified name for order.
|
boolean |
equals(java.lang.Object that)
Checks two names for equality.
|
java.lang.String |
getUnescaped()
Returns the original unescaped name.
|
int |
hashCode()
Computes a hash code.
|
java.lang.String |
toString()
Gets a correctly escaped string representation of this name, which can be used in a SQL query to refer to the
named entity.
|
public Name(java.lang.String unescapedName)
The name will be equivalent to calling Sql::escapeName().
unescapedName
- An unescaped name.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getUnescaped()
Don't use the result of this method in SQL, as it is prone to SQL injection. The method should be used for use-cases where the original name is more readable (e.g., logging).
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
that
- The other name.public int compareTo(Name other)
compareTo
in interface java.lang.Comparable<Name>
other
- The other name.public int hashCode()
hashCode
in class java.lang.Object