|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.mguennewig.pobjects.metadata.AbstractType
de.mguennewig.pobjects.metadata.ScalarType
public abstract class ScalarType
All scalar types can be used for a field of a persistent object are derived from this class.
Every type maps to exactly one data type in the database schema. The names of the types are chosen to represent their storage characteristics and may differ from the names of SQL data types.
| Field Summary |
|---|
| Fields inherited from interface de.mguennewig.pobjects.metadata.Type |
|---|
CLASS_NAME, TYPE_NAME |
| Method Summary | |
|---|---|
void |
addMap(MapItem item)
Adds a mapping to this type. |
void |
checkConstraints(Record rec,
Column column)
Checks all constraints imposed on values of this type. |
void |
checkSyntax(java.lang.String value)
|
ClassDecl |
expand(ClassDecl classDecl,
Field field)
Expands this type to an extra table. |
java.util.List<MapItem> |
getMap()
Returns the list of mappings. |
int |
getMaxFieldSize()
Returns the maximum field size required to enter a value of this type. |
java.lang.Object |
getResult(JdbcContainer db,
java.sql.ResultSet rs,
int column)
Reads the value for this type from the result set. |
int |
getResultInc()
Returns the number of columns read from the ResultSet. |
boolean |
isScalar()
Tests whether this type is scalar. |
boolean |
labelToValue(java.lang.String label,
ObjectRef valueRef)
Maps label to its value if defined. |
boolean |
valueToLabel(java.lang.Object value,
ObjectRef labelRef)
Maps value to its label if defined. |
| Methods inherited from class de.mguennewig.pobjects.metadata.AbstractType |
|---|
format, formatNative, getDescription, getTypeClass, name, parse, setDescription, setTypeClass |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.mguennewig.pobjects.metadata.Type |
|---|
getJavaClass, parseNative, setParam |
| Method Detail |
|---|
public void addMap(MapItem item)
java.lang.NullPointerException - if item is null.
java.lang.IllegalArgumentException - if the value in the item is of the wrong
type.
java.lang.IllegalArgumentException - if already a mapping for the specified
value or label exists.Type.getJavaClass()public final java.util.List<MapItem> getMap()
addMap(MapItem),
labelToValue(String,ObjectRef),
valueToLabel(Object,ObjectRef)
public void checkConstraints(Record rec,
Column column)
throws PObjConstraintException
rec - The record which contains column.column - The column of rec which has this type.
PObjConstraintException - when any constraint imposed on values of
this type is not fulfilled.
public final ClassDecl expand(ClassDecl classDecl,
Field field)
Non-scalar types can not be saved directly in a field, so they will be
expanded to another table whose declaration will be
generated by this method.
nullType.isScalar()public final boolean isScalar()
trueType.expand(de.mguennewig.pobjects.metadata.ClassDecl, de.mguennewig.pobjects.metadata.Field)public int getMaxFieldSize()
This is the maximum number of characters required to enter a string representation of all valid values of this type. The typical size of an input field may be much smaller.
public final boolean labelToValue(java.lang.String label,
ObjectRef valueRef)
label to its value if defined.
label - The label for which the corresponding value should be
returned.valueRef - An optional reference which will be used to return the
corresponding value if it exists.
true if the label could mapped, otherwise
false.Type.valueToLabel(Object,ObjectRef),
Type.addMap(MapItem)
public final boolean valueToLabel(java.lang.Object value,
ObjectRef labelRef)
value to its label if defined.
value - The internal object in the type's set for which the
corresponding label should be returned.labelRef - An optional reference which will be used to return the
corresponding label if it exists.
true if the value could mapped, otherwise
false.Type.labelToValue(String,ObjectRef),
Type.addMap(MapItem)
public java.lang.Object getResult(JdbcContainer db,
java.sql.ResultSet rs,
int column)
Type.getResultInc()public int getResultInc()
ResultSet.
Type.getResult(JdbcContainer,ResultSet,int)
public void checkSyntax(java.lang.String value)
throws PObjSyntaxException
PObjSyntaxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||