Java Reference
In-Depth Information
{
@OneToOne(mappedBy="bellyButton")
private Person person;
public Person getPerson(){
return person;
}
public void getPerson(Person person){
this.person=person;
}
}
As we can see, the procedure to establish one-to-one relationships is very similar to
the procedure used to establish one-to-many and many-to-many relationships.
Once we have generated JPA entities from a database, we need to write additional
code containing business and presentation logic. Alternatively, we can use NetBeans
to generate code for these two layers.
Generating JSF Applications from JPA
Entities
One very nice feature of NetBeans is that it allows us to generate JSF applications
that will perform create, read, update, and delete (CRUD) operations from existing
JPA entities. This feature, combined with the ability to create JPA entities from an
existing database schema, as described in the previous section, allows us to write
web applications that interact with a database in record time.
To generate JSF pages from existing JPA entities, we need to right-click on the project
and select New | JSF Pages from Entity Classes... .
In order for us generate JSF pages from existing JPA entities, the current
project must be a Web application project.
 
Search WWH ::




Custom Search