jsf hibernate crud form relationship -
After
I am using 4 hibernate, JSF 2.2 and primefaces 4. When I create relationships with relationships which form a unit CRUD form Am I supposed to use?
Use an object to relate, and one unit generic converter:
or use object.id
& lt; H: inputHidden id = "gender_id" value = "# {user.gender.id}");
Update: I am using standby organizations created by Netbeans from the database with the unit.
User.java:
@JoinColumn (name = "gender", referenced ColumnName = "id") @ManyToOne (optional = false, fetch = FetchType.LAZY) private Gender gender; Public gender genders () {return gender; } @Basic (optional = false) @Column (name = "0") =================================================================================================================== < ID ") Private Long ID Public Long ICID () {Return ID; }
I think the first time you load the page, the gender property is zero Do you get NPE? Can you try adding a random check like this,
public gender getGender () {if (gender == null) {gender = new gender (); } Return gender; }
Comments
Post a Comment