UserEntity
@Entity @Table( name = "builder_user", indexes = { @Index(name = "ix_builder_user_username", columnList = "username", unique = true) }) public class UserEntity
io/agentscope/builder/web/persistence/jpa/UserEntity.java:34–110用户 Entity,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.builder.web.persistence.jpa 包。核心成员包括 getUserId、setUserId、getUsername、setUsername、getPasswordHash、setPasswordHash。
Persistent representation of a builder user. Keyed by stable userId (the same value
used as the HarnessAgent namespace key on disk in file mode) so migration from a JSON store
preserves all references.
Roles are stored as a comma-separated string to keep the schema portable across MySQL,
PostgreSQL and H2 without introducing a join table. The username column is unique and
indexed for fast findByUsername lookups.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public UserEntity() | 初始化 `UserEntity` 实例。 Creates a new instance. |
public UserEntity(String userId, String username, String passwordHash, String rolesCsv) | 初始化 `UserEntity` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getUserId() | 获取用户标识。 Returns the user id. |
public void setUserId(String userId) | 设置用户标识。 Sets the user id. |
public String getUsername() | 获取 `getUsername`。 Returns the username. |
public void setUsername(String username) | 设置 `setUsername`。 Sets the username. |
public String getPasswordHash() | 获取 `getPasswordHash`。 Returns the password hash. |
public void setPasswordHash(String passwordHash) | 设置 `setPasswordHash`。 Sets the password hash. |
public String getRolesCsv() | 获取 `getRolesCsv`。 Returns the roles csv. |
public void setRolesCsv(String rolesCsv) | 设置 `setRolesCsv`。 Sets the roles csv. |
public Instant getCreatedAt() | 获取已创建 At。 Returns the created at. |
public void setCreatedAt(Instant createdAt) | 设置已创建 At。 Sets the created at. |
构造器详情Constructor Detail
UserEntity
public UserEntity()
初始化 UserEntity 实例。
Creates a new instance.
io/agentscope/builder/web/persistence/jpa/UserEntity.java:62UserEntity
public UserEntity(String userId, String username, String passwordHash, String rolesCsv)
初始化 UserEntity 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
username | String | username(类型 `String`)。The username. |
passwordHash | String | 密码 Hash(类型 `String`)。The password hash. |
rolesCsv | String | roles Csv(类型 `String`)。The roles csv. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:64–69方法详情Method Detail
getUserId
public String getUserId()
获取用户标识。
Returns the user id.
Stringio/agentscope/builder/web/persistence/jpa/UserEntity.java:71–73setUserId
public void setUserId(String userId)
设置用户标识。
Sets the user id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
userId | String | 用户标识(类型 `String`)。The user id. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:75–77getUsername
public String getUsername()
获取 getUsername。
Returns the username.
Stringio/agentscope/builder/web/persistence/jpa/UserEntity.java:79–81setUsername
public void setUsername(String username)
设置 setUsername。
Sets the username.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
username | String | username(类型 `String`)。The username. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:83–85getPasswordHash
public String getPasswordHash()
获取 getPasswordHash。
Returns the password hash.
Stringio/agentscope/builder/web/persistence/jpa/UserEntity.java:87–89setPasswordHash
public void setPasswordHash(String passwordHash)
设置 setPasswordHash。
Sets the password hash.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
passwordHash | String | 密码 Hash(类型 `String`)。The password hash. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:91–93getRolesCsv
public String getRolesCsv()
获取 getRolesCsv。
Returns the roles csv.
Stringio/agentscope/builder/web/persistence/jpa/UserEntity.java:95–97setRolesCsv
public void setRolesCsv(String rolesCsv)
设置 setRolesCsv。
Sets the roles csv.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
rolesCsv | String | roles Csv(类型 `String`)。The roles csv. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:99–101getCreatedAt
public Instant getCreatedAt()
获取已创建 At。
Returns the created at.
Instantio/agentscope/builder/web/persistence/jpa/UserEntity.java:103–105setCreatedAt
public void setCreatedAt(Instant createdAt)
设置已创建 At。
Sets the created at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
createdAt | Instant | 已创建 At(类型 `Instant`)。The created at. |
io/agentscope/builder/web/persistence/jpa/UserEntity.java:107–109