Skip to content

Not able to ignore fields while updating entity. #227

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

Closed
shubhtrino opened this issue Dec 16, 2021 · 3 comments
Closed

Not able to ignore fields while updating entity. #227

shubhtrino opened this issue Dec 16, 2021 · 3 comments
Labels
status: duplicate A duplicate of another issue

Comments

@shubhtrino
Copy link

Below I have a simple entity code
Where I don't want createdDateTime to get updated to null when I am not passing it in parameters.

as of now .save() method saving null value in createdDateTime.

public class Test{

  private String name;
  private String desc;

  @Transient // not working
  @column(updatable=false) //not working
  private LocalDateTime createdDateTime;

}
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 16, 2021
@bclozel
Copy link
Member

bclozel commented Dec 16, 2021

The difference between a null input and no value at all is being discussed in #140. I'm closing this issue as a duplicate.

@bclozel bclozel closed this as completed Dec 16, 2021
@bclozel bclozel added status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 16, 2021
@shubhtrino
Copy link
Author

Hi,
I have gone through #140
but it is still unclear.
If I don't pass any value in input there should be a way so that the .save() method will not update it to null in DB.
For instance createdDate this filed I don't want to get updated in DB as well as I don't have this field available as input.

Any working example will be helpful.

@bclozel
Copy link
Member

bclozel commented Dec 17, 2021

To be clear, this is not solved yet. It's been raised as #228 as well. I'll leave that one opened for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants