Skip to content

Conversation

nvamelichev
Copy link
Collaborator

No description provided.

@nvamelichev nvamelichev requested a review from g-sg-v July 31, 2025 19:07
@nvamelichev nvamelichev self-assigned this Jul 31, 2025
@nvamelichev nvamelichev added feature New feature or request breaking Potentially breaking change in API or behavior labels Jul 31, 2025
@nvamelichev nvamelichev marked this pull request as draft July 31, 2025 19:08
@nvamelichev nvamelichev force-pushed the not-null-columns-via-explicit-annotation branch 2 times, most recently from c1ea3c5 to 6233ef8 Compare July 31, 2025 21:13
Defaulting ID fields to required (`NOT NULL`) can be enabled via a Java system property,
`tech.ydb.yoj.repository.db.id.nullability`, which will influence the schema checker
(`YdbSchemaCompatibilityChecker`), programmatic table creation via `YdbSchemaOperations`,
and YQL code generation in `YqlStatement`s that take into account the `isOptional()`
`JavaField` attribute. The new attribute is introduced by this change, so the only
supporting code generators initially are the standard `YqlStatement` implementations.

The valid System property values are:
- `USE_COLUMN_ANNOTATION` (Default): Consider ID fields optional unless annotated with
  the `@Column(notNull=true, ...)` annotation or the `@NotNullColumn` meta-annotation.
- `ALWAYS_NULL`: Force all ID fields to be treated as optional,
  even though YOJ does **not** allow to save entities with NULL in ID columns.
- `ALWAYS_NOT_NULL`: Force all ID fields to be treated as required.
@nvamelichev nvamelichev force-pushed the not-null-columns-via-explicit-annotation branch from 6233ef8 to b852bd9 Compare August 8, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Potentially breaking change in API or behavior feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant