Skip to content

EntityTypeRepository

Stefan Meyer edited this page Jun 30, 2012 · 3 revisions

Types are managed by the EntityTypeRepository. It delegates its tasks to an ordered list of subrepositories. These instantiate the types. Implementations are:

  1. repository to manage types for Attribute and EntityType.
  2. JPA/hibernate repository
  3. jackson repository (JSON)
  4. Pojo repository (uses either java beans conventions or direct field access)
  5. [dynamic entities repository] (/stemey/atem.impl.github.com/wiki/Dynamic-Entities)(acts on instances of DynamicEntity)

These can be added to the entityRepository or they can be replaced by custom repository configuration:

<bean id="meta-entitytype-repository" class="...EntityTypeRepositorImpl">
 <property name="subrepositories">
  <list>
   <ref bean="meta-impl-entitytype-repository"/>
   <ref bean="meta-impl-attribute-repository"/>
   <ref bean="meta-impl-hibernate3-repository"/>
   <ref bean="meta-impl-pojo-repository"/>
  </list>
 </property>
</bean>

be careful about the order. The PojRepository can manage any Java type. So it should go to the end of the list. The first two repositories are responsible for creating entity types for EntityType.class and Attribute.class. They can go first beacause they are restricted to just a few special classes.