public final class PropertyMeta extends java.lang.Object implements java.lang.Comparable<PropertyMeta>
To keep the class hierarchy flat and fast, some information which only applies to certain data types (e.g., case-sensitivity) is maintained by this class. Fields are directly accessible to avoid method call overhead.
Modifier and Type | Field and Description |
---|---|
(package private) int |
columnCount
The number of columns in the table.
|
(package private) int |
columnIndex
One-based index of column in select clause or insert statement during load or insert.
|
private DataHandler |
dataHandler
The handler for setting this data type as parameter to a
PreparedStatement . |
private Property |
dmoProperty
The dmo property which contains the data read from annotation.
|
private int |
extent
Field extent (0 for scalar, including denormalized extent fields)
|
(package private) java.lang.String |
getterName
The getter's name for this property.
|
private int |
id
Property ID
|
(package private) java.lang.Object |
initialValue
Default initial (low-level) data value
|
(package private) int |
offset
The offset of the property in
data array. |
(package private) int |
seriesSize
Number of properties of like extent; non-0 only in first instance in a series
|
(package private) java.lang.String |
setterName
The setter's name for this property.
|
Constructor and Description |
---|
PropertyMeta(int id,
Property prop,
java.lang.String getterName,
java.lang.String setterName)
Constructor which accepts field id and property annotation from DMO interface getter method associated
with the property.
|
PropertyMeta(ReservedProperty prop)
Constructor which initializes the instance with the
ReservedProperty details. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(PropertyMeta that)
Compare this
PropertyMeta field to another. |
java.lang.String |
getColumn()
Retrieve the column name in the SQL table of this property.
|
DataHandler |
getDataHandler()
Obtain the
DataHandler used for setting a value of this property as a parameter
in a prepared query. |
int |
getDecimals()
Obtain numeric scale (precision in 4GL terms) (applies to
decimal fields only) ad defined in
the field declaration. |
int |
getExtent()
Retrieve the extent of this property.
|
java.lang.String |
getFormat()
Retrieve the format used by this property.
|
int |
getId()
Obtain the original id of this property from the DMO interface.
|
java.lang.Object |
getInitialValue()
Retrieve the original initial value of this property.
|
java.lang.String |
getLegacyName()
Retrieve the legacy name of this property.
|
java.lang.String |
getName()
Retrieve the name of this property.
|
int |
getOffset()
Obtain the index 0-base of the property in the
data array of the BaseRecord . |
int |
getOriginalExtent()
Retrieve the original extent of this property, which differs from @extent@ only for denormalized
extent fields.
|
java.lang.String |
getOriginalName()
Retrieve the original name of this property, for extent fields which were denormalized.
|
java.lang.Class<? extends BaseDataType> |
getType()
Obtain the FWD type of the field.
|
boolean |
isCaseSensitive()
Test whether this property is case sensitive.
|
(package private) boolean |
isCharacter()
Check whether this property has
character type. |
(package private) boolean |
isDateTimeTz()
Check whether this property has
datetime-tz type. |
boolean |
isMandatory()
Test whether this is a mandatory property.
|
boolean |
isReserved()
Check if this property meta is for a reserved property.
|
java.lang.String |
toString()
Returns a short text describing this object.
|
private final int id
private final Property dmoProperty
final java.lang.Object initialValue
private final int extent
private final DataHandler dataHandler
PreparedStatement
.int seriesSize
int columnIndex
In case of multi-column properties, this is the index of the first column. The other(s) come in sequence.
int columnCount
columnCount
columns are used to rehydrate the restore the object's internal data.int offset
data
array. For extent fields, this is the offset of
the first element.final java.lang.String setterName
DmoClass
to assemble the
setter implementations on-the-fly.final java.lang.String getterName
DmoClass
to assemble the
getter implementations on-the-fly.PropertyMeta(ReservedProperty prop)
ReservedProperty
details.prop
- The property details.PropertyMeta(int id, Property prop, java.lang.String getterName, java.lang.String setterName)
id
- Field ID.prop
- The Property
annotation to be analyzed for object attributes.getterName
- The name of the getter for this property.setterName
- The name of the setter for this property.public int compareTo(PropertyMeta that)
PropertyMeta
field to another. This method defines the natural sort of
this object, which is first in ascending order by extent (0 for scalar fields, thus, they
sort first). Fields of the same extent are sorted in ascending order by ID.
This sort does not match the legacy order of the fields, but is instead organized for the case where the fields are used within SQL statements, in which case they need to be in a well-known order.
compareTo
in interface java.lang.Comparable<PropertyMeta>
that
- PropertyMeta
object with which to compare.that
instance;
0 if they should sort equally;
positive value if this instance should sort after that
instance.public int getId()
public int getOffset()
data
array of the BaseRecord
.
In case on extent properties, this is the offset of the first element.data
array. For extent fields, this is the
offset of the first element.public java.lang.Class<? extends BaseDataType> getType()
public int getDecimals()
decimal
fields only) ad defined in
the field declaration. The method returns 0 when no such declaration was encountered in ABL source, but
the default value to be used in this case is 10.decimal
field.public boolean isCaseSensitive()
character
data this method is expected to
return true
.true
if this is a case-sensitive character property.boolean isCharacter()
character
type.true
if the type of this property is character
and false
otherwise.boolean isDateTimeTz()
datetime-tz
type.true
if the type of this property is datetime-tz
and false
otherwise.public DataHandler getDataHandler()
DataHandler
used for setting a value of this property as a parameter
in a prepared query. It will automatically handle null
values.DataHandler
for values of this property.public java.lang.String getColumn()
public java.lang.String getName()
public java.lang.String getLegacyName()
public int getExtent()
public boolean isMandatory()
true
for mandatory fields.public boolean isReserved()
true
if the referenced property is reserved.public int getOriginalExtent()
public java.lang.String getOriginalName()
Only denormalized properties will have a non-empty string for this value. All other properties, scalar or otherwise, will report empty string.
public java.lang.Object getInitialValue()
public java.lang.String getFormat()
public java.lang.String toString()
toString
in class java.lang.Object