AS AgentScopeAPI 手册 / API Reference

ManagedSessionEntityRepository

public interface ManagedSessionEntityRepository extends JpaRepository<ManagedSessionEntity, Long>
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:23–42

定义托管会话 Entity 仓库契约的接口。位于 io.agentscope.builder.web.persistence.jpa 包,实现 JpaRepository<ManagedSessionEntity, Long>。核心成员包括 findBySessionId、findByOwnerIdOrderByCreatedAtDesc、findByOwnerIdAndAgentIdOrderByCreatedAtDesc、countByEnvironmentIdAndArchivedAtIsNull、findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc。

Spring Data repository for ManagedSessionEntity.

方法摘要Method Summary

方法Method说明Description
public Optional<ManagedSessionEntity> findBySessionId(String sessionId)
查找通过会话标识。
Finds the by session id.
public List<ManagedSessionEntity> findByOwnerIdOrderByCreatedAtDesc(String ownerId)
查找 `findByOwnerIdOrderByCreatedAtDesc`。
Finds the by owner id order by created at desc.
public List<ManagedSessionEntity> findByOwnerIdAndAgentIdOrderByCreatedAtDesc(String ownerId, String agentId)
查找 `findByOwnerIdAndAgentIdOrderByCreatedAtDesc`。
Finds the by owner id and agent id order by created at desc.
public long countByEnvironmentIdAndArchivedAtIsNull(String environmentId)
设置该参数。
Performs the count by environment id and archived at is null operation.
public Optional<ManagedSessionEntity> findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc(String ownerId, String agentId, String externalKey)
查找 `findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc`。
Finds the most recent non-archived session for a given owner/agent/external-key triple.

方法详情Method Detail

findBySessionId

public Optional<ManagedSessionEntity> findBySessionId(String sessionId)

查找通过会话标识。

Finds the by session id.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns Optional<ManagedSessionEntity>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:25

findByOwnerIdOrderByCreatedAtDesc

public List<ManagedSessionEntity> findByOwnerIdOrderByCreatedAtDesc(String ownerId)

查找 findByOwnerIdOrderByCreatedAtDesc。

Finds the by owner id order by created at desc.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
返回Returns List<ManagedSessionEntity>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:27

findByOwnerIdAndAgentIdOrderByCreatedAtDesc

public List<ManagedSessionEntity> findByOwnerIdAndAgentIdOrderByCreatedAtDesc(String ownerId, String agentId)

查找 findByOwnerIdAndAgentIdOrderByCreatedAtDesc。

Finds the by owner id and agent id order by created at desc.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
agentIdString智能体标识(类型 `String`)。The agent id.
返回Returns List<ManagedSessionEntity>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:29–30

countByEnvironmentIdAndArchivedAtIsNull

public long countByEnvironmentIdAndArchivedAtIsNull(String environmentId)

设置该参数。

Performs the count by environment id and archived at is null operation.

参数Parameters
名称Name类型Type说明Description
environmentIdString环境标识(类型 `String`)。The environment id.
返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:32

findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc

public Optional<ManagedSessionEntity> findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc(String ownerId, String agentId, String externalKey)

查找 findFirstByOwnerIdAndAgentIdAndExternalKeyAndArchivedAtIsNullOrderByCreatedAtDesc。

Finds the most recent non-archived session for a given owner/agent/external-key triple.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
agentIdString智能体标识(类型 `String`)。The agent id.
externalKeyString外部键(类型 `String`)。The external key.
返回Returns Optional<ManagedSessionEntity>
返回可选。Returns optional.
源码Source io/agentscope/builder/web/persistence/jpa/ManagedSessionEntityRepository.java:39–41
基于官方固定版本源码静态生成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.