|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sqlg2.ColumnInfo
public final class ColumnInfo
Description of DB-to-Java mapping for one column of a result set.
Constructor Summary | |
---|---|
ColumnInfo(java.lang.Class<?> type,
java.lang.String name,
java.lang.String fetchMethod,
boolean special)
Constructor. |
Method Summary | |
---|---|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ColumnInfo(java.lang.Class<?> type, java.lang.String name, java.lang.String fetchMethod, boolean special)
type
- type of the Java field for this DB columnname
- name of the Java field for this DB columnfetchMethod
- method to retrieve info from result set for this DB column. It is a string containing
full text of a call using resultSetVar
and metaVar
parameters of
Mapper.getFields(java.sql.ResultSetMetaData, String, String, sqlg2.checker.SqlChecker)
method.
Example: to retrieve int
value from the first column of a result set you can create following
string for fetchMethod
value:
String metaMethod = resultSetVar + ".getMetaData().getPrecision(1)";
String dataMethod = resultSetVar + ".getInt(1)";
String fetchMethod = metaVar + " ? " + metaMethod + " : " + dataMethod;
Normally you would use sqlg2.db.Impl
methods to retrieve data/meta-data from result set.
special
- true if it is a mapping to MappedType
, not ordinary Java class.Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |