From: Vance K. <va...@us...> - 2007-01-24 04:37:54
|
User: vancek Date: 07/01/23 20:37:55 Modified: andromda-ejb3/src/main/resources/templates/ejb3 DaoBase.vsl andromda-ejb3/src/site changes.xml Log: fix DAO injection into DAO base where entity references another entity Revision Changes Path 1.12 +12 -9 cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoBase.vsl Index: DaoBase.vsl =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/main/resources/templates/ejb3/DaoBase.vsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -r1.11 -r1.12 --- DaoBase.vsl 23 Jan 2007 01:24:13 -0000 1.11 +++ DaoBase.vsl 24 Jan 2007 04:37:55 -0000 1.12 @@ -69,17 +69,20 @@ protected org.hibernate.Session hibernateSession; #end -#foreach($entityRef in $entity.entityReferences) - private $entityRef.targetElement.fullyQualifiedDaoName $entityRef.daoName; +#set ($entityReferences = $entity.entityReferences) +#if (!$entityReferences.empty) + // ------ DAO Injections ------ +#**##foreach($entityRef in $entityReferences) /** - * Sets the reference to <code>$entityRef.daoName</code>. + * Inject DAO $entityRef.targetElement.fullyQualifiedDaoName */ - public void ${entityRef.daoSetterName}($entityRef.targetElement.fullyQualifiedDaoName $entityRef.daoName) - { - this.$entityRef.daoName = $entityRef.daoName; - } + @javax.ejb.EJB + protected $entityRef.targetElement.fullyQualifiedDaoName $entityRef.daoName; +#**##end +#end +#foreach($entityRef in $entityReferences) /** * Gets the reference to <code>$entityRef.daoName</code>. */ 1.4 +7 -0 cartridges/andromda-ejb3/src/site/changes.xml Index: changes.xml =================================================================== RCS file: /cvsroot/andromdaplugins/cartridges/andromda-ejb3/src/site/changes.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -r1.3 -r1.4 --- changes.xml 21 Jan 2007 04:17:40 -0000 1.3 +++ changes.xml 24 Jan 2007 04:37:55 -0000 1.4 @@ -347,6 +347,13 @@ Fix Entity - EntityVO conversion methods in the DAO base classes by adding the Converter template object to the cartridge.xml and the necessary namespace property to namespace.xml. </action> + <action dev="vancek" type="add"> + Inject org.hibernate.Session into DAO base class if hibernateExtensionEnabled is true. This can be used + to create Hibernate Search Criteria. + </action> + <action dev="vancek" type="fix"> + Fix DAO injection into DAO base when entity references another entity. + </action> </release> </body> </document> \ No newline at end of file |