b02e532563
Move flat docs/diagrams/*.puml into a hierarchy matching the source
package structure:
docs/diagrams/
├── bootstrap-sequence.puml (cross-cutting)
├── events-diagram.puml (cross-feature)
├── util/
│ ├── command-class-diagram.puml
│ ├── database-diagram.puml
│ ├── messages-class-diagram.puml
│ ├── broadcasts-class-diagram.puml
│ └── gui-class-diagram.puml
└── features/
├── team/
│ ├── team-class-diagram.puml
│ ├── team-config-class-diagram.puml
│ ├── builtin-commands-diagram.puml
│ ├── team-create-sequence.puml
│ ├── team-create-activity.puml
│ └── team-join-sequence.puml
├── player/
│ └── player-class-diagram.puml
└── moderation/
└── moderation-class-diagram.puml
README.md diagram index split into 4 sections (overview, util,
features/team, features/player, features/moderation) for readability;
all links updated. features.md auto-updated by sed for the new paths.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
87 lines
1.9 KiB
Plaintext
87 lines
1.9 KiB
Plaintext
@startuml database-diagram
|
|
title CR-Core — Database (SQLite wrapper)
|
|
|
|
skinparam classAttributeIconSize 0
|
|
hide empty members
|
|
|
|
package "fr.luc.crcore.util.database" {
|
|
|
|
class Database {
|
|
- connection: Connection
|
|
+ Database(file: File)
|
|
+ execute(sql, params...): void
|
|
+ update(sql, params...): int
|
|
+ queryOne(sql, mapper, params...): Optional<T>
|
|
+ query(sql, mapper, params...): List<T>
|
|
+ inTransaction(block: Runnable): void
|
|
+ table(name: String): TableBuilder
|
|
+ tableExists(name: String): boolean
|
|
+ getConnection(): Connection
|
|
+ close(): void
|
|
}
|
|
Database ..|> "java.lang.AutoCloseable"
|
|
|
|
class TableBuilder {
|
|
- database: Database
|
|
- name: String
|
|
- columns: List<ColumnDef>
|
|
- ifNotExists: boolean
|
|
+ ifNotExists(): TableBuilder
|
|
+ column(name, type): ColumnDef
|
|
+ create(): void
|
|
}
|
|
|
|
class "TableBuilder.ColumnDef" as ColumnDef {
|
|
- name: String
|
|
- type: ColumnType
|
|
- primaryKey: boolean
|
|
- notNull: boolean
|
|
- unique: boolean
|
|
- defaultValue: String
|
|
+ primaryKey(): ColumnDef
|
|
+ notNull(): ColumnDef
|
|
+ unique(): ColumnDef
|
|
+ defaultValue(expr: String): ColumnDef
|
|
+ column(name, type): ColumnDef
|
|
+ create(): void
|
|
}
|
|
|
|
enum ColumnType {
|
|
INTEGER
|
|
REAL
|
|
TEXT
|
|
BLOB
|
|
BOOLEAN
|
|
UUID
|
|
--
|
|
+ getSqlType(): String
|
|
}
|
|
|
|
interface "RowMapper<T>" as RowMapper {
|
|
+ map(rs: ResultSet): T
|
|
}
|
|
|
|
class DatabaseException
|
|
DatabaseException --|> RuntimeException
|
|
|
|
Database "1" *-- "*" TableBuilder : creates
|
|
TableBuilder "1" *-- "*" ColumnDef : contains
|
|
ColumnDef --> ColumnType : type
|
|
Database ..> RowMapper : uses
|
|
Database ..> DatabaseException : throws
|
|
}
|
|
|
|
note right of Database
|
|
Repositories SQLite de CR-Core
|
|
(SqliteTeamRepository,
|
|
SqlitePlayerProfileRepository)
|
|
utilisent Database pour
|
|
persister state team/player.
|
|
|
|
Les plugins de jeu utilisent
|
|
Database.table(...) pour
|
|
créer leurs tables custom.
|
|
end note
|
|
|
|
@enduml
|