|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.d2rq.db.types.DataType
public abstract class DataType
Represents a SQL data type.
Nested Class Summary | |
---|---|
static class |
DataType.GenericType
|
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
---|---|
DataType(String name)
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
int |
hashCode()
|
boolean |
isIRISafe()
|
boolean |
isUnsupported()
|
String |
name()
Returns the datatype's name as reported by JDBC metadata (or closest equivalent), for debugging |
String |
rdfType()
Return the URI of an appropriate RDF datatype for a SQL data type. |
boolean |
supportsDistinct()
|
String |
toSQLLiteral(String value,
Vendor vendor)
Creates a SQL literal for the given value, suitable for comparison to a column of this indicated type. |
String |
toString()
|
String |
value(ResultSet resultSet,
int column)
Retrieves a string value in preferred format (canonical form of the closest XSD type) from a SQL ResultSet. |
String |
valueRegex()
A regular expression that covers the lexical form of all values of this datatype (in their RDF representation). |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public DataType(String name)
name
- Name as reported by JDBC metadata, for debuggingMethod Detail |
---|
public String rdfType()
null
indicates a known SQL type that cannot be mapped to RDF.
http://www.w3.org/2001/XMLSchema#string
etc.public boolean isIRISafe()
public boolean supportsDistinct()
true
if this column can be used in SELECT DISTINCT
queriespublic boolean isUnsupported()
public String toSQLLiteral(String value, Vendor vendor)
NULL
is returned.
value
- A valuevendor
- A vendor instance responsible for quoting/escaping
public String value(ResultSet resultSet, int column) throws SQLException
resultSet
- Result of a SELECT querycolumn
- The column index to retrieve; leftmost columns is 1
null
if SQL result was null or is not representable in the XSD type
SQLException
public String valueRegex()
public String toString()
toString
in class Object
public String name()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |