Note that there are some explanatory texts on larger screens.

plurals
  1. PONHibernate retrieve more than one tables records
    primarykey
    data
    text
    <p>I am new in NHibernate.i am facing problem with nhibernate when i hit query on main table it gives me main table records but as well as it is also giving me related linked object tables records.So because of this more sql query hit on database. which decrease performance of my query.i want only main table records and not fired any other query from database.</p> <p><strong>I want TAPVendor table records only</strong></p> <p>Below is my C# code from where i am fired query from database</p> <p>var lstTAPVendor = session.Query&lt; TAPVendor >()</p> <p>i have also attached the .hbm file of tapvendor</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;hibernate-mapping namespace="M3.Entities" assembly="M3.Entities" xmlns="urn:nhibernate-mapping-2.2"&gt; &lt;class name="TAPVendor" table="tAPVendor" schema="dbo"&gt; &lt;id name="FVendorID" type="Guid"&gt; &lt;generator class="assigned" /&gt; &lt;/id&gt; &lt;version name="FTimestamp" generated="always" unsaved-value="null" type="BinaryBlob"&gt; &lt;column name="FTimestamp" not-null="true" sql-type="timestamp"/&gt; &lt;/version&gt; &lt;property name="FActive" type="Boolean" not-null="true" /&gt; &lt;property name="FTermsType" type="Int32" precision="10" not-null="true" /&gt; &lt;property name="FACHPayment" type="Boolean" not-null="true" /&gt; &lt;property name="FCompanyName" type="String" length="50" not-null="true" /&gt; &lt;property name="FAccrueUseTax" type="Boolean" not-null="true" /&gt; &lt;property name="FSinglePaymentVendor" type="Boolean" not-null="true" /&gt; &lt;property name="FACHEnabled" type="Boolean" not-null="true" /&gt; &lt;property name="FCheckPerInvoice" type="Boolean" not-null="true" /&gt; &lt;property name="FBankAccountType" type="Int32" precision="10" not-null="true" /&gt; &lt;property name="FBankAccountName" type="String" length="50" /&gt; &lt;property name="FBankAccountNumber" type="String" length="50" /&gt; &lt;property name="FBankABANumber" type="String" length="50" /&gt; &lt;property name="FLegalName" type="String" length="50" /&gt; &lt;property name="FDateAdded" type="DateTime" /&gt; &lt;property name="FAddedBy" type="String" length="50" /&gt; &lt;property name="FDateModified" type="DateTime" /&gt; &lt;property name="FModifiedBy" type="String" length="50" /&gt; &lt;property name="FAccountNo" type="Double" precision="53" /&gt; &lt;property name="FDescription" type="String" length="100" /&gt; &lt;property name="FTerms" type="Int32" precision="10" /&gt; &lt;property name="F1099Box" type="Int16" precision="5" /&gt; &lt;property name="F1099Type" type="String" length="15" /&gt; &lt;property name="FTaxID" type="String" length="10" /&gt; &lt;property name="FSSN" type="String" length="11" /&gt; &lt;property name="FVendorNo" type="String" length="10" /&gt; &lt;property name="FAccountNo2" type="Double" precision="53" not-null="false" /&gt; &lt;property name="FIsUseAccountNo2" type="Boolean" not-null="true" /&gt; &lt;many-to-one name="TAddres" class="TAddres" column="fAddressID" /&gt; &lt;many-to-one name="TSCCompany" class="TSCCompany" column="fCompanyID" /&gt; &lt;many-to-one name="TContact" class="TContact" column="fContactID" /&gt; &lt;many-to-one name="TSCEnterprise" class="TSCEnterprise" column="fEnterpriseID" /&gt; &lt;many-to-one name="TSCProperty" class="TSCProperty" column="fPropertyID" /&gt; &lt;set name="TAPInvoices" table="tAPInvoice" inverse="true"&gt; &lt;key column="fVendorID" /&gt; &lt;one-to-many class="TAPInvoice" /&gt; &lt;/set&gt; &lt;set name="TBAChecks" table="tBACheck" inverse="true"&gt; &lt;key column="fVendorID" /&gt; &lt;one-to-many class="TBACheck" /&gt; &lt;/set&gt; &lt;set name="TAPRecurringInvoices" table="tAPRecurringInvoice" inverse="true"&gt; &lt;key column="fVendorID" /&gt; &lt;one-to-many class="TAPRecurringInvoice" /&gt; &lt;/set&gt; &lt;set name="TGLPostMasters" table="tGLPostMaster" inverse="true"&gt; &lt;key column="fVendorID" /&gt; &lt;one-to-many class="TGLPostMaster" /&gt; &lt;/set&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload