Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
firestar authored Jan 31, 2024
1 parent fef3c30 commit 4be15ca
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ class Application {
public static void main(String[] args) {
Set<DataEntry> first = nucleoDB.getTable(Author.class).get("name", "test", new DataEntryProjection(){{
setWritable(true);
setLockUntilWrite(true);
}});
}
}
```

##### Write data
##### Create data entry

```java
class Application{
Expand All @@ -83,14 +84,29 @@ class Application{
}
```

##### Update data entry

```java
class Application{
public static void main(String[] args) {
// read data
// AuthorDE author = AuthorDE()
// author.copy(AuthorDE.class, true); // lock entry for updating
author.getData().setName("Edgar Allen Poe");
nucleoDB.getTable(Author.class).saveSync(author);
}
}
```

##### Delete data

```java
class Application{
public static void main(String[] args) {
// read data
// var author = AuthorDE()
// AuthorDE author = AuthorDE()
// author.copy(AuthorDE.class, true); // lock entry for deletion
nucleoDB.getTable(Author.class).deleteSync(author);
}
}
```
```

0 comments on commit 4be15ca

Please sign in to comment.