Skip to content

Commit 1aef145

Browse files
committed
notNull 在序列化的时候会失败,改成notnull
1 parent a6cd8f1 commit 1aef145

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,15 +857,15 @@ JBApp.exportInBackground("59dc970bce69f81448a2a119", new JBAppExportCallback() {
857857
"type":2,
858858
"internal":false,
859859
"security":false,
860-
"notNull":false
860+
"notnull":false
861861
},
862862
{
863863
"id":"59e970a212a0aa7f91bb0487",
864864
"name":"name",
865865
"type":1,
866866
"internal":false,
867867
"security":false,
868-
"notNull":false
868+
"notnull":false
869869
},
870870
Object{...}
871871
]
@@ -879,7 +879,7 @@ JBApp.exportInBackground("59dc970bce69f81448a2a119", new JBAppExportCallback() {
879879

880880
``` java
881881
try {
882-
String data = "{\"id\":\"59dc970bce69f81448a2a119\",\"name\":\"NewApp\",\"key\":\"cde5b8c5e097436aafe6377e33eeb003\",\"masterKey\":\"c57cd396c2034ef6a6ae1c74b7596730\",\"clazzs\":[{\"id\":\"59dc9869ce69f81448a2a13e\",\"name\":\"Test\",\"acl\":{\"*\":{\"find\":true,\"get\":true,\"insert\":true,\"update\":true,\"delete\":true}},\"internal\":false,\"fields\":[{\"id\":\"59dc9869ce69f81448a2a13f\",\"name\":\"count\",\"type\":2,\"internal\":false,\"security\":false,\"notNull\":false},{\"id\":\"59e970a212a0aa7f91bb0487\",\"name\":\"name\",\"type\":1,\"internal\":false,\"security\":false,\"required\":false}]}]}";
882+
String data = "{\"id\":\"59dc970bce69f81448a2a119\",\"name\":\"NewApp\",\"key\":\"cde5b8c5e097436aafe6377e33eeb003\",\"masterKey\":\"c57cd396c2034ef6a6ae1c74b7596730\",\"clazzs\":[{\"id\":\"59dc9869ce69f81448a2a13e\",\"name\":\"Test\",\"acl\":{\"*\":{\"find\":true,\"get\":true,\"insert\":true,\"update\":true,\"delete\":true}},\"internal\":false,\"fields\":[{\"id\":\"59dc9869ce69f81448a2a13f\",\"name\":\"count\",\"type\":2,\"internal\":false,\"security\":false,\"notnull\":false},{\"id\":\"59e970a212a0aa7f91bb0487\",\"name\":\"name\",\"type\":1,\"internal\":false,\"security\":false,\"required\":false}]}]}";
883883
JBApp.importData(data);
884884
System.out.println("导入应用成功");
885885
} catch (JBException e) {
@@ -1108,7 +1108,7 @@ try {
11081108
"type":1,
11091109
"internal":false,
11101110
"security":false,
1111-
"notNull":false
1111+
"notnull":false
11121112
}
11131113
]
11141114
}
@@ -1118,7 +1118,7 @@ try {
11181118
使用者拥有了当前应用的`master`管理权限后,可以导入表结构信息,需要注意的是只是导入表结构信息,不含表中文档内容。
11191119

11201120
```java
1121-
String data = "{\"id\":\"5a015ad3fa0a5737c68c1c9d\",\"name\":\"Sound\",\"acl\":{\"userId\":{\"delete\":true},\"*\":{\"find\":true,\"get\":true}},\"internal\":false,\"fields\":[{\"id\":\"5a016241fa0a5737c68c1c9e\",\"name\":\"title\",\"type\":1,\"internal\":false,\"security\":false,\"notNull\":false}]}";
1121+
String data = "{\"id\":\"5a015ad3fa0a5737c68c1c9d\",\"name\":\"Sound\",\"acl\":{\"userId\":{\"delete\":true},\"*\":{\"find\":true,\"get\":true}},\"internal\":false,\"fields\":[{\"id\":\"5a016241fa0a5737c68c1c9e\",\"name\":\"title\",\"type\":1,\"internal\":false,\"security\":false,\"notnull\":false}]}";
11221122
JBClazz.importDataInBackground(data, new JBImportCallback() {
11231123
@Override
11241124
public void done(boolean success, JBException e) {
@@ -1141,7 +1141,7 @@ name | 字段名称
11411141
type | 字段类型(详见 [字段类型说明](java-sdk.md#字段类型说明)
11421142
internal | 是否是内建字段,内建字段不能进行删除字段操作
11431143
security | 是否是安全字段,安全字段必须需要 master 管理权限才可以修改
1144-
notNull | 是否是必填字段
1144+
notnull | 是否是必填字段
11451145

11461146
>`JBField`提供的一些主要的方法为:
11471147
@@ -1178,7 +1178,7 @@ try {
11781178
JBField field = new JBField(1, "title");
11791179
field.setClazz(new JBClazz("Sound"));
11801180
// 是否必填,默认为false
1181-
field.setNotNull(true);
1181+
field.setNotnull(true);
11821182
// 是否内建,默认为false
11831183
field.setInternal(true);
11841184
// 是否为安全字段,安全字段信息在获取数据时不会带出,默认为false

src/main/java/com/javabaas/javasdk/JBField.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public class JBField {
2626
/**
2727
* 必填字段
2828
*/
29-
private boolean notNull;
29+
private boolean notnull;
3030
/**
3131
* 只读字段
3232
*/
33-
private boolean readOnly;
33+
private boolean readonly;
3434

3535
public JBField() {
3636
}
@@ -88,20 +88,20 @@ public void setSecurity(boolean security) {
8888
this.security = security;
8989
}
9090

91-
public boolean isNotNull() {
92-
return notNull;
91+
public boolean isNotnull() {
92+
return notnull;
9393
}
9494

95-
public void setNotNull(boolean notNull) {
96-
this.notNull = notNull;
95+
public void setNotnull(boolean notnull) {
96+
this.notnull = notnull;
9797
}
9898

99-
public boolean isReadOnly() {
100-
return readOnly;
99+
public boolean isReadonly() {
100+
return readonly;
101101
}
102102

103-
public void setReadOnly(boolean readOnly) {
104-
this.readOnly = readOnly;
103+
public void setReadonly(boolean readonly) {
104+
this.readonly = readonly;
105105
}
106106

107107
/**
@@ -211,7 +211,7 @@ public void onFailure(JBException error) {
211211

212212
/**
213213
* 更新字段信息 同步<br/>
214-
* 目前更新字段信息只能更新字段security和notNull信息
214+
* 目前更新字段信息只能更新字段security和notnull信息
215215
*
216216
* @throws JBException 异常信息
217217
*/
@@ -231,7 +231,7 @@ public void done(boolean success, JBException e) {
231231

232232
/**
233233
* 更新字段信息 异步<br/>
234-
* 目前更新字段信息只能更新字段security和notNull信息
234+
* 目前更新字段信息只能更新字段security和notnull信息
235235
*
236236
* @param callback
237237
*/
@@ -420,8 +420,8 @@ private Map<String,Object> getFieldMap() {
420420
map.put("type", getType());
421421
map.put("internal", isInternal());
422422
map.put("security", isSecurity());
423-
map.put("notNull", isNotNull());
424-
map.put("readonly", isReadOnly());
423+
map.put("notnull", isNotnull());
424+
map.put("readonly", isReadonly());
425425
return map;
426426
}
427427

@@ -431,7 +431,7 @@ public static class JBFieldExport {
431431
private int type;
432432
private boolean internal;
433433
private boolean security;
434-
private boolean notNull;
434+
private boolean notnull;
435435
private boolean readonly;
436436

437437
public String getId() {
@@ -474,12 +474,12 @@ public void setSecurity(boolean security) {
474474
this.security = security;
475475
}
476476

477-
public boolean isNotNull() {
478-
return notNull;
477+
public boolean isNotnull() {
478+
return notnull;
479479
}
480480

481-
public void setNotNull(boolean notNull) {
482-
this.notNull = notNull;
481+
public void setNotnull(boolean notnull) {
482+
this.notnull = notnull;
483483
}
484484

485485
public boolean isReadonly() {

0 commit comments

Comments
 (0)