Vou tentar explicar melhor :lol:
Tenho a tabela Contato com 3 campos id, nome e fone
Tenho o meu bean Contato
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package guj;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/**
*
* @author renata
*/
@Entity
@Table(name = "CONTATO")
@NamedQueries({@NamedQuery(name = "Contato.findById", query = "SELECT c FROM Contato c WHERE c.id = :id"), @NamedQuery(name = "Contato.findByNome", query = "SELECT c FROM Contato c WHERE c.nome = :nome"), @NamedQuery(name = "Contato.findByFone", query = "SELECT c FROM Contato c WHERE c.fone = :fone")})
public class Contato implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "ID", nullable = false)
private Integer id;
@Column(name = "NOME")
private String nome;
@Column(name = "FONE")
private String fone;
public Contato() {
}
public Contato(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getFone() {
return fone;
}
public void setFone(String fone) {
this.fone = fone;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Contato)) {
return false;
}
Contato other = (Contato) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "guj.Contato[id=" + id + "]";
}
}
O persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="GujPU" transaction-type="JTA">
<jta-data-source>GujJNDI</jta-data-source>
<properties/>
</persistence-unit>
</persistence>
tenho o RequestBean1.java
/*
* RequestBean1.java
*
* Created on 15/10/2008, 14:40:05
*/
package guj;
import com.sun.rave.web.ui.appbase.AbstractRequestBean;
import javax.faces.FacesException;
public class RequestBean1 extends AbstractRequestBean {
private Contato contato = new Contato();
private void _init() throws Exception {
}
public RequestBean1() {
}
@Override
public void init() {
super.init();
try {
_init();
} catch (Exception e) {
log("RequestBean1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
}
@Override
public void destroy() {
}
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
}
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
}
public
Contato getContato() {
return contato;
}
public void setContato(Contato contato) {
this.contato = contato;
}
}
E finalmente a minha pagina que vai usar tudo isso 
package guj;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.webui.jsf.component.TextField;
import javax.annotation.Resource;
import javax.faces.FacesException;
import javax.naming.Context;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
@PersistenceContext(name = "persistence/LogicalName", unitName = "GujPU")
public class Page1 extends AbstractPageBean {
@Resource
private javax.transaction.UserTransaction utx;
private void _init() throws Exception {
}
public Page1() {
}
@Override
public void init() {
super.init();
try {
_init();
} catch (Exception e) {
log("Page1 Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
}
@Override
public void preprocess() {
}
@Override
public void prerender() {
}
@Override
public void destroy() {
}
protected SessionBean1 getSessionBean1() {
return (SessionBean1) getBean("SessionBean1");
}
protected RequestBean1 getRequestBean1() {
return (RequestBean1) getBean("RequestBean1");
}
protected ApplicationBean1 getApplicationBean1() {
return (ApplicationBean1) getBean("ApplicationBean1");
}
public String cadastrarBtn_action() {
this.persist(this.getRequestBean1().getContato());
return null;
}
protected void persist(Object object) {
try {
Context ctx = (Context) new javax.naming.InitialContext().lookup("java:comp/env");
utx.begin();
EntityManager em = (EntityManager) ctx.lookup("persistence/LogicalName");
em.persist(object);
utx.commit();
} catch (Exception e) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", e);
throw new RuntimeException(e);
}
}
}
Agora veja … imagine que queira fazer uma pagina2 que também persiste Contato. todo o metodo protected void persist(Object object) eu teria que ter na pagina2.