Changes between Version 8 and Version 9 of VirtualCollectionRegistry


Ignore:
Timestamp:
08/25/14 13:26:09 (10 years ago)
Author:
Twan Goosen
Comment:

VCR core documentation

Legend:

Unmodified
Added
Removed
Modified
  • VirtualCollectionRegistry

    v8 v9  
    5656==== VCR core ====
    5757
    58 Persistence, service, Spring
     58The core of the VCR is the '''collection store''', which is implemented through JPA with annotated classes in the ''eu.clarin.cmdi.virtualcollectionregistry.model'' package. The [source:/VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/resources/META-INF/persistence.xml persistence.xml] file configures the Hibernate Persistence Provider to use a MySQL datasource for storage. The 'update' value of the ''hibernate.hbm2ddl.auto'' property instructs Hibernate to update the database schema at runtime if needed. A singleton object of the ''!DataStore'' class provides access to the JPA Entity Manager.
     59
     60The ''!DataStore'' is primarily used in the '''service''' implemented by the ''!VirtualCollectionRegistry'' class, which provides high level CRUD methods, using the ''!VirtualCollection'' model class for the representation of individual collections. These methods are used by the REST service, OAI provider and Wicket application classes to access and manipulate the stored collections.
     61
     62The '''Spring framework''' is used to define '''beans''' for singleton service objects, which are injected into various components throughout the application. The [source:/VirtualCollectionRegistry/trunk/VirtualCollectionRegistry/src/main/webapp/WEB-INF/applicationContext.xml applicationContext.xml] file bootstraps the bean definition, while most beans are discovered en constructed by means of 'component scanning'. For example, a singleton bean for ''!DataStore'' exists because it is annotated ''@Repository''. The instance is made available in the ''!VirtualCollectionRegistry'' and''Application'' (for the Wicket UI) instances because both are managed by Spring too (annotated with ''@Service'' and ''@Component'' respectively) and contain a ''!DataStore'' field annotated with ''@Autowired''.
     63
     64More info:
     65* [http://docs.oracle.com/javaee/6/tutorial/doc/bnbpz.html JPA introduction]
     66* [http://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do Hibernate hbm2ddl.auto (stackoverflow)]
     67* [http://www.mkyong.com/spring/spring-auto-scanning-components/ Spring component scanning and autowiring example and explanation]
    5968
    6069==== JAX-RS REST service ====