-
Notifications
You must be signed in to change notification settings - Fork 16
@BindSqlType
xcesco edited this page May 14, 2018
·
2 revisions
This annotation allows to manage the class as data model and will instruct Kripton to generate an associated table in the data source that contains it. This annotation allows to specify the table name and the
When a class is converted to a table, the name of the table is obtained from Java class name with an upper camel to Lower underscore conversion. For example SayHello
class name will be transformed into say_hello
table name.
This annotation allows specifying the name of the associated table associated with a Java class. Note that specified name will be transformed like a Java class name.
- indexes: allows defining indexes on the table. See @BindIndex for more informations.
- name: name of the table.
@BindSqlType(
name="ws_bean",
indexes= {
@BindIndex({"birthCity", "birthDay desc"}),
@BindIndex({"surname"}),
@BindIndex(value={"name","surname", "date desc"}, unique=true )
}
)
public class Person {
...
}
Its associated table name is ws_bean
and it will generate the following table definition:
CREATE TABLE ws_bean (id INTEGER PRIMARY KEY AUTOINCREMENT, alias_name TEXT UNIQUE, date TEXT, name TEXT, surname TEXT, birth_city TEXT, birth_day TEXT);
CREATE INDEX idx_person_name ON person(name); CREATE INDEX idx_person_surname ON person(surname);
CREATE UNIQUE INDEX idx_person_0 on person (name, surname, date desc);
CREATE INDEX idx_person_0 on person (birth_city, birth_day desc);
CREATE INDEX idx_person_1 on person (surname);
- Introduction
- Goals & Features
- Kotlin
- Immutable or Mutable Pojo
- Annotation Processor Args
- Credits
- Articles
- Benchmarks
- Setup
- Tutorial
- Usage
- Dependencies and inspirations
- Stackoverflow
- Documentation
- SQL logging
- Data source options
- Indices
- SQL Type adapter
- Global SQL Type adapter
- Constraints
- Live data: welcome Architectural components!!
- Paged Live data
- Dynamic parts
- Transactional and batch operations
- Async Transactional and batch operations
- Global transaction
- Support for immutable POJO
- Generate Content provider
- Generate Database schema generation
- Database migration
- BindSqlColumn
- BindContentProvider
- BindContentProviderEntry
- BindContentProviderPath
- BindDao
- BindDaoMany2Many
- BindDataSource
- BindDataSourceOptions
- BindDataSourceUpdateTask
- BindIndex
- BindSqlRelation
- BindSqlAdapter
- BindSqlChildSelect
- BindSqlDelete
- BindSqlDynamicOrderBy
- BindSqlDynamicWhere
- BindSqlDynamicWhereParams
- BindSqlInsert
- BindSqlPageSize
- BindSqlParam
- BindSqlSelect
- BindSqlUpdate
- BindSqlType
- BindSqlTransaction