ResourceShareEntityRepository
public interface ResourceShareEntityRepository extends JpaRepository<ResourceShareEntity, Long>
源码Source
io/agentscope/builder/web/persistence/jpa/ResourceShareEntityRepository.java:23–34定义资源 Share Entity 仓库契约的接口。位于 io.agentscope.builder.web.persistence.jpa 包,实现 JpaRepository<ResourceShareEntity, Long>。核心成员包括 findByResourceTypeAndResourceId、findByShareId、findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId、deleteByShareId。
Spring Data repository for ResourceShareEntity.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public List<ResourceShareEntity> findByResourceTypeAndResourceId(String resourceType, String resourceId) | 查找通过资源类型和资源标识。 Finds the by resource type and resource id. |
public Optional<ResourceShareEntity> findByShareId(String shareId) | 查找 `findByShareId`。 Finds the by share id. |
public Optional<ResourceShareEntity> findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId(String resourceType, String resourceId, String granteeType, String granteeId) | 查找 `findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId`。 Finds the by resource type and resource id and grantee type and grantee id. |
public void deleteByShareId(String shareId) | 删除 `deleteByShareId`。 Deletes the by share id. |
方法详情Method Detail
findByResourceTypeAndResourceId
public List<ResourceShareEntity> findByResourceTypeAndResourceId(String resourceType, String resourceId)
查找通过资源类型和资源标识。
Finds the by resource type and resource id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
resourceType | String | 资源类型(类型 `String`)。The resource type. |
resourceId | String | 资源标识(类型 `String`)。The resource id. |
List<ResourceShareEntity>返回列出。Returns list.
源码Source
io/agentscope/builder/web/persistence/jpa/ResourceShareEntityRepository.java:25–26findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId
public Optional<ResourceShareEntity> findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId(String resourceType, String resourceId, String granteeType, String granteeId)
查找 findByResourceTypeAndResourceIdAndGranteeTypeAndGranteeId。
Finds the by resource type and resource id and grantee type and grantee id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
resourceType | String | 资源类型(类型 `String`)。The resource type. |
resourceId | String | 资源标识(类型 `String`)。The resource id. |
granteeType | String | grantee 类型(类型 `String`)。The grantee type. |
granteeId | String | grantee 标识(类型 `String`)。The grantee id. |
Optional<ResourceShareEntity>返回可选。Returns optional.
源码Source
io/agentscope/builder/web/persistence/jpa/ResourceShareEntityRepository.java:30–31