public class EnumType<T extends Enum<T>> extends Object implements ExtendedType<T>
Modifier and Type | Field and Description |
---|---|
protected String |
canonicalName |
protected Class<T> |
enumClass |
protected T[] |
values |
TRIM_VALUES_THRESHOLD
Modifier and Type | Method and Description |
---|---|
String |
getClassName()
Returns a full name of Java class that this ExtendedType supports.
|
T |
materializeObject(CallableStatement rs,
int index,
int type)
Reads an object from a stored procedure OUT parameter, converting it to class
returned by 'getClassName' method.
|
T |
materializeObject(ResultSet rs,
int index,
int type)
Reads an object from JDBC ResultSet column, converting it to class returned by
'getClassName' method.
|
void |
setJdbcObject(PreparedStatement statement,
T value,
int pos,
int type,
int precision)
Initializes a single parameter of a PreparedStatement with object value.
|
String |
toString(T value)
Converts value of the supported type to a human-readable String representation.
|
protected String canonicalName
public String getClassName()
ExtendedType
getClassName
in interface ExtendedType<T extends Enum<T>>
public void setJdbcObject(PreparedStatement statement, T value, int pos, int type, int precision) throws Exception
ExtendedType
setJdbcObject
in interface ExtendedType<T extends Enum<T>>
Exception
public T materializeObject(ResultSet rs, int index, int type) throws Exception
ExtendedType
materializeObject
in interface ExtendedType<T extends Enum<T>>
Exception
- if read error occurred, or an object can't be converted to a
target Java class.public T materializeObject(CallableStatement rs, int index, int type) throws Exception
ExtendedType
materializeObject
in interface ExtendedType<T extends Enum<T>>
Exception
- if read error occurred, or an object can't be converted to a
target Java class.public String toString(T value)
ExtendedType
toString
in interface ExtendedType<T extends Enum<T>>
value
- a value to convert to String.Copyright © 2001–2017 Apache Cayenne. All rights reserved.