Greetings to all,
I need your help in the following (using hibernate 2.1)
i have an object Product that has the following relation to another object :
<many-to-one name="producttheme" class="net.db.ProductTheme" column="product_theme_id" />
I have created a simplified class ProductLight that has a number of constructors.
public ProductLight(Long id,String titlegr, String titleen, String image, float price, float discount, int active, net.db.ProductType producttype, net.db.ProductTheme producttheme,String code ) {
this.id=id;
this.titlegr = titlegr;
this.titleen = titleen;
this.image = image;
this.price = price;
this.discount = discount;
this.active = active;
this.producttype = producttype;
this.producttheme = producttheme;
this.code = code;
}
When i query it fetches only the products that the product_theme_id is not null. How can i overcome this problem, in order to fetch null product_themes as well ?
select new net.eshop.db.ProductLight(p.id,p.titlegr,p.titleen,p.image,
p.price,p.discount,p.active,p.producttype,p.producttheme,p.code)
from Product as p
Thanks in advance
L
|