[ http://jira.andromda.org/browse/SPRING-139?page=history ]

Chad Brandon moved HIB-158 to SPRING-139:
-----------------------------------------

        Project: Spring Cartridge  (was: Hibernate Cartridge)
            Key: SPRING-139  (was: HIB-158)
        Version: 3.1
                     (was: 3.1)
    Fix Version: 3.2-RC1

> Use get() instead of find() w/HQL for DAO load()
> ------------------------------------------------
>
>          Key: SPRING-139
>          URL: http://jira.andromda.org/browse/SPRING-139
>      Project: Spring Cartridge
>         Type: Improvement
>     Versions: 3.1
>     Reporter: Jason Dillon
>     Assignee: Chad Brandon
>      Fix For: 3.2-RC1

>
> This relates to: http://galaxy.andromda.org/forum/viewtopic.php?p=8200
> ----
> he Spring dao that is generated for the entity has load method which uses HQL 
> for loading the entity. Would this implementation take into effect the lazy 
> loading parameters in the hibernate config files? As far as hibernate 
> documentation says, the lazy loading will not be considered when using HQL. 
> Why not just use the get(BusinessObject.class, id) implementation?
> ----
> To fix, in template/sprint/hibernate/SpringHibernateDaoBase.vsl change:
>         final java.util.List list = this.getHibernateTemplate().find(
>             "from $entity.fullyQualifiedEntityName as entity where 
> entity.$identifier.name = ?", $argument);
>         final Object entity = list != null && !list.isEmpty() ? 
> list.iterator().next() : null;
> to:
>         final Object entity = 
> this.getHibernateTemplate().get(${entity.fullyQualifiedEntityName}.class, 
> $identifier.name);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

Reply via email to