Closed GoogleCodeExporter closed 9 years ago
Are the parent and the child instances pointing to the same instance?
Like this:
Class A {
@BusinessKey
private A parent;
}
And in Runtime you're doing:
A instance = new A();
instance.parent = instance;
instance.toString();
-- This would clearly create an infinite recursion as the Identity of
'instance' is dependent on evaluating 'instance'.
If the example above isn't what is going on, can you please attach a code
sample for the issue you're facing?
Thank you.
Original comment by oshou...@gmail.com
on 22 Sep 2013 at 6:28
Hi,
I belive this is not the case. I'll see if I can reproduce this error in a demo
project. However, this is the structure:
Class A:
@BusinessKey
@JoinColumn(name = "attribute", referencedColumnName = "attribute_name")
@ManyToOne(optional = false)
private B attribute;
@BusinessKey
@JoinColumn(name = "user_id", referencedColumnName = "id")
@ManyToOne(optional = false)
private C userId;
@BusinessKey
@JoinColumn(name = "service", referencedColumnName = "id")
@ManyToOne(optional = false)
private D service;
Class B:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "attribute")
private Collection<A> ACollection;
Class C:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "userId", orphanRemoval = true)
private Collection<A> ACollection;
Class D:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "service", orphanRemoval = true)
private Collection<A> ACollection;
best regards,
hw
Original comment by helge.wa...@gmail.com
on 29 Sep 2013 at 9:10
If Class A holds an entry to Class B, and Class B has Collection of Class A,
doesn't that create a cyclic infinite reference?
Can you please include the equals implementation for A, B, C and D?
I don't see BusinessKey in the B, C or D classes.
Original comment by oshou...@gmail.com
on 9 Oct 2013 at 3:39
Helge,
I haven't heard back from you with regards to this issue.
I am closing this issue as invalid for now, please feel free to comment or
include a sample to demonstrate the issue, if so, I'll re-open it.
Thank you for your continued interest in OpenPojo.
Original comment by oshou...@gmail.com
on 14 Mar 2014 at 8:49
Original issue reported on code.google.com by
helge.wa...@gmail.com
on 16 Sep 2013 at 8:35