• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Insert, update row in table have many to one and one to many

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 3 entities which mirror from 3 tables in database. The first entity named Khachhang


The 2nd entity named MaSoThuong:


The 3rd entity named ThamDu


and the entity are generated automatically


How can I insert or update table ThamDu?
 
Saloon Keeper
Posts: 22117
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the ORM forum.
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any @Entity annotations on them. You can persist and update them using an EntityManager.
 
Minh Phuc
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Bill Gorder wrote:I don't see any @Entity annotations on them. You can persist and update them using an EntityManager.


There are entities, I don't want post long code. Somebody suggest?
 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You asked how to save or update it. I said you save or update entities using an EntityManager which must be configured. Was that your question or are you saying that when persisting or updating the entity you are getting an exception that you neglected to post? If that is the case please TellTheDetails.
 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic