@Bind
xcesco edited this page Apr 6, 2018
·
5 revisions
This annotation allows binding a specific field in a class when it is marked with @BindType(allFields=false)
. If allFields
is set to true (as default), it is no useful use this annotation on fields.
You can mark public fields and fields with getter and setter.
For example, if we have a class definition like:
@BindType(allFields=false)
public class Friend {
public int id;
@BindType
public String name;
}
The JSON rapresentation is:
{"name":"dummy name"}
And XML rapresentation is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><friend><name>dummy name</name></friend>
As you can note, id field is not persisted on JSON or XML.
- enabled: true if this field must be persisted. Note that @BindDisabled annotation overrides this value.
- value: The name of the element.
- mapKeyName: name of the element represents key of a map's entry. Used only by map type.
- mapValueName: name of the element represents the value of a map's entry. Used only by map type.
- order: specifies the order of POJO fields during mapping. The order is specified the entire schema.
- 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