*
The moose likes Object Relational Mapping and the fly likes help me with mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "help me with mapping" Watch "help me with mapping" New topic
Author

help me with mapping

sam bartl
Ranch Hand

Joined: Oct 29, 2010
Posts: 44
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

Joined: Mar 24, 2008
Posts: 3825

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?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
sam bartl
Ranch Hand

Joined: Oct 29, 2010
Posts: 44
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

Joined: Mar 24, 2008
Posts: 3825

...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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help me with mapping