## Table Model Classes A model class represents a single table within your database. Fields within your model class represent columns in the table. The object types of your fields are reflectively mapped to SQL types by iciql at runtime. Models can be manually written using one of three approaches: *annotation configuration*, *interface configuration*, or *POJO configuration*. All approaches can be used within a project and all can be used within a single model class, although that is discouraged. Alternatively, model classes can be automatically generated by iciql using the model generation tool. Please see the [tools](tools.html) page for details. ### Configuration Requirements and Limitations 1. Your model class **must** provide a public default constructor. 2. All **Object** fields are assumed NULLABLE unless explicitly set *@IQColumn(nullable = false)* or *Define.nullable(field, false)*. 3. All **Primitive** fields are assumed NOT NULLABLE unless explicitly set *@IQColumn(nullable = true)* or *Define.nullable(field, true)*. 4. Only the specified types are supported. Any other types are not supported. 5. Triggers, views, and other advanced database features are not supported. ### Standard Supported Data Types ---NOMARKDOWN---
Fully Supported Types can be used for all iciql expressions | ||
Object | Primitive | SQL Type |
---|---|---|
java.lang.String | VARCHAR (length > 0) or CLOB (length == 0) | |
java.lang.Boolean | boolean | BOOLEAN can only declare and explicitly reference one primitive boolean per model multiple primitives are allowed if not using where/set/on/and/or/groupBy/orderBy(boolean) |
java.lang.Byte | byte | TINYINT |
java.lang.Short | short | SMALLINT |
java.lang.Integer | int | INT |
java.lang.Long | long | BIGINT |
java.lang.Float | float | REAL |
java.lang.Double | double | DOUBLE |
java.math.BigDecimal | DECIMAL (length == 0) or DECIMAL(length,scale) (length > 0) | |
java.sql.Date | DATE | |
java.sql.Time | TIME | |
java.sql.Timestamp | TIMESTAMP | |
java.util.Date | TIMESTAMP | |
java.lang.Enum.name() default type | VARCHAR (length > 0) or CLOB (length == 0) EnumType.NAME can only declare and explicitly reference one instance of each enum type per model multiple instances of an enum type within a model is allowed if not using where/set/on/and/or/groupBy/orderBy(enum) | |
java.lang.Enum.ordinal() | INT EnumType.ORDINAL can only declare and explicitly reference one instance of each enum type per model multiple instances of an enum type within a model is allowed if not using where/set/on/and/or/groupBy/orderBy(enum) | |
java.lang.Enum implements com.iciql.Iciql.EnumId.enumId() | variable EnumType.ENUMID can only declare and explicitly reference one instance of each enum type per model multiple instances of an enum type within a model is allowed if not using where/set/on/and/or/groupBy/orderBy(enum) | |
Partially Supported Types can not be directly referenced in an expression | ||
byte [] | BLOB | |
Custom | create a DataTypeAdapter<Custom> | Custom |
H2 Database Types fully supported when paired with an H2 database | ||
java.util.UUID | UUID |