JIRA refused to accept my upload of a document that outlines my issues 
concerning the JPA generator. The file is available as a PDF or a Word docx. 
Both are refused with a message about a missing token. I do have a JIRA login. 
I will email it directly to you but I'd like to have it recorded on JIRA.

Ken


-----Original Message-----
From: Josh Juneau <juneau...@gmail.com> 
Sent: February 14, 2020 12:27 PM
To: dev <dev@netbeans.apache.org>
Subject: Re: JPA Controller Generation

Thanks for reporting this issue Ken.  It would be good to get something in the 
issue tracker for this problem.  I haven't used the auto-generation of new JPA 
controllers.  I usually create my own so I haven't come across this issue...but 
I'll see if I can replicate this problem.  I may not personally be able to make 
the repairs for this (at least not anytime soon), but it should at least get in 
the tracker so that we can have it in the queue.  It does sound like this code 
needs updating.

It sounds like you have a good strategy for moving forward with your class.  
Hope all goes well.

Thanks

Josh Juneau
juneau...@gmail.com
http://jj-blogger.blogspot.com
https://www.apress.com/us/search?query=Juneau
<https://www.apress.com/index.php/author/author/view/id/1866>



On Fri, Feb 14, 2020 at 8:31 AM Kenneth Fogel <kfo...@dawsoncollege.qc.ca>
wrote:

> I have calmed down and wish to apologize for the harshness of my 
> comments last night. I will download the latest source and review the 
> code that generates the controllers et all. I will suggest that there 
> should be two choices for JPA Controllers, one for stand alone and one 
> for application server managed.
>
> Ken
>
> ________________________________
> From: Kenneth Fogel <kfo...@dawsoncollege.qc.ca>
> Sent: Friday, February 14, 2020 12:51:59 AM
> To: dev@netbeans.apache.org <dev@netbeans.apache.org>
> Subject: JPA Controller Generation
>
> I have been using NetBeans, as many of you know, for years. In the 
> winter I teach an EE course that uses the JPA. In using the New -> JPA 
> Controllers from Entities I couldn’t believe what came out. Let’s review two 
> changes:
>
> If the persistence.xml file does not declare a connection (url, user, 
> pwd) the generated controllers are empty. When this file is used for 
> EE JPA you declare the connection in glassfish-resources.xml and not 
> the persistence.xml. Previous versions of NB did show the connection 
> details but if I edited for EE JPA and then generated the controllers 
> they were still generated. The controllers are generated from the 
> entities so why is the generator even looking at persistence.xml.
>
> Then there are the controllers themselves. They have been optimized 
> for stand alone, resource local usage. The optimizations, especially 
> the use of finally clauses to eliminate catch clauses makes no sense 
> to me. Many but not all exceptions simply result in an em.close(). 
> This is effectively the same as having an empty catch clause. Plus, 
> with an injected  EntityManager you should not be closing it, if I 
> understand how CDI works. There is no rollback anywhere. If the JPA 
> now rolls back automatically when an exception occurs I’ll withdraw this 
> complaint but I doubt it does.
>
> I could go on. If you want to see what controllers used to look like 
> and what had to be changed for EE look at my blog 
> https://www.omniprogrammer.com/?p=383.
>
> Is the JPA used more extensively on the desktop? I don’t think so. 
> Here I take the blame for not pointing out that there needs to be JPA 
> generation for Application Servers. If you look at my blog you can see 
> that the changes were minimal to the old generated code. Now the 
> changes will need to be more extensive.
>
> I have to stop now because I’m angry. Tomorrow morning I have to face 
> a class and before that I need to decide if I should tell them to cut 
> and paste code from my samples and change the names of objects or show 
> them all the changes needed to make the generated code work.
>
> Please tell me I have it all wrong and I’ll be happy to apologize for 
> this missive and never darken this mailing list again. I will also be 
> happy to contribute JPA/EE controller templates if my concerns are valid.
>
> Ken
>
>
>
>
>
>

Reply via email to