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

Define behaviour for collisions in variable names in metamodel #589

Closed
lukasj opened this issue Mar 12, 2024 · 1 comment · Fixed by #592
Closed

Define behaviour for collisions in variable names in metamodel #589

lukasj opened this issue Mar 12, 2024 · 1 comment · Fixed by #592

Comments

@lukasj
Copy link
Contributor

lukasj commented Mar 12, 2024

right now in 3.2, there we have:

For every persistent attribute y declared by class X, the metamodel class must contain a field declaration as follows:
public static final String Y = "y";
where the field name Y is obtained by transforming each lowercase character in the attribute name y to uppercase, and inserting > an underscore if the character following the transformed character is uppercase.

and later:

For every persistent non-collection-valued attribute y declared by class X, where the type of y is Y, the metamodel class must contain a declaration as follows:
public static volatile SingularAttribute<X, Y> y;

so if one has an entity with an attribute name in an uppercase - there might be valid usecases for this (an example I've noticed can be a variable called IQ), then this leads to collisions. We should either change the newly added requirement for the fieldname to ie public static final String Y_ = "y"; (add an underscore, or sth else, to the variable name) or say, that we do not handle collisions, or say that the latter is in lowercase (right now it is silent, so my expectation is that the variable name is taken as it is)

@gavinking
Copy link
Contributor

We should either change the newly added requirement for the fieldname to ie public static final String Y_ = "y";

This looks OK to me.

lukasj added a commit to lukasj/persistence that referenced this issue Mar 15, 2024
lukasj added a commit to lukasj/persistence that referenced this issue Mar 25, 2024
lukasj added a commit to lukasj/persistence that referenced this issue Mar 25, 2024
lukasj added a commit that referenced this issue Mar 25, 2024
---------

Signed-off-by: Lukas Jungmann <[email protected]>
Co-authored-by: Gavin King <[email protected]>
@github-project-automation github-project-automation bot moved this to Done in 3.2.0 Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants