Closed gavinking closed 6 months ago
What do you think about clarifying "It is an error if a default access type cannot be determined"? I think the general approach for all providers is to look at @Id
/ @EmbeddedId
, so maybe codify that?
Although, the question could then become why is this:
@Entity
class Book {
@Id
Integer id;
}
not functionally the same as
@Entity
@Access(FIELD)
class Book {
@Id
Integer id;
}
for the purpose of something like
@Entity
class Book {
@Id
Integer id;
...
@Access(PROPERTY)
String getIsbn() ...
}
The only distinction being implicit v. explicit in that case.
It is an error if a default access type cannot be determined
For my part, I'm completely happy to add that. @lukasj WDYT?
Although, the question could then become...
So there's two things you could say, I suppose. Either:
@Access
is not considered a "mapping annotation" for the purposes of that section, and does not affect determination of the default access type, in which case your code would be accepted, or@Access
is considered a "mapping annotation", and that code is an error.Either option is self-consistent, and either option is fine by me.
It is an error if a default access type cannot be determined
For my part, I'm completely happy to add that. @lukasj WDYT?
That is already in the original and in your PR. I was just saying we might consider adding the bit about @Id
to explicitly note that that does in fact constitute a determination.
So there's two things you could say, I suppose. Either:
I also don't much care which way we interpret that. But having it explicit and consistent is a win imo
So there's two things you could say, I suppose. Either:
I also don't much care which way we interpret that. But having it explicit and consistent is a win imo
Let's migrate this discussion to issue #558.
and move footnotes into main text