Instead of filepattern="{package-name}/{class-name}.xml", specify an explicit filename, e.g. filepattern="applicationContext-dao.xml". Your freemarker template must loop through the entities, e.g.
Code:
<#foreach entity in c2j.getPOJOIterator(cfg.getClassMappings())>
<bean id="${entity.shortName}DAO" class="com.test.EntityDaoImpl">
<property name="sessionFactory" ref="test_sessionFactory" />
<property name="pkPropertyName" value="${entity.identifierProperty.name}" />
<property name="persistentClass" value="entity.qualifiedDeclarationName" />
</#foreach>