-
Notifications
You must be signed in to change notification settings - Fork 358
Add an "InsertOnly" annotation to support a write-once semantic. [DATAJDBC-416] #637
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
Comments
The annotation should be '@InsertOnlyProperty' modelled after '@ReadOnlyProperty'. |
Any implementation would currently only work for Aggregate Root properties. Therefore this has to wait until we have a better way of updating inner entities in place. |
@schauder How about adding an annotation such as class Student {
...
@Condition
String name;
} UPDATE student
SET ...
WHERE id = :id AND name = :name
|
@schauder Please consider it |
@taeyeon-Kim I'm confused by what the relation to the original issue is. |
For Spring Data JDBC you may now annotate properties of the aggregate root with `@InsertOnlyProperty`. Properties annotated in such way will be written to the database only during insert operations, but they will not be updated afterwards. Closes #637
For Spring Data JDBC you may now annotate properties of the aggregate root with `@InsertOnlyProperty`. Properties annotated in such way will be written to the database only during insert operations, but they will not be updated afterwards. Closes #637
You may now annotate properties of the aggregate root with `@InsertOnlyProperty`. Properties annotated in such way will be written to the database only during insert operations, but they will not be updated afterwards. Closes #637
May be its too late write any suggestion. But let me write my idea about it. What if will be added property ChangeConditionProperty which get array of strings such as "INSERT", "UPDATE". And then from this condition attribute may be included or excluded from an update script. Thanks! |
Tyler K Van Gorder opened DATAJDBC-416 and commented
It would be nice to mark attributes on an entity as "InsertOnly", such that they are included during and insert but excluded from an update. A use-case for such an annotation can be applied to the "created" auditing columns.
You want to ensure the auditing columns are set when the entity is inserted and you want to prevent those same fields from being overwritten during the update.
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: