- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI am running a following statement in hibernate:
somelist = session.find("from Rfq rfq order by rfq.po.poDate asc where rfq.po.buyerCode='GAK'");
Instead of generating one line for this select I am getting a few dozen of lines of sql from hibernate:
The first one makes sense:
Hibernate: select rfq0_.RFQ_ID as RFQ_ID, rfq0_.ISSUED_BY as ISSUED_BY, rfq0_.RELEASE_DATE as RELEASE_3_, rfq0_.BID_CLOSE_DATE as BID_CLOS4_, rfq0_.TAX_INFORMATION as TAX_INFO5_, rfq0_.FOB as FOB, rfq0_.SPECIAL_INSTRUCTIONS
And then a few dozen times of:
Hibernate: select po0_.PO_ID as PO_ID0_, po0_.PARENT_PO_ID as PARENT_P2_0_, po0_.PO_NUMBER as PO_NUMBER0_, po0_.CHANGE_ORDER_SEQ as CHANGE_O4_0_, po0_.SOURCE as SOURCE0_, po0_.PO_DATE as PO_DATE0_, po0_.LOAD_DATE as LOAD_DATE0_, po0_.FILENAME as FILENAME0_, po0_.LOAD_INFO as LOAD_INFO0_, po0_.CREATOR as CREATOR0_, po0_.SUPPLIER_NAME as SUPPLIE11_0_, po0_.SUPPLIER_NUMBER as SUPPLIE12_0_, po0_.BUYER_CODE as BUYER_CODE0_, po0_.BUYER_DEPT as BUYER_DEPT0_, po0_.CONTRACT as CONTRACT0_, po0_.ACTIVE as ACTIVE0_, po0_.PO_TYPE_ID as PO_TYPE_ID0_ from PO_LIST po0_ where po0_.PO_ID=?
Here are the relevant mapping files:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourcefo
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Mon Mar 21 14:36:39 CST 2005 -->
<hibernate-mapping package="com.talisen.lbweb
<class name="Po" table="PO_LIST" where="SOURCE != 'WEBPO - IDS' AND active = 1">
<id name="poId" column="PO_ID" type="integer">
<generator class="native"/>
</id>
<property name="parentPoId" column="PARENT_PO_ID" type="integer" />
<property name="poNumber" column="PO_NUMBER" type="string" not-null="true" />
<property name="changeOrderSeq" column="CHANGE_ORDER_SEQ" type="string" />
<property name="source" column="SOURCE" type="string" not-null="true" />
<property name="poDate" column="PO_DATE" type="date" not-null="true" />
<property name="loadDate" column="LOAD_DATE" type="date" not-null="true" />
<property name="filename" column="FILENAME" type="string" not-null="true" />
<property name="loadInfo" column="LOAD_INFO" type="string" />
<property name="creator" column="CREATOR" type="string" />
<property name="supplierName" column="SUPPLIER_NAME" type="string" />
<property name="supplierNumber" column="SUPPLIER_NUMBER" type="integer" />
<property name="buyerCode" column="BUYER_CODE" type="string" />
<property name="buyerDept" column="BUYER_DEPT" type="string" />
<property name="contract" column="CONTRACT" type="string" />
<property name="active" column="ACTIVE" type="byte" not-null="true" />
<property name="poTypeId" column="PO_TYPE_ID" type="integer" not-null="true"/>
</class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourcefo
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Sun Mar 20 20:16:12 CST 2005 -->
<hibernate-mapping package="com.talisen.lbweb
<class name="Rfq" table="RFQ_TABLE">
<id name="rfqId" column="RFQ_ID" type="integer">
<generator class="native" />
</id>
<property name="issuedBy" column="ISSUED_BY" type="integer" />
<property name="releaseDate" column="RELEASE_DATE" type="date" />
<property name="bidCloseDate" column="BID_CLOSE_DATE" type="date" />
<property name="taxInformation" column="TAX_INFORMATION" type="string" />
<property name="fob" column="FOB" type="string" />
<property name="specialInstructions"
<property name="rfqConstant" column="RFQ_CONSTANT" type="string" />
<property name="rfqBuyerCode" column="RFQ_BUYER_CODE" type="string" />
<property name="rfqBluesCode" column="RFQ_BLUES_CODE" type="string" />
<property name="rfqSeqRevisionNumber
<property name="rfqStatus" column="RFQ_STATUS" type="string" />
<property name="poId" column="PO_ID" type="integer"/>
<property name="incrementalPriceQuot
<many-to-one name="po" column="PO_ID" class="Po" not-null="true" insert="false" update="false"/>
</class>
</hibernate-mapping>
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership