-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
In single fetch running multiple select queries because of child mapping. #3615
Comments
@NandhaSaiS I had a similiar issue, can you provide the class definitions? |
Order Class:
OrderItem Class:
@rodrigo-web-developer hear the class. |
@NandhaSaiS, sorry, but your code results in compiling errors. What is the definition of TowerOrderItemMap class and what the definition of SubOrderItem class? I tried to figure out what is the definition of each class, but it has some props that I didnt know how to implement. |
SubOrderItem Class:
@rodrigo-web-developer, Sorry, I forgot to add. and I changed the mapping and model also. Can you recheck once? Before:
After:
If I change this, I'm getting two select statements only. Why? Do you have any idea about this? |
I am using NHibernate v5.4.9 and FluentNHibernate v3.4.0.
In this version, I am using batch fetching to improve performance.
Configuration:
Mapping:
OrderMap:
OrderItemMap:
Issue:
In this configuration, I am trying to retrieve all data in a single select statement (using batch fetching). However, while the order data is fetched in one select statement, each order item executes a separate select statement. Why are separate select statements being executed despite using batch size?. If there is any special reason for this one. If anyone knows, please let me know.
Why are the parent and child entities getting separate select statements?
This is the output in Profiler:
@hazzik @fabiomaulo @fredericDelaporte
The text was updated successfully, but these errors were encountered: