AS AgentScopeAPI 手册 / API Reference

JpaUserAgentDefinitionStore

@Transactional public class JpaUserAgentDefinitionStore implements UserAgentDefinitionStore
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:43–233

JPA 用户智能体定义存储,负责持久化与读取数据。位于 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.

参数Parameters
名称Name类型Type说明Description
repositoryAgentEntityRepository仓库(类型 `AgentEntityRepository`)。The repository.
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:53–55

方法详情Method Detail

list

public List<StoredEntry> list(String userId)

设置列表。

Performs the list operation.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
返回Returns List<StoredEntry>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:57–63

findById

public Optional<StoredEntry> findById(String userId, String agentId)

查找通过标识。

Finds the by id.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns Optional<StoredEntry>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:65–71

save

public StoredEntry save(String userId, StoredEntry entry)

保存数据到持久化存储。

Performs the save operation.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
entryStoredEntry条目(类型 `StoredEntry`)。The entry.
返回Returns StoredEntry
返回StoredEntry。Returns stored entry.
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:73–133

delete

public boolean delete(String userId, String agentId)

删除数据。

Performs the delete operation.

参数Parameters
名称Name类型Type说明Description
userIdString用户标识(类型 `String`)。The user id.
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/builder/web/persistence/jpa/JpaUserAgentDefinitionStore.java:135–145
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.