public class IdentifyTemplate
extends java.lang.Object
Identifier
,
DataObject
Modifier and Type | Field and Description |
---|---|
static int |
IDENTIFIED_BY_INT |
static int |
IDENTIFIED_BY_LONG |
static int |
IDENTIFIED_BY_MULTIPLE_COLUMNS |
static int |
IDENTIFIED_BY_STRING |
static int |
IDENTIFIED_FREE_CONDITIONED |
static int |
TYPE_DATE |
static int |
TYPE_NUMERIC |
static int |
TYPE_TEXT |
Constructor and Description |
---|
IdentifyTemplate(Index index,
AbstractAttribute[] attributes) |
IdentifyTemplate(java.lang.String[] identifyColumnNames,
int[] columnTypes)
Constructs a identification template.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getColumnTypes() |
java.lang.String[] |
getIdentifyColumnNames() |
java.lang.String |
getIdentifyConditionForPreparedStatements()
Returns the identify condition for prepared statements, e.g.
|
int |
getIdentifyType() |
Identifier |
parseString(java.lang.String identifyString)
Parses an identify string - made by toString - back to an identifier object.
|
void |
setIdentifier(java.sql.PreparedStatement ps,
Identifier ident,
int[] lengths)
Sets the identifying fields to get a unique row by using prepared statements.
|
void |
setIdentifier(java.sql.PreparedStatement ps,
Identifier ident,
int[] lengths,
int columnOffset)
Sets the identifying fields to get a unique row by using prepared statements.
|
java.lang.String |
toString(Identifier identifier)
Builds a string representation of the specified identifier which may be parsed
to an identifier again later via parseString
|
public static final int IDENTIFIED_BY_INT
public static final int IDENTIFIED_BY_LONG
public static final int IDENTIFIED_BY_STRING
public static final int IDENTIFIED_BY_MULTIPLE_COLUMNS
public static final int IDENTIFIED_FREE_CONDITIONED
public static final int TYPE_NUMERIC
public static final int TYPE_TEXT
public static final int TYPE_DATE
public IdentifyTemplate(Index index, AbstractAttribute[] attributes)
public IdentifyTemplate(java.lang.String[] identifyColumnNames, int[] columnTypes)
identifyColumnNames
- the names of the columns to be used as primary keycolumnTypes
- the types of the columns to be used as primary keypublic int getIdentifyType()
public java.lang.String[] getIdentifyColumnNames()
public int[] getColumnTypes()
public java.lang.String toString(Identifier identifier)
identifier
- the identifier to be transformedpublic Identifier parseString(java.lang.String identifyString)
identifyString
- the string to parsepublic java.lang.String getIdentifyConditionForPreparedStatements()
public void setIdentifier(java.sql.PreparedStatement ps, Identifier ident, int[] lengths) throws java.sql.SQLException
ps
- the prepared statement to useident
- the identifier to identify the wished rowlengths
- the length of identifier fields to fill them with spaces if they are defined as charjava.sql.SQLException
getIdentifyConditionForPreparedStatements()
public void setIdentifier(java.sql.PreparedStatement ps, Identifier ident, int[] lengths, int columnOffset) throws java.sql.SQLException
ps
- the prepared statement to useident
- the identifier to identify the wished rowlengths
- the length of identifier fields to fill them with spaces if they are defined as charcolumnOffset
- the offset of the key columns / the number of fields used in the prepared statements before the where condition fieldsjava.sql.SQLException
getIdentifyConditionForPreparedStatements()
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de