I have a simple question. I found this Hibernate config on our project:
<many-to-one name="employee"
class="com.myapp.Employee"
cascade="merge"
lazy="false"
fetch="select">
<column name="employee_id"
sql-type="bigint"
not-null="true"/>
</many-to-one>
Doesn't fetch="select" mean "Lazy load all the collections and entities" based on Fetching Strategies. But by writing lazy="false" mean do not lazy load. So the config above says: "Disable lazy loading. Enable lazy loading." In effect, this means the property is lazy loaded?
So I could shorten that config as:
<many-to-one name="employee"
class="com.myapp.Employee"
cascade="merge"
fetch="select">
<column name="employee_id"
sql-type="bigint"
not-null="true"/>
</many-to-one>
But isn't fetch="select" the default mode? So in effect, I can declare the same config as:
<many-to-one name="employee"
class="com.myapp.Employee"
cascade="merge">
<column name="employee_id"
sql-type="bigint"
not-null="true"/>
</many-to-one>
Am I correct? Wrong? Ideas? Thanks
If I want to enable lazy loading, I must add lazy="true" and remove lazy="false"?