There is a problem about generating id while persisting into database. I added the following code to my jpa entity file, however I'm getting 0 for personid.
@Id
@Column(unique=true, nullable=false, precision=10, name="PERSONID")
@SequenceGenerator(name="appUsersSeq", sequenceName="SEQ_PERSON", allocationSize=1)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "appUsersSeq")
private long personid;
EjbService:
@Stateless
public class EjbService implements EjbServiceRemote {
@PersistenceContext(name = "Project1245")
private EntityManager em;
@Override
public void addTperson(Tperson tp) {
em.persist(tp);
}
}