ManyToMany mapping created when no mapping is specified [message #1032651] |
Wed, 03 April 2013 05:00  |
Eclipse User |
|
|
|
Hi,
In my Entity, when I don't specify the mapping for a collection attribute, by default ManyToMapping is created. Won't an exception be thrown in this case that the mapping is missing? Or is the default behavior to create ManyToMany mapping for collection attribute?
Eg:
public class Parent{
private List<Child> childList;
public List<Child> getChildList(){
return childList;
}
public void setChildList(List<Child> childList){
this.childList = childList;
}
}
The rational for not specifying the mapping is that, I would like to create OneToManyMapping programmatically in the session customizer pointing mappedBy to an entity whose reverse mapping is not known at static weaving time.
|
|
|
|
|
|
|
Re: ManyToMany mapping created when no mapping is specified [message #1042459 is a reply to message #1042450] |
Tue, 16 April 2013 09:14  |
Eclipse User |
|
|
|
Hi James,
Removing @Transient and remove existing mapping and add new mapping in the customizer works. Just wondering why it didn't work when the attribute is marked with @Transient (also tried by disabling eclipselink.weaving.internal). Just before the parent entity is persisted, if I get the server session and see the mapping for the child attribute, it is present (and with valid reference class). Is there a way to debug what/where the problem is?
Thanks,
Saravanan.
[Updated on: Tue, 16 April 2013 09:45] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06889 seconds