public class Identifier
extends java.lang.Object
IdentifyTemplate
,
DataObject
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BEGIN_FIELD |
static java.lang.String |
ELEMENT_DELIMITER |
static java.lang.String |
END_FIELD |
static int |
REPRESENTATIVE_FOR_NOTHING |
static Identifier |
SIMPLE_IDENTIFIER_FOR_NEW_ENTRY |
static Identifier |
SIMPLE_IDENTIFIER_FOR_NOTHING |
static java.lang.String |
TYPE_DATE |
static java.lang.String |
TYPE_DOUBLE |
static java.lang.String |
TYPE_FLOAT |
static java.lang.String |
TYPE_INTEGER |
static java.lang.String |
TYPE_LONG |
static java.lang.String |
TYPE_STRING |
Constructor and Description |
---|
Identifier(int identifier)
Constructs a new identifier based upon a single integer primary key.
|
Identifier(int identifier,
java.lang.String tableContext)
Constructs a new identifier based upon a single integer primary key.
|
Identifier(long identifier) |
Identifier(java.lang.Object[] items)
Constructs a new identifier based on primary key based upon one or more
items with optional different column types.
|
Identifier(java.lang.Object[] items,
java.lang.String tableContext)
Constructs a new identifier based on primary key based upon one or more
items with optional different column types.
|
Identifier(java.lang.String identifier) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Identifier identifierToCompare) |
boolean |
equals(java.lang.Object object) |
java.sql.Date |
getDateIdentifier() |
java.sql.Date |
getDateIdentifier(int index) |
java.lang.String |
getIdentifyCondition(IdentifyTemplate identifyTemplate,
SqlDialect sqldialect) |
int |
getIntIdentifier()
Returns the integer value of the first item.
|
int |
getIntIdentifier(int index)
Returns the integer value of the item as specified by index.
|
java.lang.Object[] |
getItems() |
long |
getLongIdentifier() |
java.lang.String |
getStringIdentifier() |
java.lang.String |
getStringIdentifier(int index) |
java.lang.String |
getTableContext() |
int |
hashCode() |
boolean |
isRepresentativeForNewEntry()
Returns true if the identifier represents an entry to be build (inserted).
|
boolean |
isRepresentativeForNothing()
Returns true if the identifier represents "nothing" - no matter what
type of columns it contains nor the number of the columns.
|
static Identifier |
parseString(java.lang.String idString)
Parses an identify string - made by toString - back to an identifier object.
|
static Identifier |
parseStringPrevious(java.lang.String identifyString)
Parses an identify string - made by toString - back to an identifier object.
|
static java.util.Vector<Identifier> |
parseToVector(java.lang.String identifyString)
Parses a string, which may represent multiple identifiers, to a vector.
|
java.lang.String |
toString() |
java.lang.String |
toStringPrevious()
Returns the identifier in a way it is expected by an SQL where clause -
Strings are embedded in "'", numeric values aren't.
|
public static final java.lang.String BEGIN_FIELD
public static final java.lang.String END_FIELD
public static final java.lang.String TYPE_STRING
public static final java.lang.String TYPE_INTEGER
public static final java.lang.String TYPE_LONG
public static final java.lang.String TYPE_FLOAT
public static final java.lang.String TYPE_DOUBLE
public static final java.lang.String TYPE_DATE
public static final java.lang.String ELEMENT_DELIMITER
public static final int REPRESENTATIVE_FOR_NOTHING
public static final Identifier SIMPLE_IDENTIFIER_FOR_NOTHING
public static final Identifier SIMPLE_IDENTIFIER_FOR_NEW_ENTRY
public Identifier(int identifier)
REPRESENTATIVE_FOR_NOTHING
and
REPRESENTATIVE_FOR_NEW_ENTRY
.identifier
- the integer identify valuepublic Identifier(int identifier, java.lang.String tableContext)
REPRESENTATIVE_FOR_NOTHING
and
REPRESENTATIVE_FOR_NEW_ENTRY
.identifier
- the integer identify valuetableContext
- the table context to avoid ambiguous assignment - in most cases not necessarypublic Identifier(long identifier)
public Identifier(java.lang.String identifier)
public Identifier(java.lang.Object[] items)
items
- the value items of the primary keypublic Identifier(java.lang.Object[] items, java.lang.String tableContext)
items
- the value items of the primary keytableContext
- the table context to avoid ambiguous assignment - in most cases not necessarypublic static java.util.Vector<Identifier> parseToVector(java.lang.String identifyString)
identifyString
- the string representing one or multiple identifierspublic static Identifier parseString(java.lang.String idString)
identifyString
- the string to parseIdentifyTemplate.parseString(String)
public static Identifier parseStringPrevious(java.lang.String identifyString)
identifyString
- the string to parseIdentifyTemplate.parseString(String)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringPrevious()
IdentifyTemplate.toString(Identifier)
public java.lang.Object[] getItems()
public int getIntIdentifier()
public int getIntIdentifier(int index)
index
- the index of the item value to be returnedpublic long getLongIdentifier()
public java.lang.String getStringIdentifier()
public java.lang.String getStringIdentifier(int index)
public java.sql.Date getDateIdentifier()
public java.sql.Date getDateIdentifier(int index)
public java.lang.String getTableContext()
public boolean isRepresentativeForNewEntry()
public boolean isRepresentativeForNothing()
public java.lang.String getIdentifyCondition(IdentifyTemplate identifyTemplate, SqlDialect sqldialect)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public boolean equals(Identifier identifierToCompare)
public int hashCode()
hashCode
in class java.lang.Object
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de