From df9c5e5cb33bb034fc10abbe5664a27aa85e032e Mon Sep 17 00:00:00 2001 From: whp98 <32877126+whp98@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:09:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83=E5=8D=9A=E5=AE=A2=EF=BC=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4:2024/11/25=2015:09:19?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...264\345\212\240\347\256\200\345\215\225.md" | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git "a/docs/\345\220\216\347\253\257\345\274\200\345\217\221/quarkus/Quarkus\347\232\204Panache\350\256\251\344\275\240\345\206\231\346\225\260\346\215\256\345\272\223\344\272\244\344\272\222\346\233\264\345\212\240\347\256\200\345\215\225.md" "b/docs/\345\220\216\347\253\257\345\274\200\345\217\221/quarkus/Quarkus\347\232\204Panache\350\256\251\344\275\240\345\206\231\346\225\260\346\215\256\345\272\223\344\272\244\344\272\222\346\233\264\345\212\240\347\256\200\345\215\225.md" index eb91512b8..04098681f 100644 --- "a/docs/\345\220\216\347\253\257\345\274\200\345\217\221/quarkus/Quarkus\347\232\204Panache\350\256\251\344\275\240\345\206\231\346\225\260\346\215\256\345\272\223\344\272\244\344\272\222\346\233\264\345\212\240\347\256\200\345\215\225.md" +++ "b/docs/\345\220\216\347\253\257\345\274\200\345\217\221/quarkus/Quarkus\347\232\204Panache\350\256\251\344\275\240\345\206\231\346\225\260\346\215\256\345\272\223\344\272\244\344\272\222\346\233\264\345\212\240\347\256\200\345\215\225.md" @@ -6,6 +6,7 @@ https://cn.quarkus.io/guides/hibernate-orm-panache ## 如何简单使用 + ### 1. 创建实体类 ```java @@ -40,4 +41,19 @@ return Result.ok(all.firstResult()); ```java PanacheQuery all = Book.findAll(Sort.by("id", Sort.Direction.Descending)).page(dto.getCurrentPage() - 1, dto.getPageSize()); -``` \ No newline at end of file +``` + +### 5.保存数据 +```java +Book book = new Book(); +book.title = "Java"; +book.author = "xxx"; +book.persist(); +``` +### 6.删除数据 + +```java +Book book = Book.findById(1L); +book.delete(); +``` +