473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

one-to-one with property-ref always non-lazy

I have one-to-one relationship betnwee Product and ProductBasic.


<one-to-one name="productBasic" cascade="save-update" property-ref="activeProduct" lazy="proxy">
<formula>'1'</formula>
<formula>PRODUCTID</formula>
</one-to-one>


ProductBasic.hbm.xml as :
<properties name="activeProduct">
<property name="Code" column="CODE"></property>
<property name="pId" column="PID" insert="false" update="false"></property>
</properties>


When i am using property-ref, and try to load Product, it eagerly fetches ProductBasic also as :

select *
from PRODUCT productbo0_ left outer join PRODUCTPERIOD productbas1_ on '18'=productbas1_.CODE and productbo0_.PID=productbas1_.PID where productbo0_.PID=?

NOTE: Along with Product, ProductBasic is also fetched in a single query.

Even if i add constrained="true" in one-to-one mapping, the query gets fired as :
select * from PRODUCT productbo0_ where productbo0_.PID=?
select * from PRODUCTBASIC productbas0_ where productbas0_.CODE=? and productbas0_.PID=?

NOTE: Along with Product, ProductBasic is also fetched in a different query.

BUT in both these cases, ProductBasic is fetched always (non-lazy)..

How can i fetch ProductBasic in a Non-Lazy manner in this case.
Apr 30 '09 #1
4 2758
r035198x
13,262 8TB
How is all this related to Java?
Apr 30 '09 #2
This is a hibernate query...
I am new to bytes.com... If this is not the correct forum to put hibernate questions, then please let me know where can i post hibernate questions in bytes forum ?
Apr 30 '09 #3
r035198x
13,262 8TB
We don't have a hibernate forum here. Such questions are usually dumped in the Java forum so we can leave it here. You should however have indicated that in your first post because it is a crucial piece of information. I don't do hibernate so I can't help. Maybe someone else will be able to help.
My 2c is that you'd better find a dedicated hibernate forum and post the question there.
Apr 30 '09 #4
Lets see whether others can help me on this. I have also posted this question in all hibernate forums...
Apr 30 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Randell D. | last post by:
Folks, I test if my PHP should process form data by checking if $_POST is an array - However I always find its condition proves true - Why or alternatvily, what other method can one use to check...
2
by: db2group88 | last post by:
i would like to know when i create a table with identity column, should i used generated by default or generated as always. since when i create this table, i might copy some data from another table...
3
by: cody | last post by:
why foreach does always have to declare a new variable? I have to write foreach (int n in array){} but Iam not allowed to write: int n=0; foreach (n in array){}
14
by: Gidi | last post by:
Hi, For the last week, i'm looking for a way to make a TextBox always write in English (No matter what the OS default language is). i asked here few times but the answers i got didn't help me. i...
6
by: Tim::.. | last post by:
Can someone tell me why the value of my Boolean is always false! Even after I have declared that my variable iNews should equal TRUE it seems to remain false... Can some please explain why... ...
8
by: Peter | last post by:
Hi, there I have created an stored procedure using the DDL below for my MS Access Database and no error occurs. Also it can create an stored procedure if I changed the parameter from "" to...
8
by: arganx | last post by:
The conditional statement "if(j.... always executes regardless of what you enter. BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam) { char buffer=""; GetWindowText(hwnd,buffer,256);...
10
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is Null, the Nz function returns the number zero or a...
0
by: peter.bittner | last post by:
I have developed a Windows application in Visual Studio .NET 2003 and created a Setup project for it. In the File System Editor I have added a shortcut to the User's Desktop folder to point to the...
30
by: Brian | last post by:
I am using Borland C++ Builder 5 for my application. When I build my application, it states that I have several if-statements that will always be false. The statements appear correct, so could...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.