Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ID等のDBで自動生成されるフィールドの初期化が重複している #33

Open
arata-nvm opened this issue Mar 9, 2024 · 1 comment
Labels

Comments

@arata-nvm
Copy link
Member

arata-nvm commented Mar 9, 2024

project.iduser.roleはスキーマにおいてデフォルト値が入るように設定されているが、これらのフィールドはentityにおいて初期化されており、実質的にはDB側のデフォルト値が使われることはない。
現在の実装ではCRUDのすべてにおいて同じentityのモデルを使用しているが、command/queryぐらいの粒度にモデルを分割することで重複を防げるものと思われる。

@arata-nvm
Copy link
Member Author

ドメイン層で生成するパターンを「早期生成」、インフラストラクチャ層で生成するパターンを「遅延生成」と呼称する場合があるらしい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant