Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bidirectional ManyToOne: Issue with SelfAssociation #293

Closed
mevivs opened this issue Jun 11, 2013 · 5 comments
Closed

Bidirectional ManyToOne: Issue with SelfAssociation #293

mevivs opened this issue Jun 11, 2013 · 5 comments

Comments

@mevivs
Copy link
Collaborator

mevivs commented Jun 11, 2013

Entity:

@Table(name = "groups", schema = "KunderaExamples@secIdxCassandraTest")
@IndexCollection(columns = {@Index(name = "resourceId")})
public class Group {

   @Id
   @Column(name = "resourceId")
    private String resourceId;

@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "resourceId")
private Group parent;

@OneToMany(fetch = FetchType.EAGER, mappedBy = "parent")
    private List<Group> children;

@Column(name= "resourceName")
   private String resourceName;

Failing for fetching an entity object having parent object but no children.

Error produced is:

Caused by: java.lang.IllegalArgumentException: Can not set java.util.List field com.test.Group.children to com.test.Group
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:164)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:168)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:680)
at com.impetus.kundera.property.PropertyAccessorHelper.set(PropertyAccessorHelper.java:100)
... 46 more

-Vivek

@joaonlima
Copy link

Do you think this will be on 2.6 ?

@mevivs
Copy link
Collaborator Author

mevivs commented Jun 12, 2013

Yes. I am working on it. BTW 2.6 will be releasing in next 10 days.

-Vivek

mevivs added a commit that referenced this issue Jun 21, 2013
Refactored association handling.
mevivs added a commit that referenced this issue Jun 21, 2013
@mevivs
Copy link
Collaborator Author

mevivs commented Jun 21, 2013

A Fix has been added for this. Please verify with latest trunk. Will be releasing with latest trunk.

-Vivek

mevivs added a commit that referenced this issue Jun 22, 2013
Changes made:
1. Fixes test cases for lazy/eager fetching.
2. Added fix for proxy check over java assist instances.
3. Modified Schema configuration.java for export schema only after table infos for all persistence units are loaded.
4. Corrected javassist maven dependency.
mevivs added a commit that referenced this issue Jun 26, 2013
mevivs added a commit that referenced this issue Jun 26, 2013
@joaonlima
Copy link

Thanks!
Unfortunately, I'm unable to give it a try for a while, sorry. But whenever possible I will try and post the results!

@mevivs
Copy link
Collaborator Author

mevivs commented Jul 6, 2013

Fixed and releasing with 2.6. Please verify.
-Vivek

@mevivs mevivs closed this as completed Jul 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants