@Target(value=TYPE) @Retention(value=RUNTIME) public @interface DomainModel
| 限定符和类型 | 可选元素和说明 |
|---|---|
boolean |
allFieldsPersistent
This option indicates the most of field can save into database,
however the domain model can be applied into lots of different scenarios,
sometimes, only few field can save into database, so the option defined.
|
String |
dataSource
Defines a customized name of
DataSource in multi-data source time. |
boolean |
fluent
It indicates the
DomainModel has fluent method for setting field. |
Class<?> |
primaryClass
Changes the primary type if it is different data type in the database.
|
String |
primaryColumnName
Customizes the column name mapped for the domain model
|
String |
primaryFieldName
Customizes the field name for mapping the column
|
String |
primaryKeyDefaultValue
Default value for primary key, in general, it is a auto increment identifier
at inserting.
|
boolean |
skipNullValueOnUpdating
Skips the null value of field when updating a domain model if true
Returns false if the null value can save into the database.
|
boolean |
skipPrimaryValueOnInsert
Indicates the primary key is auto generated, and the SQL will ignore the
value of 'id' when domain object inserted.
|
String |
tableName
Returns the table name customized.
|
public abstract String tableName
DomainModel annotation while it's out of the rule.WordUtil.tableize(String)public abstract String dataSource
DataSource in multi-data source time.
By default, a named 'objsql-default-datasource' will be used, the application should
be named that way.public abstract boolean fluent
DomainModel has fluent method for setting field.
Model model = new Model();
model.setField1(...)
.setField2(...)
.setField3(...);
You can disable the feature if in special scenes.public abstract Class<?> primaryClass
Integer is used for a primary key as the mapping of database.public abstract String primaryColumnName
public abstract String primaryFieldName
public abstract boolean skipNullValueOnUpdating
public abstract boolean allFieldsPersistent
public abstract String primaryKeyDefaultValue
Copyright © 2020 com.github.braisdom. All rights reserved.