JpaUserAgentDefinitionStore
@Transactional public class JpaUserAgentDefinitionStore implements UserAgentDefinitionStore
io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:43–233JPA 用户智能体定义存储,负责持久化与读取数据。位于 io.agentscope.builder.web.persistence.jpa 包,实现 UserAgentDefinitionStore。核心成员包括 list、findById、save、delete、JpaUserAgentDefinitionStore。
JPA-backed UserAgentDefinitionStore. This is the only UserAgentDefinitionStore
implementation shipped with the builder; it is always wired in by JpaPersistenceConfig.
Reads and writes go through a single transaction per call.
The workspace_path column persists the user-supplied workspace path verbatim (null
for "use the default location"). Combined with SharedWorkspacePaths#resolveAgentDataPath, operators can derive the on-disk root from a single
SQL query without re-deriving the convention in application code.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public JpaUserAgentDefinitionStore(AgentEntityRepository repository) | 初始化 `JpaUserAgentDefinitionStore` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<StoredEntry> list(String userId) | 设置列表。 Performs the list operation. |
public Optional<StoredEntry> findById(String userId, String agentId) | 查找通过标识。 Finds the by id. |
public StoredEntry save(String userId, StoredEntry entry) | 保存数据到持久化存储。 Performs the save operation. |
public boolean delete(String userId, String agentId) | 删除数据。 Performs the delete operation. |
构造器详情Constructor Detail
JpaUserAgentDefinitionStore
public JpaUserAgentDefinitionStore(AgentEntityRepository repository)
初始化 JpaUserAgentDefinitionStore 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
repository | AgentEntityRepository | 仓库(类型 `AgentEntityRepository`)。The repository. |
io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:53–55方法详情Method Detail
list
public List<StoredEntry> list(String userId)
设置列表。
Performs the list operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
List<StoredEntry>io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:57–63findById
public Optional<StoredEntry> findById(String userId, String agentId)
查找通过标识。
Finds the by id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
Optional<StoredEntry>io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:65–71save
public StoredEntry save(String userId, StoredEntry entry)
保存数据到持久化存储。
Performs the save operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
entry | StoredEntry | 条目(类型 `StoredEntry`)。The entry. |
StoredEntryio/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:73–133delete
public boolean delete(String userId, String agentId)
删除数据。
Performs the delete operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
agentId | String | 智能体标识(类型 `String`)。The agent id. |
booleanio/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:135–145