This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 104301 - Entity Classes from Database: Generated EJB code does not work
Summary: Entity Classes from Database: Generated EJB code does not work
Status: RESOLVED DUPLICATE of bug 90031
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Radko Najman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-18 17:55 UTC by pekarna2
Modified: 2010-01-12 02:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pekarna2 2007-05-18 17:55:47 UTC
I react on the Java EE & Hibernate HOWTO at
http://www.netbeans.org/kb/articles/hibernate-javaee.html .
By the end of the page, there is a header: "Coding the JSF Interface".
In point 3), there is such advice:

-----------------------
To make this application work correctly, we need to make some changes to
CustomerController.java and DiscountCodeController.java. [...]

EntityManager em = getEntityManager();
        try {
            utx.begin();

Modify the code in each of the methods to change the order in which we get the
entity manager.

EntityManager em = null;
        try {
            utx.begin();
            em = getEntityManager();
-----------------------

Why the code is not generated that way? It's a single-purpose generator and
every controller class code generated by it must be edited in three methods. So
I guess it should be modified in the "template".

Thanks, Ondra

(This is my first issue report, so please excuse me if this is bogus in some
way. I was adviced to report this by a more skillful NetBeans user).
Comment 1 pekarna2 2007-05-18 18:00:54 UTC
Once touching this topic, I would like to ask for one more thing:
Could the "Entity Classes from Database" and "JSP Pages from Entity Class"
templates be a bit more editable? It seems to be hard-coded in NetBeans. I would
like to localize it and to change the HTML (at least the <head> and the HTML
surrounding the <f:view>). Thanks
Comment 2 Erno Mononen 2007-05-22 09:19:03 UTC
The issue has been fixed in 5.5.1 (please see issue 90031), closing this as a 
duplicate. Not sure now whether there is already an issue for editable 
templates, could you please file a separate issue for that? Thanks for 
reporting.

*** This issue has been marked as a duplicate of 90031 ***