Problema com inserção com Hibernate

0 respostas
T

Pessoal,

Aparece o seguinte erro quando tento inserir um registro na tabela usando o Hibernate:

2004-05-14 09:22:36,820 INFO [orcamento.action.CadastrarProjetoAction] - 

2004-05-14 09:22:36,930 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 195, SQLState: S1000>

2004-05-14 09:22:36,930 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <SCOPE_IDENTITY is not a recognized function name.>

2004-05-14 09:22:36,930 WARN [net.sf.hibernate.util.JDBCExceptionReporter] - <SQL Error: 195, SQLState: S1000>

2004-05-14 09:22:36,930 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <SCOPE_IDENTITY is not a recognized function name.>

2004-05-14 09:22:36,930 ERROR [net.sf.hibernate.util.JDBCExceptionReporter] - <could not insert: [orcamento.base.Projativ]>

java.sql.SQLException: SCOPE_IDENTITY is not a recognized function name.

at net.sourceforge.jtds.jdbc.SqlMessage.toSQLException(Unknown Source)

at net.sourceforge.jtds.jdbc.SQLWarningChain.addOrReturn(Unknown Source)

at net.sourceforge.jtds.jdbc.Tds.submitProcedure(Unknown Source)

at net.sourceforge.jtds.jdbc.PreparedStatement_base.submitProcedure(Unknown Source)

at net.sourceforge.jtds.jdbc.PreparedStatement_base.execute(Unknown Source)

at net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(Unknown Source)

at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:205)

at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:508)

Aqui está o arquivo de configuração do Objecto de Persistência:

<?xml version=“1.0”?>

<!DOCTYPE hibernate-mapping PUBLIC

"-//Hibernate/Hibernate Mapping DTD//EN"

“<a href="http://hibernate.sourceforge.net/hibernate-mapping.dtd">http://hibernate.sourceforge.net/hibernate-mapping.dtd</a>”>

<hibernate-mapping>

<class name=“orcamento.base.Projativ” table=“Projativ”>



<generator class=“native”/>



<property name=“codigo” column=“Codigo”/>

<property name=“descricao” column=“Descricao”/>

<property name=“ano” column=“Ano”/>

<property name=“historico” column=“Historico”/>

<many-to-one name=“unidade” column=“IdUnidade”/>

</class>

</hibernate-mapping>

Tenho de resolver logo esse problema, eh urgente!!!

Obrigado, desde já.

Claudio Torcato.

Criado 14 de maio de 2004
Respostas 0
Participantes 1