cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 76457 - [55cat] "JSF Pages from Entity Class" generates wrong codes when primary key is SMALLINT
: [55cat] "JSF Pages from Entity Class" generates wrong codes when primary key ...
Status: VERIFIED FIXED
: javaee
JSF
: 5.5
: PC Windows XP
: P2 (vote)
: 5.5
Assigned To:
:
:
: fix-in-55
:
:
:
  Show dependency treegraph
 
Reported: 2006-05-17 00:49 by
Modified: 2006-05-22 15:12 (History)
Issue Type: DEFECT
:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-05-17 00:49:59
[ JDK VERSION : 1.5.0_06 ]

NetBeans 5.5 Beta + Enterprise Pack
Windows XP
JDK1.5.0_06

1. In Java DB, Create a table that has primary key as "SMALLINT", another row
is also "SMALLINT" 
2. Create a Web application project
3. Create Entity class by "Persistence->Entity Classes from Database", use the
table
4. Create Persistence Unit for it
5. Create JSF Pages from Entity Class, select the Entity class

Now we have "<tablename>Controller.java" and "<tablename>Converer.java" in
source directory,
these two files contain these codes blow, but it can not compile it by error,

    public Object getAsObject(FacesContext facesContext, UIComponent
uIComponent, String string) {
        MytableController controller = (MytableController)
facesContext.getApplication().getELResolver().getValue(
            facesContext.getELContext(), null, "mytable");
        java.lang.Short id = (java.lang.Short)string;
        return controller.findMytable(id);
    }

    public Mytable getMytableFromRequestParam() {
        ExternalContext ec =
FacesContext.getCurrentInstance().getExternalContext();
        HttpServletRequest request = (HttpServletRequest)ec.getRequest();
        String param = request.getParameter("key");
        java.lang.Short id = (java.lang.Short)param;
        return em.find(Mytable.class, id);
    }

The compile error happens in

        java.lang.Short id = (java.lang.Short)string;
------- Comment #1 From 2006-05-19 16:52:57 -------
I added support for all numeric types in java.lang and for all primitive types
(I hope).

Checking in src/org/netbeans/modules/web/jsf/wizards/JSFClinetGenerator.java;
/cvs/web/jsf/src/org/netbeans/modules/web/jsf/wizards/Attic/JSFClinetGenerator.java,v
 <--  JSFClinetGenerator.java
new revision: 1.1.2.17; previous revision: 1.1.2.16
done
------- Comment #2 From 2006-05-22 15:12:23 -------
Thanks!

I've verified the fix on 200605220200 Windows.