[ http://jira.andromda.org/browse/SPRING-154?page=all ]
Paul Pavlidis updated SPRING-154:
---------------------------------
Attachment: patch.txt
> DAO methods that don't return Entities of the DAO
> -------------------------------------------------
>
> Key: SPRING-154
> URL: http://jira.andromda.org/browse/SPRING-154
> Project: Spring Cartridge
> Type: Improvement
> Versions: 3.2-RC1
> Reporter: Paul Pavlidis
> Assignee: Chad Brandon
> Attachments: patch.txt
>
> Use case; we want a method to return the size an associated collection
> without fetching the (large) collection. This is easily implemented in HQL
> for example (select count(...)) but AndroMDA doesn't seem to support adding
> methods to DAOs except for FinderMethods: they have to either return an
> Entity or a Collection of Entities. In this case the return type is an
> Integer but other appliations come to mind.
> The workaround is to
> 1) Set up the method as desired
> 2) Change the SpringHibernateDaoBase.vsl template to make the generated
> method compatible with the altered return type.
> A patch follows (which also fixes what is in my view a lurking bug: the cast
> should be to the return type of the finder, not to the entity type, to be
> more consistent)
> However, this abuses the <<FinderMethod>> stereotype and will probably break
> if the method returns a Collection that is then run through a transform
> callback (never tried this). If there's a better way....
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642