Files
document-haness/docs/clean-architecture-backend-template/final/evidence/raw/a05-f012-identity.txt
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

52 lines
3.5 KiB
Plaintext

# 가드가 식별자를 찾는 방식
49: public boolean usesIdentityGeneration(Class<?> entityType) {
50: return identifierField(entityType)
51: .map(field -> field.getAnnotation(GeneratedValue.class))
52: .filter(Objects::nonNull)
53: .map(generated -> generated.strategy() == GenerationType.IDENTITY)
54: .orElse(false);
55: }
56:
57: /**
58: * Finds the {@code @Id} field, walking superclasses.
59: *
60: * <p>Superclasses are walked because a mapped superclass carrying the identifier is the common
61: * shape; stopping at the declared class would silently classify every such entity as "not
62: * identity" and let the guard pass on exactly the entities it was written for.
63: */
64: private static Optional<Field> identifierField(Class<?> entityType) {
65: for (Class<?> current = entityType;
66: current != null && current != Object.class;
67: current = current.getSuperclass()) {
68: for (Field field : current.getDeclaredFields()) {
69: if (field.isAnnotationPresent(Id.class)) {
70: return Optional.of(field);
71: }
72: }
73: }
74: return Optional.empty();
75: }
# 이 타입을 언급하는 곳 전부 (자기 파일 포함)
adapter/outbound/persistence-jpa/src/postgresqlIntegrationTest/java/dev/caskeleton/adapter/outbound/persistence/platform/IdStrategyContractTest.java:18: * <p>This is the measurement behind {@code HibernateBatchConfigurationGuard}. The guard refuses an
adapter/outbound/persistence-jpa/src/test/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigurationGuardTest.java:14: private final HibernateBatchConfigurationGuard guard = new HibernateBatchConfigurationGuard();
adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigurationGuard.java:23:public final class HibernateBatchConfigurationGuard {
adapter/outbound/persistence-jpa/src/testkit/java/dev/caskeleton/adapter/outbound/persistence/testkit/id/IdentityEntity.java:16: * HibernateBatchConfigurationGuard} uses the same fact to refuse a batch profile that targets it.
# 그 타입을 인스턴스화하는 main 코드: 0
# 같은 패키지의 프로파일 레지스트리를 읽는 main 코드: 0
# 계획 문서가 이 과제의 산출물로 적은 것
2937:- Produces: Named batch profiles and startup diagnostics for IDENTITY and sequence mismatch.
# 가드가 거절하려는 전략이 main 에 나타나는 곳
adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigurationGuard.java:13: * <p>The case that matters is {@link GenerationType#IDENTITY}. An identity column's value is
adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigurationGuard.java:42: + " uses GenerationType.IDENTITY, and IDENTITY disables insert batching: Hibernate"
adapter/outbound/persistence-jpa/src/main/java/dev/caskeleton/adapter/outbound/persistence/hibernate/batch/HibernateBatchConfigurationGuard.java:53: .map(generated -> generated.strategy() == GenerationType.IDENTITY)
# main 에서 @GeneratedValue 를 쓰는 줄: 0
# 출하 엔티티의 식별자 접근 방식
# main 의 @Entity 파일: 32
# 그중 @Id 를 필드에 단 파일: 27
# @Id 바로 뒤가 메서드 선언인 것 (프로퍼티 접근): 0
# @Access 나 AccessType 을 쓰는 줄 (저장소 전체): 0
# @EmbeddedId 를 쓰는 main 파일: LiveEventEntity.java