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

Allow setting defaults for different temporal types #326

Open
drognisep opened this issue Sep 18, 2019 · 1 comment
Open

Allow setting defaults for different temporal types #326

drognisep opened this issue Sep 18, 2019 · 1 comment

Comments

@drognisep
Copy link

Overview of the issue

There doesn't seem to be an option to set the model-wide default used for certain temporal types. It would be nice if, in the config somewhere, there was an option to set the default type used for TimeStamp, Time, and Date separately. It would be fine to reuse the existing dialog because I can locate things like Java 8 LocalDateTime, but it's a pain to go through each TimeStamp field in the model one at a time (there doesn't seem to be multiple select support) and change them all to ZonedDateTime.

Expected Outcome

Allow setting a new default type for temporal fields in JPA entities.
Allow "reverting" all temporal fields in the model to the new default as an easy way to apply a blanket policy.

Current Outcome

Currently, I have to go through each field one at a time that defaults to java.util.Date and change it to whatever type I wish.

Alternatively, I can regex replace things in the actual xml representation, which is a lot faster, but isn't exactly how I expect to use this tool.

Jeddict Version(s)

Latest version on Netbeans 11.1

@drognisep drognisep changed the title Allow Java 8 temporal types Allow setting defaults for different temporal types Sep 18, 2019
@drognisep
Copy link
Author

drognisep commented Sep 20, 2019

I just realized that part of the proposed functionality is actually invalid. JPA validation fails when @Temporal is added to an entity field and the field type is not Date or Calendar.

So this would actually have to change it from a temporal type (with the @Temporal annotation) to a default type with a field type of whatever java.time.* type is requested (without the @Temporal annotation). I still think the existing dialog can be reused for this since the dropdown that defaults to "Temporal" can be changed to "Default", and LocalDateTime can still be located and selected.

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

No branches or pull requests

2 participants