• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Minh Phuc
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?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18282
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the ORM forum.
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 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 IntelliJ IDE Linux Mac OS X Spring
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic