org.hibernate.mapping.Property.isLazy() won't return true. Below is a mapping snippet, some java, and logging output .
Code:
<bag name="lazyAuctionsProperty"
lazy="true"
inverse="true"
cascade="save-update,lock">
<key column="seller"/>
<one-to-many class="AuctionItem"/>
</bag>
Code:
public String getFetchType(Property property) {
Value value = property.getValue();
String fetchType = importType( "javax.persistence.FetchType");
boolean lazy = false;
if ( property.isLazy() ) {
log.info(property.toString() + " is lazy");
return fetchType + "." + "LAZY";
}else {
log.info(property.toString() + " is eager");
return fetchType + "." + "EAGER";
}
}
Code:
INFO: org.hibernate.mapping.Property(lazyAuctionsProperty) is eager
hibernate.jar from JBossIDE-N200509280156-ALL build.