ch.elca.el4j.services.persistence.generic.dao
Annotation Type AutocollectedGenericDao


@Target(value=TYPE)
@Retention(value=RUNTIME)
@Documented
@Component
public @interface AutocollectedGenericDao

Indicates that a GenericDao implementation should be added as singleton bean to spring (and in a second step (by the @link DefaultDaoRegistry) to the DAO Registry). You can indicate as parameter the desired id for the spring bean. Requires config that looks something like the following (see sample for more details):

  1) collect GenericDao implementations with this annotation 
<!-- This section scans for DAOs annotated with @AutocollectedGenericDao that should be added to the spring application context (as beans). Later, the DAO Registry automatically collects these DAOs. --> <!-- The attribute base-packages indicates the packages where we look for DAOs --> <context:component-scan use-default-filters="false" annotation-config="false" base-package="ch.elca.el4j.apps.keyword.dao, ch.elca.el4j.apps.refdb.dao"> <context:include-filter type="annotation" expression="ch.elca.el4j.services.persistence.generic.dao.AutocollectedGenericDao" /> </context:component-scan> 2) set up dao registry
<!-- Allows to register DAOs. Automatically collects all GenericDaos from the application context --> <bean id="daoRegistry" class="ch.elca.el4j.services.persistence.generic.dao.impl.DefaultDaoRegistry"/> 3) init the session factory on the DAOs
<!-- Inits the session factory in all the GenericDaos registered in the spring application context--> <bean id="injectionPostProcessor" class="ch.elca.el4j.services.persistence.hibernate.dao.HibernateSessionFactoryInjectorBeanPostProcessor" />

Author:
Philipp Oser (POS)
File-location:
AutocollectedGenericDao
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Optional Element Summary
 String value
          The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
 

value

public abstract String value
The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.

Returns:
the suggested component name, if any
Default:
""


Copyright © 2005-2011 ELCA. All Rights Reserved.