I am using hibernate Version 3.2.5 i have a HQL like this: select new org.com.Utilities.Inventario.ReporteInventario(P.Id,P.Name,DP.Rotacion,LongResult,IntegerResult,IntegerResult,IntegerResult,IntegerResult,IntegerResult,IntegerResult) and i have a constructor in this way: public ReporteInventario(String CodPro,String NomProd,String RotProd,Long TotalStock,Integer Val1,Integer Val2, Integer Val3,Integer Val4,Integer Val5,Integer Val6) works OK. But i have tried the following:
public ReporteInventario(String CodPro,String NomProd,String RotProd,Long TotalStock,Integer.. VarArgs) But i'm receiving not Compliant Constructor found. i am not big fan of verbosity. my question is can i use Varargs in my Constructor whose Hibernate can populate. why hibernate not populate my Constructor why do not detect a list of integers and populate as VarArgs. i also have try. as a list. Select new org.com.Utilities.Inventario.ReporteInventario(P.Id,P.Name,DP.Rotacion,(Select sum(DP.Stock) from DP where P.Id=DP.Producto.Id),new list((Select DP.Stock as Stock0 from DP where P.Id=DP.Producto.Id And DP.Sucursal.Id=1200),(Select DP.Stock as Stock1 from DP where P.Id=DP.Producto.Id And DP.Sucursal.Id=1300))) but is giving error on new list. my question is to avoid verbosity how can i use a constructor avoiding to coding the constructor Select new org.com.Utilities.Inventario.ReporteInventario(P.Id,P.Name,DP.Rotacion,(Select sum(DP.Stock) from DP where P.Id=DP.Producto.Id,Integer,Integer,Integer,Integer,Integer) thanks a lot sorry by my poor english.
|