-
Notifications
You must be signed in to change notification settings - Fork 80
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
Use JoinColumn annotation for relationship mappings #416
Conversation
I noticed the |
src/test/java/org/openrewrite/java/migrate/javaee/UseJoinColumnForMappingTest.java
Outdated
Show resolved
Hide resolved
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.
Near perfect; Great to see you reuse as much as possible. We'll wait for @cjobinabo to return before a merge.
src/main/java/org/openrewrite/java/migrate/javax/UseJoinColumnForMapping.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Tim te Beek <[email protected]>
src/main/java/org/openrewrite/java/migrate/javax/UseJoinColumnForMapping.java
Outdated
Show resolved
Hide resolved
|
||
import static org.openrewrite.java.Assertions.java; | ||
|
||
class UseJoinColumnForMappingTest implements RewriteTest { |
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.
The following these cases should be ported over from our bucket:
- @OnetoOne used with @column (with a few attributes provided)
- @manytoone and @column, both without any attributes
- @OneToOnee and @column, both without any attributes
We should also test the use of these annotations within a sub class here as well.
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.
Did you mean subclass extending the @Entity
class? or an inner class inside the @Entity
class?
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.
Looks good
What's changed?
OpenJPA -> EclipseLink migration recipe
When a
@Column
annotated attribute has a relationship mapping (@OneToOne
or@ManyToOne
), replace with@JoinColumn
and drop certain annotation attributes.What's your motivation?
https://wiki.eclipse.org/EclipseLink/Examples/JPA/Migration/OpenJPA/Mappings#.40Column_in_Relationship_Mappings
Anything in particular you'd like reviewers to focus on?
Checklist