-
Notifications
You must be signed in to change notification settings - Fork 874
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
Jakarta EE Entitiy and EJB support #6129
Jakarta EE Entitiy and EJB support #6129
Conversation
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.
Currently the license check fails because the new templates have no license header. In that modules the templates are assigned a license using the licenseinfo.xml
file in the root of the module. Please add the new templates to the list.
I left two further comments inline.
enterprise/j2ee.ejbcore/nbproject/org-netbeans-modules-j2ee-ejbcore.sig
Outdated
Show resolved
Hide resolved
java/j2ee.persistence/src/org/netbeans/modules/j2ee/persistence/wizard/entity/EntityWizard.java
Outdated
Show resolved
Hide resolved
2036ca5
to
5fdf9ab
Compare
Added files to |
If noone objects, I'll merge on the weekend. @juneau001 you might want to have a look. |
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 have tested this PR and the entity classes do generate. However, when I generate on a Jakarta EE 9 or Jakarta EE 10 project, the classes generated with javax.* imports. I tested on existing projects...not new projects. Thanks for the work on this!
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.
Does this need to support Jakarta EE 9+? I am testing on a Jakarta EE 10 project and javax.* entities are being generated.
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.
Does this need to support Jakarta EE 9+? I am testing on a Jakarta EE 10 project and javax.* entities are being generated.
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'm not 100% if this needs to be adjusted at all for Jakarta EE 9+...looks great with the new enterprisePrefix, but my entities are still being generated with javax.* on a Jakarta EE 10 project
@juneau001 @matthiasblaesing @mbien can we get this back to move somehow? Would be nice to have it in NB19. I created two maven web applications one with jakarta ee 10 and one with jakarta ee 9 in NetBeans 18 and opened it with the PR. Stateful and stateless session beans were created with the correct imports. |
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.
code looks good to me
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 think I see what @juneau001 saw: The title of this PR contains "Jakarta EE Enttiy", so this implies that I can generate @entity beans. This generates code with wrong package. Steps to reproduce:
Create Java EE 10 Web Project
- Build this branch, remove
nbbuild/testuserdir
, runant tryme
- Create a new project "Java with Maven" > "Web Application"
- Fill Name and Location Data (not relevant for this test)
- Select "Add" for Server and choose "Glassfish", choose a local folder and download 7.0.5
- Accept domain1 defaults
- Ensure Java EE version is set to "Jakarta EE 10 Web"
- Generate project
Prepare JavaDB Connection
- Go to services tab
- Select Database -> Drivers -> "Java DB (Network)", Choose "Customize"
- Add "derbytools.jar" from $glassfishDir/javadb/lib folder
Try to generate entity classes
- Open Context menu on project node, choose "New" -> "Entity classes from Database"
- In the "Data Source" dropdown select
jdbc/sample
- Select table "CUSTOMER" and the "Add"
- Select "Next" until to reach the last page of the wizard, then select "Finish"
=> Now check the generated classes, for example "Customer.java". You'll see, that the javax.persistence
classes are used, although we are in an JakartaEE project
can we merge this and fix the remaining issue during RC1? my understanding is:
deadline is today night UTC |
I fixed the mentioned use case, currently in testing phase. |
* Create entities from database tables * Create message driven, stateful, stateless and session beans This should fix apache#4827 apache#4828
5fdf9ab
to
dabf55f
Compare
Pushed fixed for that use case. Tested with steps mentioned in #6129 (review)
|
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 have reviewed the code and it looks great. I also updated my local code based upon the latest changes and tested today. I am now able to create entity beans from database for a Jakarta EE 9+ project and I receive jakarta.* imports. Likewise, if I do the same for Jakarta EE 8- projects then I receive javax.* imports. Appears to be working well. Thanks for all of your time on this issue!
Thanks for the update, I'm doing a local sanity build and if ok, I'll merge. |
Added ability for Jakarta EE projects to:
This should fix #4827 #4828