@Target(value=TYPE) @Retention(value=RUNTIME) @Inherited @Documented public @interface Model
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
autodetectTypes
If true the model generator tries to auto-detect the type of a field when no
ModelField annotation is present. |
String |
clientIdProperty
The name of the property a server will use to send back a client-generated id in a
create or update operation.
|
String |
createMethod
Specifies the create method.
|
String |
destroyMethod
Specifies the destroy method.
|
boolean |
disablePagingParameters
If set to true the pageParam, startParam and limitParam option of the proxy will be
set to undefined (Ext JS 4), false (Sencha Touch 2) or '' (Ext JS 5).
|
String |
extend
"Superclass" of this model.
|
String |
identifier
The id generator to use for this model.
|
String |
idProperty
Name of the id property.
|
String |
messageProperty
If set add to reader
|
boolean |
paging
If true a reader config with root : 'records' (Ext JS 4) or rootProperty :
'records' (Sencha Touch 2 and Ext JS 5) will be added to the model object.
|
String |
reader
If set adds a reader config to the proxy object.
|
String |
readMethod
Specifies the read method.
|
String |
rootProperty
If set a reader config with root : 'rootProperty' (Ext JS 4) or rootProperty :
'rootProperty' (Sencha Touch 2 and Ext JS 5) will be added to the model object.
|
String |
successProperty
If set add to reader
|
String |
totalProperty
If set add to reader
|
String |
updateMethod
Specifies the update method.
|
String |
value
"Classname" of the model.
|
String |
versionProperty
If specified, this is the name of the property that contains the entity "version".
|
boolean |
writeAllFields
If specified the generator adds a writer config object to the proxy with
writeAllFields.
|
String |
writer
If set adds a writer config to the proxy object.
|
public abstract boolean autodetectTypes
ModelField annotation is present.
If false every field that is not annotated with ModelField or contains an
empty ModelField.type() attribute is set to the type ModelType.AUTO
public abstract String value
If not present full qualified name of the class is used.
public abstract String extend
Defaults to "Ext.data.Model"
public abstract String idProperty
If not present default value of 'id' is used.
This is an alternative to the ModelId annotation. The annotation takes
precedence if both are present.
public abstract String versionProperty
This is an alternative to the ModelVersion annotation. The annotation takes
precedence if both are present.
See Ext.data.Model#versionProperty
Defaults to null
public abstract String clientIdProperty
This is an alternative to the ModelClientId annotation. The annotation
takes precedence if both are present.
See Ext.data.Model#clientIdProperty
Defaults to null
public abstract boolean paging
reader : {
rootProperty : 'records'
}
Default value is false. To set a specific value to the root property use
rootProperty()public abstract boolean disablePagingParameters
proxy: {
type: 'direct',
pageParam: undefined,
startParam: undefined,
limitParam: undefined,
}
Default value is falsepublic abstract String readMethod
If only the readMethod is specified the generator will write the property directFn instead.
public abstract String createMethod
public abstract String updateMethod
public abstract String destroyMethod
public abstract String messageProperty
reader : {
messageProperty : 'your property name'
}
It is useful to add a customized message in case of error See Ext.data.reader.Reader#messagePropertypublic abstract String writer
proxy: {
type: 'direct',
writer: {
type: 'mywriter'
}
}
See
Ext.data.proxy.Proxy#writer
Defaults to "json"
public abstract String reader
proxy: {
type: 'direct',
reader: {
type: 'myreader'
}
}
See Ext.data.proxy.Proxy#reader
Defaults to "json"
public abstract String successProperty
reader : {
successProperty : 'success'
}
See Ext.data.reader.Reader#successProperty
If not present default value 'success' is used.
public abstract String totalProperty
reader : {
totalProperty : 'total'
}
See Ext.data.reader.Reader#totalProperty
If not present default value 'total' is used.
public abstract String rootProperty
reader : {
rootProperty : 'rootProperty'
}
If paging() and rootProperty() are present
rootProperty() has precedence.
public abstract boolean writeAllFields
proxy: {
type: 'direct',
writer: {
writeAllFields: true
}
}
See Ext.data.writer.WriterView#writeAllFields
Defaults to true
public abstract String identifier
Defaults to null
Copyright © 2013–2015. All rights reserved.