This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me with mapping

 
sam bartl
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table

EA_MPF(
SYS_MPF_ID,
SYS_AUDIT_PROG_ID,
SYS_FINDING_ID
)
EA_MPF_NON_LEAD_PROGS(
SYS_MPF_ID,
SYS_AUDIT_PROG_ID
)

EA_AUDIT_PROGRAM(
SYS_AUDIT_PROG_ID,
...
..
..
)

here is the entity for EA_MPF table


Entity for EA_AUDIT_PROGRAM is pojo with all getter and setter methods called EaAuditProgram

Entity MultiProgramFinding has a leadEaAuditProgram and nonLeadEaAuditPrograms both these properties are mapped to EaAuditProgram , in order to have bidirectional relation in EaAuditProgram I have to map MultiProgramFinding twice , is this how I should map or is there a better way please advice me ?
also I posted this question in spring forums.



 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in order to have bidirectional relation in EaAuditProgram I have to map MultiProgramFinding twice...

How have you mapped this in "EaAuditProgram", can you show that part of the code? What's the issue you are having if it's not working?
 
sam bartl
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:
in order to have bidirectional relation in EaAuditProgram I have to map MultiProgramFinding twice...

How have you mapped this in "EaAuditProgram", can you show that part of the code? What's the issue you are having if it's not working?


I haven't mapped yet and I dont have any issue, what I am asking is whether it is nice desing to map an entity twice in other entity in mycase in eaAuditprogram I have to map MultiProgramFinding twice , I am asking suggestions if this can be done in a better way ?
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...what I am asking is whether it is nice desing to map an entity twice in other entity

If the business problem wants it that way or you cannot avoid it then you have no choice. But that may solely depends on the problem and the design you have.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic