-
Notifications
You must be signed in to change notification settings - Fork 59
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
Clarify the seed value of version #649
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Yanming Zhou <[email protected]>
* <p>Any <strong>positive number</strong> or <strong>non-null timestamp</strong> | ||
* initial value will be the seed of version, otherwise vendors are free to | ||
* seed the version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this actually addresses the real actually-known use case here which is to enable a portable way to choose between an initial version of 0
and an initial version of 1
.
With this language:
@Version int version = 1;
lets me portably get an initial value of 1
. OK, great.
But:
@Version int version = 0;
Just does something non-portable and vendor-specific.
So there's no portable way to request an initial value of 0
.
Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there's no portable way to request an initial value of 0.
Yes, there is no way to differ int version = 0;
from int version;
, both of them should be treated as non-predefined, if negative numbers are treated that way, why not zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if negative numbers are treated that way, why not zero?
Well, because counting from 0
is perfectly legit, and often used in computing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it's what Hibernate does by default, so it can't be terrible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if negative numbers are treated that way, why not zero?
Well, because counting from
0
is perfectly legit, and often used in computing.
I'm not against that if EclipseLink team would like to support counting from 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly, so it's something that needs to be discussed properly with @lukasj and we need to think through the full impact. i.e. we need an issue to track this. We can't just make this sort of change as a PR with no discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need an issue to track this.
Could you reopen #600?
Supersede #600