AgentStateEntityRepository
public interface AgentStateEntityRepository extends JpaRepository<AgentStateEntity, Long>
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:26–53定义智能体状态 Entity 仓库契约的接口。位于 io.agentscope.builder.web.persistence.jpa 包,实现 JpaRepository<AgentStateEntity, Long>。核心成员包括 findByUserIdAndSessionIdAndStateKey、existsByUserIdAndSessionId、deleteByUserIdAndSessionId、deleteByUserIdAndSessionIdAndStateKey、findDistinctSessionIdsByUserId。
Spring Data repository for AgentStateEntity.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Optional<AgentStateEntity> findByUserIdAndSessionIdAndStateKey(String userId, String sessionId, String stateKey) | 查找通过用户标识和会话标识和状态键。 Finds the by user id and session id and state key. |
public boolean existsByUserIdAndSessionId(String userId, String sessionId) | 执行 `existsByUserIdAndSessionId` 方法。 Performs the exists by user id and session id operation. |
public void deleteByUserIdAndSessionId(String userId, String sessionId) | 删除通过用户标识和会话标识。 Deletes the by user id and session id. |
public void deleteByUserIdAndSessionIdAndStateKey(String userId, String sessionId, String stateKey) | 删除通过用户标识和会话标识和状态键。 Deletes the by user id and session id and state key. |
public List<String> findDistinctSessionIdsByUserId(String userId) | 查找 `findDistinctSessionIdsByUserId`。 Finds the distinct session ids by user id. |
方法详情Method Detail
findByUserIdAndSessionIdAndStateKey
public Optional<AgentStateEntity> findByUserIdAndSessionIdAndStateKey(String userId, String sessionId, String stateKey)
查找通过用户标识和会话标识和状态键。
Finds the by user id and session id and state key.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
stateKey | String | 状态键(类型 `String`)。The state key. |
Optional<AgentStateEntity>返回可选。Returns optional.
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:28–29existsByUserIdAndSessionId
public boolean existsByUserIdAndSessionId(String userId, String sessionId)
执行 existsByUserIdAndSessionId 方法。
Performs the exists by user id and session id operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:31deleteByUserIdAndSessionId
public void deleteByUserIdAndSessionId(String userId, String sessionId)
删除通过用户标识和会话标识。
Deletes the by user id and session id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:33–38deleteByUserIdAndSessionIdAndStateKey
public void deleteByUserIdAndSessionIdAndStateKey(String userId, String sessionId, String stateKey)
删除通过用户标识和会话标识和状态键。
Deletes the by user id and session id and state key.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
stateKey | String | 状态键(类型 `String`)。The state key. |
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:40–47findDistinctSessionIdsByUserId
public List<String> findDistinctSessionIdsByUserId(String userId)
查找 findDistinctSessionIdsByUserId。
Finds the distinct session ids by user id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
List<String>返回列出。Returns list.
源码Source
io/agentscope/builder/web/persistence/jpa/AgentStateEntityRepository.java:49–52