Skip to content

Commit

Permalink
N+1 Select issue in Concept subentities - TRUNK-4209
Browse files Browse the repository at this point in the history
  • Loading branch information
dkayiwa committed Jan 7, 2014
1 parent 647066c commit 6da02d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -51,34 +51,34 @@
<column name="datatype_id" />
</many-to-one>

<set name="names" lazy="true" cascade="all-delete-orphan,evict" inverse="true" access="field">
<set name="names" lazy="true" cascade="all-delete-orphan,evict" inverse="true" access="field" batch-size="25">
<key column="concept_id" not-null="true" />
<one-to-many class="ConceptName" />
</set>

<set name="descriptions" lazy="true" inverse="true" cascade="all"
order-by="concept_description_id">
order-by="concept_description_id" batch-size="25">
<key column="concept_id" />
<one-to-many class="ConceptDescription" />
</set>

<set name="answers" lazy="true" cascade="all,delete-orphan"
table="concept_answer" order-by="sort_weight asc, concept_answer_id asc" access="field" inverse="true">
table="concept_answer" order-by="sort_weight asc, concept_answer_id asc" access="field" inverse="true" batch-size="25">
<key column="concept_id" not-null="true" />
<one-to-many class="ConceptAnswer"/>
</set>

<!-- This will need to be changed to lazy="false" if we ever have a subobject that would need to store/load this
(Right now, ConceptNumerics, ConceptComplex, and ConceptDerived objects do not have child concepts (aka, are not sets) -->
<set name="conceptSets" table="concept_set" lazy="true"
cascade="all,delete-orphan" order-by="sort_weight asc" inverse="true">
cascade="all,delete-orphan" order-by="sort_weight asc" inverse="true" batch-size="25">
<key not-null="true">
<column name="concept_set" />
</key>
<one-to-many class="ConceptSet"/>
</set>

<set name="conceptMappings" inverse="true" cascade="all,delete-orphan,evict">
<set name="conceptMappings" inverse="true" cascade="all,delete-orphan,evict" batch-size="25">
<key column="concept_id" not-null="true" />
<one-to-many class="ConceptMap" />
</set>
Expand Down
Expand Up @@ -4,7 +4,7 @@
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.openmrs">

<class name="ConceptSet" table="concept_set">
<class name="ConceptSet" table="concept_set" batch-size="25">

<id name="conceptSetId" type="java.lang.Integer" column="concept_set_id">
<generator class="native">
Expand Down

0 comments on commit 6da02d9

Please sign in to comment.