Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use JPA to save a list of objects

 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
 
Raj Ohadi
Ranch Hand
Posts: 316
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic