5.7.3. Data type mappings
MetaFactory contains 2 hardcoded maps (javaTypes and hibernateTypes). The maps functionality should be used to modify a built-in map or to add your own map (but this functionality is not implemented yet).
The following maps are defined by MetaFactory:
javaTypes - maps pattern type (key) to java type (value)
hibernateTypes - maps pattern type (key) to hibernate type (value)
Pattern type |
Java type |
---|---|
big_decimal |
java.math.BigDecimal |
binary |
byte[] |
blob |
java.sql.Blob |
boolean |
boolean |
byte |
byte |
calendar_date |
java.util.Calendar |
calendar |
java.util.Calendar |
character |
Character |
clob |
java.sql.Clob |
Date |
java.util.Date |
DateTime |
java.util.Date |
double |
double |
Double |
Double |
float |
float |
Float |
Float |
int |
int |
integer |
int |
Integer |
Integer |
long |
long |
Long |
Long |
short |
short |
String |
String |
text |
String |
time |
java.sql.Time |
timestamp |
java.sql.Timestamp |
void |
void |
yes_no |
boolean |
Pattern type |
Hibernate type |
---|---|
big_decimal |
big_decimal |
binary |
binary |
blob |
blob |
boolean |
boolean |
Boolean |
boolean |
byte |
byte |
calendar_date |
calendar_date |
calendar |
calendar |
character |
character |
clob |
clob |
Date |
date |
DateTime |
timestamp |
double |
double |
Double |
double |
float |
float |
Float |
float |
integer |
integer |
Integer |
integer |
long |
long |
Long |
long |
short |
short |
Short |
short |
String |
string |
text |
text |
time |
time |
timestamp |
timestamp |
yes_no |
yes_no |
In the pattern a map can be used by applying the MetaFactory expression language (a simple version of el). The syntax is:
${map(mapName, key)}
Example
${map(javaTypes, big_decimal)}
which returns java.math.BigDecimal