This content has been marked as final.
Show 4 replies
-
1. Re: Discriminator-value while loading assocation
adamw May 13, 2009 3:00 AM (in response to amarsingh)Hello,
I assume that the association's target is to a subclass? If so, then it's a bug :)
Adam -
2. Re: Discriminator-value while loading assocation
pwojewodka Jun 23, 2009 3:28 AM (in response to amarsingh)Hi,
So that's a bug. Adam do you need any futher information?
Is there any temp solution for this issue?
I have SingleTable inheritance scenario:@Entity @Audited public abstract class A() {} @Entity @Audited public class B extends A() {} @Entity @Audited public class C extends A() {}
and class with association:@Entity @Audited public class D() { private A a; @OneToOne(cascade = {MERGE, PERSIST, REFRESH}, fetch = FetchType.EAGER) @Fetch(FetchMode.JOIN) @NotNull public getA() { return a; } }
In DB all is OK, but when I get audited D entity I get only access to A "interface" (what refer to first post) even though target and querries are getting representation of subclasses (B,C).
Any solution recomended? Thanks in advance!
best regards -
3. Re: Discriminator-value while loading assocation
pwojewodka Jun 23, 2009 3:30 AM (in response to amarsingh)Hi,
So that's a bug. Adam do you need any futher information?
Is there any temp solution for this issue?
I have SingleTable inheritance scenario:@Entity @Audited @DiscriminatorColumn(name = "type") public abstract class A() {} @Entity @Audited @DiscriminatorValue("B") public class B extends A() {} @Entity @Audited @DiscriminatorValue("C") public class C extends A() {}
and class with association:@Entity @Audited public class D() { private A a; @OneToOne(cascade = {MERGE, PERSIST, REFRESH}, fetch = FetchType.EAGER) @Fetch(FetchMode.JOIN) @NotNull public getA() { return a; } }
In DB all is OK, but when I get audited D entity I get only access to A "interface" (what refer to first post) even though target and querries are getting representation of subclasses (B,C).
Any solution recomended? Thanks in advance!
best regards -
4. Re: Discriminator-value while loading assocation
adamw Jun 23, 2009 7:24 AM (in response to amarsingh)Hello,
then please create a bug in Jira, preferrably with a testcase. You can also try looking at the source code, maybe you'll find a fix :)
Adam