|
Re: Some Discriminator Values cause problem, while others do not [message #825207 is a reply to message #820175] |
Tue, 20 March 2012 15:52 |
|
I'm not sure that you can change the inheritance type in subclasses, so that could be the root of your issue.
You also cannot use @Inheritance in a @MappedSuperclass, so that doesn't make sense.
Also the @DiscriminatorColumn, @Table and @Inheritance can only be given in the root entity.
If this is working at all, my guess is that the @Inheritance in the @MappedSuperclass is being ignored.
Check that the indicator is correct in Summary, looks like you may have typed it in wrong.
James : Wiki : Book : Blog : Twitter
|
|
|
|
Re: [UPDATE] Some Discriminator Values cause problem, while others do not [message #826977 is a reply to message #825517] |
Thu, 22 March 2012 18:41 |
Matt Looman Messages: 3 Registered: March 2012 |
Junior Member |
|
|
I tried the following with the indicated results:
Change: Created new class, "ActivityGroup" to replace "Summary", including changing the Discriminator value.
Result: Same problem resulted for the rows that should have been allocated to the "ActivityGroup"
Change: Restored the "Summary" class. Changed the values for the underlying data rows to match the discriminator value for the "Plan" class. ("Plan" is the parent class of "Summary")
Result: This corrected the problem. For now, this is a viable workaround.
From the above, it would seem that the problem is in the "Summary" class definition. It's code is provided below.
package org.pims.data;
import java.sql.Date;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
/**
*
* @author mlooman
* @version 0.0
*
* CHANGES:
* Date Version Description
* -------------- ----------- ---------------------------------------------------
* Mar 22, 2012 0.0 Initial Implementation
*/
@Entity
@DiscriminatorValue("cc113aa4-742d-11e1-b5f9-00059a3c7a00")
public class Summary extends Plan {
//<editor-fold defaultstate="collapsed" desc="Constructors"
public Summary(){
super();
}
public Summary(String entityIdentifier){
super(entityIdentifier);
}
public Summary(String entityIdentifier, int planNumber, int activitySequenceInParentOrdinal, String planCurrentState, String planCurrentReason, Date planCreationTimestamp) {
super(entityIdentifier, planNumber, activitySequenceInParentOrdinal, planCurrentState, planCurrentReason, planCreationTimestamp);
}
//</editor-fold>
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.28245 seconds