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 199553 - Netbeans JSF 2.0 CRUD scaffolding using Facelets (xhtml) is uncomplete
Summary: Netbeans JSF 2.0 CRUD scaffolding using Facelets (xhtml) is uncomplete
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-20 14:39 UTC by hanine
Modified: 2012-10-08 10:16 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hanine 2011-06-20 14:39:06 UTC
When using CRUD for JSF 2.0 code generation using Facelets as View technology instead of JSP, the critical differences below are noticed :

1 - The code generated for JSF pages, does not allow (as opposite to JSP view code)  navigating, using datatables that display child objects.
Example: If I have a Singer Object details (/singer/View.xhtml) in a View page and want to navigate to view one of its Song objects, using a datatable with <h:column > 
<h:commandLink value="Show Song" action="#{songController.prepareView}"</h:column>

would result in a NoRowAvailableException fired by the JSF DataModel.
That is the most interesting feature for a CRUD application = Navigating from Parent to leaves and vice versa.

2- As opposite to the code generated for JSP technology, There is no support for Many to Many database relationship. Some people just redesign their datatabe to get rid of many2many relationship to use Netbeans CRUD scaffolding, while others just stick to the JSP version sacrificing the new features of JSF 2.0 with Facelets.

3- Impossible to use datatabase Views as entities if they do not have a primary Key. example: for MySQL and most DB vendors, it is impossible for a View to have an ID (PK). While using the IDE to create a Pk for the View entity will make it not usable at all (The view is a Select Query from different Entities, no need for a PK).

N.B: The code generated for JSP View technology used a custom JSF EL resolver. This is no more used when using Facelets, and that stipulates new features of Facelets make things easier for the CRUD scaffolding.

It would be deeply appreciated if you at least give us hints, as that might not be the correct place to submit this feedback.
Comment 1 Martin Fousek 2011-06-21 10:25:34 UTC
You chosen proper place for entering this issue. In any case this is not regression because you should be still able to generate JSP CRUD by choosing Preferred Page Language to JSP. Scaffold for Facelets wasn't supported so widely for now but I'm marking this as a enhancement and we will try to do that for NB71. I agree that code generated for JSP is much more powerful than Facelets one.

In detail to particular questions:
1, and 2, should be doable and I will investigate it more when I will be implementing that

3, should belong perhaps to Persistence category in BZ. Anyway using DB views as entities should require some hack since DB views doesn't have primary keys and JPA specification mention this (Section 2.1.4):
Every entity must have a primary key.
So as was mentioned you can try to raise this request against Persistence category but I'm afraid that it's too much corner case for changing that. Also generation JSF pages from DB depends on primary key as well I would expect.
Comment 2 hanine 2011-06-21 12:16:19 UTC
Thanks a lot for your prompt answer.
We are looking impatiently forward to using Netbeans 7.1, and hoping you will succeed in making this enhancement come to life.

Regards.
Comment 3 Martin Fousek 2011-06-22 04:19:24 UTC
You're welcome. I believe that it could be available in dev builds during Jul/Aug - I will inform you here then.
Comment 4 ZZainoz 2011-07-27 06:55:19 UTC
This happen since 6.9 version.. what i have found that if im using MYSQL,  the exactly error appeared but with the same structure using JDBC it is OK...
Comment 5 hanine 2012-01-29 09:30:33 UTC
Nothing has been enhanced in 7.1?
Comment 6 Martin Fousek 2012-01-30 06:49:48 UTC
You are right, hanine, sorry for that. To be honest to you it also didn't get into plans for NB72, I'll try to do my best to be able to spend on that at least some time for base improvements.
Comment 7 hanine 2012-02-21 22:25:49 UTC
:( Sad to hear that. 
Well the most important feature is many2many support.
At least, don't you know about a tutorial or a workaround that allows us to enable m2n relationship support in a JSF/JPA environment using Netbeans scaffolding?

Thank you for your great work in advance.
Comment 8 hanine 2012-10-04 13:44:13 UTC
Hello back.
Any news about the base dev on JSF scaffolding?

The bug is still there in 7.3 beta.

Defect : Generating JSF beans and pages from JPA entities lacks support for Many to many relationships if Facelets is the view technology used. (target Java EE 6.

Thanks in advance for you feedback.
Comment 9 Martin Fousek 2012-10-05 11:02:40 UTC
(In reply to comment #8)
> Hello back.
> Any news about the base dev on JSF scaffolding?

Hello hanine, sorry no good news here for now. :/ M2M generation is still not present in the trunk sources. If you take a look on features of the new NetBeans 7.3 you will see that unfortunately JEE was not favoured area of NB73:
http://wiki.netbeans.org/NetBeans_73_NewAndNoteworthy
Comment 10 hanine 2012-10-05 13:21:29 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Hello back.
> > Any news about the base dev on JSF scaffolding?
> 
> Hello hanine, sorry no good news here for now. :/ M2M generation is still not
> present in the trunk sources. If you take a look on features of the new
> NetBeans 7.3 you will see that unfortunately JEE was not favoured area of NB73:
> http://wiki.netbeans.org/NetBeans_73_NewAndNoteworthy


Thanks for your feedback.
Is there any way to make it happen for 7.3.1 or 7.4?
Comment 11 Martin Fousek 2012-10-08 10:16:25 UTC
(In reply to comment #10)
> Thanks for your feedback.
> Is there any way to make it happen for 7.3.1 or 7.4?

Thanks for your patience. Sorry, every our patch relase is only about bugfixing and quality so we will not bring any new features in 7.3.1 as usually.

In any case I changed the TM to Next which means that it will be automatically switched to NB7.4 (or whatever name will have and CCed PetrJ to this issue since I would really like to give it change in next version. I'll try give it some time at least for evaluation during the 73 fixing phase and I will let you know then. Feel free to ping me here if would nothing happen in about a month. Thanks!