Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Unable to inser the record through EJB3.0,Eclipselink and JPA

How are you inserting your objects?  createQuery is for reading, not
insertion.

To insert an object in JPA, you create an instance of your class, and call
persist() with it on the EntityManager, then commit() or flush() the
EntityManager.  For related objects you related the two objects through a
relationship and persist them both, or allow cascade persist to cascade.



Niranjan reddy wrote:
> 
> Hi,
> 
> I am using the EJB3.0 with eclipselink as framework(With JPA) and JBoss as
> application server.
> 
> i am able to insert the data when there is no relation in the table
> through createQuery. But when there is a relation exist between two table
> i am not able to insert the data.
> 
> Can any one tell me the solution.
> 
> Thanking you,
> 
> NIRANJAN REDDY. S 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Unable-to-inser-the-record-through-EJB3.0%2CEclipselink--and-JPA-tp20360081p20362628.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top