I use the option Jsf Pages From Entity class in Netbeans IDE, it works good but I do not want to generate code for id field(primary key) for each table, cause it is AutoIncrement.
but the Netbeans generates input text for all databease's field in the tables.......! even for Id.......!!
I changed the @Id @GeneratedValue(strategy) to be (GenerationType.AUTO) and delete the input text for id field from the page and tried to save a new data but it didn't work.....!!
I got error message in the page(may be not null).....!!
I tried to trace where he use the quiery to save data but I could not find anything....!!
please help me.
this is the code for session bean, entity class and jsf page
The Jsf page
I delete the value attribute form input text for id field cause I supposed that it should be insert automaticlly inside database not by user.
Joined: Dec 11, 2010
sorry guys I forget the controller class
Joined: Jan 11, 2011
Your Managed bean code, line 65
getFacade().create(current); If you CTRL+click "create" Netbeans should show you this method code. This will be where your object is saved to database.
But I don't think your data goes there.
Take a look at your JSF code.
Your input box is not connected with your managed bean. Managed bean should contain private String teacherFullName; and getName() and setName methods so you can use jsf code:
Then if you submit form it will be passed to managed bean so you can use it to create new teacher. Think about it.