Addon spring descriptor

Addons must have an addon-applicationProperties.xml spring descriptor.

Hibernate DAOS should be declared as the next example states. They can reference any bean present at the Soffid console, including sessionFactory. It's advisable to use two global interceptors:

<!-- ========================= HIBERNATE DAOs ========================= -->
<!-- SampleEntity DAO -->
<bean id="sampleEntityDao" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="target">
        <bean class="com.soffid.iam.addons.sample.model.SampleEntityDaoImpl">
            <property name="sessionFactory"><ref bean="sessionFactory"/></property>
        </bean>
    </property>
    <property name="proxyInterfaces">
        <value>com.soffid.iam.addons.sample.model.SampleEntityDao</value>
    </property>
    <property name="interceptorNames">
        <list>
            <value>hibernateInterceptor</value>
            <value>daoInterceptor-*</value>
        </list>
    </property>
</bean>

Spring services should be declared as the next example states. They can reference any bean present at Soffid console. It's advisable to use the global interceptors:

<!-- sampleService Service Proxy with inner sampleService Service Implementation -->
<bean id="sampleService" class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="target">
        <bean class="com.soffid.iam.addons.sample.service.SampleServiceImpl">
        </bean>
    </property>
    <property name="proxyInterfaces">
        <value>com.soffid.iam.addons.sample.service.ReplicaBootService</value>
    </property>
    <property name="interceptorNames">
        <list>
            <value>serviceTransactionInterceptor</value>
            <value>hibernateInterceptor</value>
            <value>serviceInterceptor-*</value>
        </list>
    </property>
</bean>

Finally, the hibernate mapping resources should be listed at a special bean, just like the following example:

<!-- ========================= HIBERNATE PROPERTIES ========================= -->
<bean id="hibernate-addon-replica" class="es.caib.seycon.ng.spring.AddonHibernateBean">
    <property name="mappingResources">
    	<list>
        	<value>com/soffid/iam/addons/sample/model/SampleEntity.hbm.xml</value>
        </list>
	</property>
</bean>

 


Revision #2
Created 1 June 2021 06:54:23 by pgarcia@soffid.com
Updated 1 June 2021 09:31:45 by pgarcia@soffid.com