In this tutorial we are describing you about the EJB
create method. The create() method is used for creating the EJBean. The other
methods which are used in the program given below .
private EntityManager em:-Defines an Interface instance. The interface Entity manager is associated with the persistence context.
em.persist(newsEntity):-This method makes an entity instance managed and persistent.
em.merge(newsEntity):-This method merge the state of the given entity into the current persistence context.
em.remove(em.merge(newsEntity)):-By using this method we can remove the
entity instance.
em.find(ejb.NewsEntity.class, id):-This methods find the entity
instance by the primary key. Here primary key is id.
package ejb;
|
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: EJB create method
Post your Comment