Hello guys i have this situation
first this method
and i have this codevoid evict(Object entity)
Remove the given object from the Session cache.
the method is public,Code:public CabeceraComprobanteVenta getCabeceraComprobanteVentaByDocumentoandIdClienteWithEvictDAO( String numComprobanteVenta, String idCliente)throws MyGlobalException{ List<Object> list = new ArrayList<Object>(); CabeceraComprobanteVenta cabeceraComprobanteVenta = null; try{ list = (List) getHibernateTemplate().findByNamedParam( "FROM CabeceraComprobanteVenta cv WHERE " + " cv.numComprobanteVenta=:numComprobanteVenta", new String[]{"numComprobanteVenta"}, new Object[]{numComprobanteVenta}); if(list.isEmpty()) return null; cabeceraComprobanteVenta = (CabeceraComprobanteVenta) list.get(0); getHibernateTemplate().evict(cabeceraComprobanteVenta); } catch(DataAccessException dae){ logger.info("\n DataAccessException \n "+dae.getMessage()+"\n"); throw new MyGlobalException(); } return cabeceraComprobanteVenta;
(used for swf to avoid some problems when i update some object in some state)
i want to make this method private to reuse the query of hibernate
for instance called
reUseGetCabeceraComprobanteVentaByDocumentoandIdCl iente
the solution need it is
that many DAO method call the re used method reUseGetCabeceraComprobanteVentaByDocumentoandIdCl iente
like
andCode:Method A CabeceraComprobanteVenta cabeceraComprobanteVenta = this.reUseGetCabeceraComprobanteVentaByDocumentoandIdCliente(....)
but if you see the variable is returned with evict situation for both methodsCode:Method B CabeceraComprobanteVenta cabeceraComprobanteVenta = this.reUseGetCabeceraComprobanteVentaByDocumentoandIdCliente(....) //ALFA CODE
Method A, B
for Method B which line i need to write in "ALFA CODE" to
give again a object to the Session cache.???
i see in the api in
http://static.springframework.org/sp...va.lang.Object)
but nothing related to resolve this
thanks in advanced


Reply With Quote