@alinmihaila99, I’m not sure there exists any work done for such use case. Basically you want to leverage the annotation @Inheritance(strategy = InheritanceType.JOINED) on the Order entity and going ahead to annotate the subclasses with @Entity then annotating the rest of the domains’ properties accordingly.
Hi @ruhanga, I tried to run ValidateHibernateMappingsDatabaseIT from IntellIJ and this time it failed for class ProgramWorkflowState, I don’t know why when I ran the commmand in terminal it passed. The error message was:
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [date_retired] in table [program_workflow_state]
Hi @ruhanga, I tried to use @Override and @Transient to resolve the missing columns for the class CohortMembership but I still have the missing columns error. This is what I tried to do. Is it something I miss?
And one more question @ruhanga . ConceptReferenceTermMap and ConceptMap both extends ConceptBaseMap and in their mapping there is the mapping for the superclass, but there are some columns that are different. How should I annotate the class ConceptBaseMap? Should I use @AttributeOverride to override the column that is not the same as in ConceptMap?
Hoping that you are referring to BaseConceptMap yes. You will want to do something along the following lines, where in the end you’d annotate the common fields in the base class and where necessary override them in the subclasses:
@MappedSuperclass
public abstract class BaseConceptMap extends BaseOpenmrsObject implements Auditable {
....
....
}
and
@Entity
@Table(..)
// Where necessary: @AttributeOverride(...)
public class ConceptReferenceTermMap extends BaseConceptMap {
....
}
@Entity
@Table(..)
// Where necessary: @AttributeOverride(...)
public class ConceptMap extends BaseConceptMap {
....
}
I’m not sure why BaseConceptMap was annotated like all the other BaseOpenmrs* @MappedSuperclasss.
Hi @ruhanga, I had a problem after removing the bin files from the PR’s. After doing this the security snyk failed. Here is one PR I talk about. Can you have a look, please?