Hibernate version: 2.1.6
Mapping documents:
DocumentoCliente.hbm.xml
<hibernate-mapping>
<class name="com.br.resource.csu.lembranca.dao.hibernate.persisted.DocumentoCliente" table="REL_CLI_DOCTO">
<id name="codDoc" column="COD_DOC" type="integer">
<generator class="assigned"/>
</id>
<many-to-one name="codCli" column="COD_CLI"/>
<property name="vlrDoc" column="VLR_DOC"/>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
DocumentoCliente docCli = null;
try {
Query query = session.createQuery("from DocumentoCliente d where d.codCli = :codigoCliente"+
" and d.codDoc = :codigoDocumento");
query.setInteger("codigoCliente",codCli.intValue());
query.setString("codigoDocumento",codDoc);
docCli = (DocumentoCliente) query.uniqueResult();
} catch (HibernateException e) {
throw new DaoException(e.getMessage());
}
Full stack trace of any exception that occurs:
16:24:08,225 WARN [JDBCExceptionReporter] SQL Error: 904, SQLState: 42000
16:24:08,226 ERROR [JDBCExceptionReporter] ORA-00904: invalid column name
16:24:08,226 ERROR [JDBCExceptionReporter] Could not save object
java.sql.SQLException: ORA-00904: invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:543)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1405)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:643)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1674)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:18
70)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatemen
t.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement
.java:314)
at net.sf.hibernate.id.IncrementGenerator.getNext(IncrementGenerator.java:67)
at net.sf.hibernate.id.IncrementGenerator.generate(IncrementGenerator.java:42)
at net.sf.hibernate.impl.SessionImpl.saveWithGeneratedIdentifier(SessionImpl.java:
765)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:738)
at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1388)
at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:114)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:436)
at net.sf.hibernate.engine.Cascades.cascadeCollection(Cascades.java:526)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:452)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:503)
at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:482)
at net.sf.hibernate.impl.SessionImpl.preFlushEntities(SessionImpl.java:2673)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2250)
at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1805)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1568)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1533)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:550
)
at com.br.resource.csu.lembranca.dao.DocumentoClienteDao.findByCodCliCodDoc(Docume
ntoClienteDao.java:35)
at com.br.resource.csu.lembranca.fase1.Fase1FileProcessBean.inserirCliente(Fase1Fi
leProcessBean.java:347)
at com.br.resource.csu.lembranca.fase1.Fase1FileProcessBean.ProcessDataFase1(Fase1
FileProcessBean.java:157)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSe
ssionContainer.java:683)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedC
onnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessi
onInstanceInterceptor.java:72)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.ja
va:84)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.jav
a:315)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderIn
terceptor.java:122)
at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContaine
r.java:331)
at org.jboss.ejb.Container.invoke(Container.java:723)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.
java:359)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.
java:83)
at $Proxy570.ProcessDataFase1(Unknown Source)
at com.br.resource.csu.lembranca.jmx.LembrancaService.ImportFileFase1(LembrancaSer
vice.java:60)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
Name and version of the database you are using: Oracle 8.1.7
|