Skip to content

Commit 7480957

Browse files
author
Mark
committed
updated docu
1 parent 37c110f commit 7480957

File tree

4 files changed

+91
-13
lines changed

4 files changed

+91
-13
lines changed

docs/aql.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ E.g. get all Simpsons aged 3 or older in ascending order:
2424
ArangoCursor<MyObject> cursor = db.query(query, bindVars, null, MyObject.class);
2525

2626
cursor.forEachRemaining(obj -> {
27-
System.out.println(obj.getName());
28-
});
27+
System.out.println(obj.getName());
28+
});
2929
```
3030

3131
or return the AQL result as VelocyPack:
@@ -34,6 +34,6 @@ or return the AQL result as VelocyPack:
3434
ArangoCursor<VPackSlice> cursor = db.query(query, bindVars, null, VPackSlice.class);
3535

3636
cursor.forEachRemaining(obj -> {
37-
System.out.println(obj.get("name").getAsString());
38-
});
37+
System.out.println(obj.get("name").getAsString());
38+
});
3939
```

docs/documentation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
#Documentation overview
2+
13
* [Driver Setup](setup.md)
24
* [Basic database operations](basic_operations.md)
35
* [Multi document operations](multi_operations.md)
6+
* [serialization/deserialization](serialization.md)
47
* [User Management](user_management.md)
58
* [AQL](aql.md)
69
* [Graphs](graphs.md)

docs/serialization.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# serialization / deserialization
2+
## JavaBeans
3+
The driver can serialize/deserialize JavaBeans. They need at least a constructor without parameter.
4+
5+
``` Java
6+
public class MyObject {
7+
8+
private String name;
9+
private Gender gender;
10+
private int age;
11+
12+
public MyObject() {
13+
super();
14+
}
15+
16+
}
17+
```
18+
19+
## internal fields
20+
To use Arango-internal fields (like _id, _key, _rev, _from, _to) in your JavaBeans, use the annotation `DocumentField`.
21+
22+
``` Java
23+
public class MyObject {
24+
25+
@DocumentField(Type.KEY)
26+
private String key;
27+
28+
private String name;
29+
private Gender gender;
30+
private int age;
31+
32+
public MyObject() {
33+
super();
34+
}
35+
36+
}
37+
```
38+
39+
## serialized fieldnames
40+
To use a different serialized name for a field, use the annotation `SerializedName`.
41+
42+
``` Java
43+
public class MyObject {
44+
45+
@SerializedName("title")
46+
private String name;
47+
48+
private Gender gender;
49+
private int age;
50+
51+
public MyObject() {
52+
super();
53+
}
54+
55+
}
56+
```
57+
58+
## ignore fields
59+
To ignore fields at serialization/deserialization, use the annotation `Expose`
60+
61+
``` Java
62+
public class MyObject {
63+
64+
@Expose
65+
private String name;
66+
@Expose(serialize = true, deserialize = false)
67+
private Gender gender;
68+
private int age;
69+
70+
public MyObject() {
71+
super();
72+
}
73+
74+
}
75+
```

docs/setup.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Setup with default configuration, this automatically loads a properties file ara
1212
The driver is configured with some default values:
1313

1414
<table>
15-
<tr><th>property-key</th><th>description</th><th>default value</th></tr>
16-
<tr><td>arangodb.host</td><td>ArangoDB host</td><td>127.0.0.1</td></tr>
17-
<tr><td>arangodb.port</td><td>ArangoDB port</td><td>8529</td></tr>
18-
<tr><td>arangodb.timeout</td><td>socket connect timeout(millisecond)</td><td>0</td></tr>
19-
<tr><td>arangodb.user</td><td>Basic Authentication User</td><td></td></tr>
20-
<tr><td>arangodb.password</td><td>Basic Authentication Password</td><td></td></tr>
21-
<tr><td>arangodb.useSsl</td><td>use SSL connection</td><td>false</td></tr>
22-
<tr><td>harangodb.chunksize</td><td>VelocyStream Chunk content-size(bytes)</td><td>30000</td></tr>
23-
</table>
15+
<tr><th>property-key< h><th>description< h><th>default value< h>< r>
16+
<tr><td>arangodb.host< d><td>ArangoDB host< d><td>127.0.0.1< d>< r>
17+
<tr><td>arangodb.port< d><td>ArangoDB port< d><td>8529< d>< r>
18+
<tr><td>arangodb.timeout< d><td>socket connect timeout(millisecond)< d><td>0< d>< r>
19+
<tr><td>arangodb.user< d><td>Basic Authentication User< d><td>< d>< r>
20+
<tr><td>arangodb.password< d><td>Basic Authentication Password< d><td>< d>< r>
21+
<tr><td>arangodb.useSsl< d><td>use SSL connection< d><td>false< d>< r>
22+
<tr><td>harangodb.chunksize< d><td>VelocyStream Chunk content-size(bytes)< d><td>30000< d>< r>
23+
< able>
2424

2525
To customize the configuration the parameters can be changed in the code...
2626

0 commit comments

Comments
 (0)