Hi,
I have mapped file called Seller. It has 2 lazy many to one associations :
Code:
...
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "seller")
public Set<SellerSchedule> getSellerSchedules() {
return this.sellerSchedules;
}
public void setSellerSchedules(Set<SellerSchedule> sellerSchedules) {
this.sellerSchedules = sellerSchedules;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "seller")
public Set<AveaCashAuthorizationRequest> getAveaCashAuthorizationRequests() {
return this.aveaCashAuthorizationRequests;
}
public void setAveaCashAuthorizationRequests(
Set<AveaCashAuthorizationRequest> aveaCashAuthorizationRequests) {
this.aveaCashAuthorizationRequests = aveaCashAuthorizationRequests;
}
...
When i try to load seller ("select s from Seller s") it fetches lazy assoc "AveaCashAuthorizationRequests" not other association(SellerSchedules).
Here is the generated sqls:
Code:
Hibernate:
/* load com.orm.cws.Seller */ select
seller0_.Id as Id11_1_,
seller0_.Address as Address11_1_,
seller0_.BankAccount as BankAcco3_11_1_,
seller0_.CountyRecordNo as CountyRe4_11_1_,
seller0_.CreationDate as Creation5_11_1_,
seller0_.Email as Email11_1_,
seller0_.Fax as Fax11_1_,
seller0_.Name as Name11_1_,
seller0_.Note as Note11_1_,
seller0_.ObjectVersion as ObjectV10_11_1_,
seller0_.Password as Password11_1_,
seller0_.Phone1 as Phone12_11_1_,
seller0_.Phone2 as Phone13_11_1_,
seller0_.StatusRecordNo as StatusR18_11_1_,
seller0_.Stock as Stock11_1_,
seller0_.TaxNumber as TaxNumber11_1_,
seller0_.TaxOffice as TaxOffice11_1_,
seller0_.UserName as UserName11_1_,
aveacashau1_.SellerId as SellerId3_,
aveacashau1_.RecordNo as RecordNo3_,
aveacashau1_.RecordNo as RecordNo22_0_,
aveacashau1_.MIResRecordNo as MIResRec6_22_0_,
aveacashau1_.CashAuth as CashAuth22_0_,
aveacashau1_.RequestId as RequestId22_0_,
aveacashau1_.RequestTime as RequestT4_22_0_,
aveacashau1_.SellerId as SellerId22_0_,
aveacashau1_.Stan as Stan22_0_
from
CreditWebService.dbo.Seller seller0_
left outer join
CreditWebService.dbo.avea_CashAuthorizationRequest aveacashau1_
on seller0_.Id=aveacashau1_.SellerId
where
seller0_.Id=?
Why it tries to get "lazy" property?
Thanks.