Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.8
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Sun Mar 20 19:57:16 CST 2005 -->
<hibernate-mapping package="com.talisen.lbwebpo.model">
<class name="RfqResponse" table="RFQ_SUPPLIER_TABLE">
<id name="rfqSupplierId" column="RFQ_SUPPLIER_ID" type="integer">
<generator class="native"/>
</id>
<property name="supplierId" column="SUPPLIER_ID" type="integer" not-null="true" />
<property name="respondedDate" column="RESPONDED_DATE" type="date" />
<property name="viewedDate" column="VIEWED_DATE" type="date" />
<property name="supplierNumber" column="SUPPLIER_NUMBER" type="integer" not-null="true" />
<many-to-one column="SUPPLIER_NUMBER" name="lbss" class="LBSSupplierCode" insert="false" update="false" cascade="save-update" unique="true"/>
<many-to-one name="rfq" column="RFQ_ID" class="Rfq" not-null="true" />
</class>
</hibernate-mapping>
---------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Mon Apr 04 17:50:16 CDT 2005 -->
<hibernate-mapping package="com.talisen.lbwebpo.model">
<class name="LBSSupplierCode"
table="LONG_BEACH_SITE_SUPPLIER_CODES">
<id name="siteSupplierCode" column="SITE_SUPPLIER_CODE"
type="string">
<generator class="native" />
</id>
<many-to-one name="organization" column="SBMS_SUPPLIER_CODE" class="Organization"/>
</class>
</hibernate-mapping>
----------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<!-- Created Tue Apr 05 10:31:28 CDT 2005 -->
<hibernate-mapping package="com.talisen.lbwebpo.model">
<class name="Organization" table="ORGANIZATION">
<id name="code" column="CODE" type="string">
<generator class="native" />
</id>
<property name="orgName" column="ORG_NAME" type="string"
not-null="true" />
<many-to-one name="lbss" property-ref="organization" class="LBSSupplierCode" unique="true"/>
</class>
</hibernate-mapping>
---------------------------------
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- by MyEclipse Hibernate tool integration. -->
<hibernate-configuration>
<session-factory>
<!-- properties -->
<property name="connection.username">webpo</property>
<property name="connection.url">jdbc:oracle:thin:@blah:1521:lgbapp</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.password">blah1</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="show_sql">false</property>
<!-- mapping files -->
<mapping resource="com/talisen/lbwebpo/model/RfqResponse.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/Rfq.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/Po.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/PoType.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/RfqRecepient.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/Organization.hbm.xml"/>
<mapping resource="com/talisen/lbwebpo/model/LBSSupplierCode.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
session.find(from RfqResponse);
Full stack trace of any exception that occurs:
testEverything(com.talisen.lbwebpo.dao.test)net.sf.hibernate.exception.SQLGrammarException: could not load: [com.talisen.lbwebpo.model.LBSSupplierCode#1404]
at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:69)
at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1332)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:418)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000)
at net.sf.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1962)
at net.sf.hibernate.type.ManyToOneType.resolveIdentifier(ManyToOneType.java:69)
at net.sf.hibernate.type.EntityType.resolveIdentifier(EntityType.java:204)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2218)
at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:315)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:305)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1553)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.talisen.lbwebpo.dao.test.testEverything(test.java:44)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.talisen.lbwebpo.dao.test.main(test.java:27)
Caused by: java.sql.SQLException: ORA-00904: "ORGANIZATI1_"."LBSS": invalid identifier
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:582)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:880)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2516)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2850)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:537)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:88)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:875)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:269)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415)
Name and version of the database you are using:
Oracle 9i
The generated SQL (show_sql=true):
Hibernate: select * from ( select rfqrespons0_.RFQ_SUPPLIER_ID as RFQ_SUPP1_, rfqrespons0_.SUPPLIER_ID as SUPPLIER2_, rfqrespons0_.RESPONDED_DATE as RESPONDE3_, rfqrespons0_.VIEWED_DATE as VIEWED_D4_, rfqrespons0_.SUPPLIER_NUMBER as SUPPLIER5_, rfqrespons0_.RFQ_ID as RFQ_ID from RFQ_SUPPLIER_TABLE rfqrespons0_ )
Hibernate: select lbssupplie0_.SITE_SUPPLIER_CODE as SITE_SUP1_1_, lbssupplie0_.SBMS_SUPPLIER_CODE as SBMS_SUP2_1_, organizati1_.CODE as CODE0_, organizati1_.ORG_NAME as ORG_NAME0_, organizati1_.lbss as lbss0_ from LONG_BEACH_SITE_SUPPLIER_CODES lbssupplie0_ left outer join ORGANIZATION organizati1_ on lbssupplie0_.SBMS_SUPPLIER_CODE=organizati1_.CODE where lbssupplie0_.SITE_SUPPLIER_CODE=?
Debug level Hibernate log excerpt:
Currently not available: I don't seem to be able to get my log4 j configured right.