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"
“http://hibernate.sourceforge.net/hibernate-mapping.dtd”>
<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.