Amit,
here's what you mappings should look like:
Code:
<!-- bi-directional one-to-one association to CustomerInfo -->
<one-to-one
name="CustomerInfo"
property-ref="user"
cascade="all"
lazy="proxy"
constrained="true"
/>
<!-- bi-directional one-to-one association to User -->
<many-to-one
name="user"
column="user_id"
unique="true"
not-null="true"
lazy="proxy"
/>
</hibernate-mapping>
Note that on CustomerInfo, we have declared lazy="proxy" (which is equivilent to the old lazy="true") and constrained="true". The attribute lay="no-proxy" only works if you use bytecode instrumentation. If you don't know what I mean, then you're probably not using it. The constrained attribute is also important as if it is set to false, proxying is impossible, and this the association is always eagerly loaded.
Although jbuswell suggested using fetch="join", this will not solve your problem. When you use fect="join", you effectively disable lazy-loading as the entities are loading 2 objects in one SQL call. You should use the default fetch mode of select.
Ryan-