This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes how to use JPA to save a list of objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to use JPA to save a list of objects" Watch "how to use JPA to save a list of objects" New topic
Author

how to use JPA to save a list of objects

Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
new to jpa. if I have a table CUSTOMER (NAME, ADDRESS, PHONE) and I have a list of <Customer> object which has the values for these 3 columns. What's the easiest way to insert the List inot table ?
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Iterate over it and persist each one.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Raj Ohadi
Ranch Hand

Joined: Jun 30, 2006
Posts: 316
Hebert Coelho wrote:Iterate over it and persist each one.


isn't a simpler way (java jpa syntax wise) to persist the entire list at once ?
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Raj Ohadi wrote:
Hebert Coelho wrote:Iterate over it and persist each one.


isn't a simpler way (java jpa syntax wise) to persist the entire list at once ?


Never heard of it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use JPA to save a list of objects
 
Similar Threads
Passing parameters to the next action using html:button or html:submit
Hibernate : Could not execute query -- Exception
Reset AUTO INCREMENTS
Drop Down Menu
Composite Key Mapping with OneToMany does not work