rave-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Franklin, Matthew B." <mfrank...@mitre.org>
Subject RE: Question on the address property of Person class
Date Tue, 06 Dec 2011 20:17:50 GMT
>-----Original Message-----
>From: Ankur Goyal [mailto:asgoyal@umail.iu.edu]
>Sent: Tuesday, December 06, 2011 1:33 PM
>To: rave
>Subject: Question on the address property of Person class
>
>Hi,
>
>While I was going through the Person.java class file, I saw a property
>named addresses (type: List<Address>) which shows a one-to-many
>relationship with a join table person_address_jn.
>
>the code snippet looks like this:
>@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL,
>orphanRemoval = true)
>    @JoinTable(name = "person_address_jn",
>            joinColumns = @JoinColumn(name = "address_id",
>referencedColumnName = "entity_id"),
>            inverseJoinColumns = @JoinColumn(name="person_id",
>referencedColumnName = "entity_id"))
>    protected List<Address> addresses;
>
>So, I was wondering if the @JoinColumn(name = "*address_id*",
>referencedColumnName = "entity_id"), should have the name as
>*"person_id"*as the person class is the owning entity of the
>relationship and refers to
>the person's entity id and similarly the inverseJoinColumns name should be *
>"address_id"*?

That’s a bug.  I will create a ticket for it.  Thanks for reporting it.

-Matt

>*
>*
>Regards,
>Ankur Goyal* *
Mime
View raw message