1、包结构修改

2、dict的bug修改
3、arangodb查询find()默认1000条修改为库里所有数据
This commit is contained in:
2019-07-02 17:37:55 +08:00
parent bbf9b8b9c4
commit 972fb387c7
44 changed files with 397 additions and 248 deletions

View File

@@ -43,12 +43,12 @@ public abstract class Doc<T extends Doc> {
this._key = key;
}
public Doc<T> set(String k, Object v) {
protected Doc<T> set(String k, Object v) {
attr.put(k, v);
return this;
}
public <V> V get(String k) {
protected <V> V get(String k) {
return (V)attr.get(k);
}
@@ -212,16 +212,17 @@ public abstract class Doc<T extends Doc> {
return findFirst(arangoSource.parseAql(t, 0, 1), (Class<T>) t.getClass());
}
public List<T> find() {
return find((T) this, 0, 1000);
int count = count(this);
return find((T) this, 0, count);
}
public List<T> find(T t) {
return find(t, 0, 1000);
}
public <T extends Doc> List<T> find(T t, int offset, int pn) {
public <T extends Doc> List<T> find(T t, int offset, int ps) {
if (t == null) {
t = (T) this;
}
return find(arangoSource.parseAql(t, offset, pn), (Class<T>)this.getClass());
return find(arangoSource.parseAql(t, offset, ps), (Class<T>)this.getClass());
}
public <T> List<T> find(String aql, Class<T> clazz) {
@@ -230,7 +231,7 @@ public abstract class Doc<T extends Doc> {
} catch (ArangoDBException e) {
System.out.println(aql);
e.printStackTrace();
ArangoSource.init();
ArangoSource.use();
}
return db.query(aql, clazz).asListRemaining();
}
@@ -240,19 +241,19 @@ public abstract class Doc<T extends Doc> {
} catch (ArangoDBException e) {
System.out.println(aql);
e.printStackTrace();
ArangoSource.init();
ArangoSource.use();
}
return db.query(aql, clazz).first();
}
public long count() {
public int count() {
return count(this);
}
public <T extends Doc> long count(T t) {
public <T extends Doc> int count(T t) {
if (t == null) {
t = (T) this;
}
return db.query(arangoSource.parseAqlCount(t), long.class).first();
return db.query(arangoSource.parseAqlCount(t), int.class).first();
}
//ok
public <T extends Doc> T findByKey(Object key) {