Joined: Thu Oct 16, 2008 8:25 am Posts: 1 Location: pune, India
|
Hi Rodolfo Martín,
I am new to hibernate . Please help me to hibernatetool ant task.
Please provide me code for hibernatetool ant task.
Regards
Vasudevan T
[quote="rmg26"]Hi,
I've got an ORA-01424 error while reverse engineering an Oracle database with hibernatetool ant task.
The same configuration works OK with hsqldb.
Any Help would be appreciated.
Best Regards.
Rodolfo Martín.
[b]Hibernate version:[/b]
Hibernate tools 3.0.5 alpha4
[b]Mapping documents:[/b]
My build.xml:
[code]
<target name="hibernateTools" description="Generate .hbm.java from .hbm files.">
<taskdef
name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="lib.class.path"
/>
<hibernatetool destdir="${gen.dir}">
<!-- database settings are read from hibernate.cfg.xml and/or via propertyfile if provided -->
<jdbcconfiguration
packagename="${name}"
configurationfile="hibernate.cfg.xml"
revengfile="hibernate.reveng.xml"
/>
<cfg2hbm templatespath="${templates.dir}"/>
<hbm2java generics="true" templatespath="${templates.dir}"/>
<hbm2doc destdir="${doc.dir}"/>
</hibernatetool>
</target>
[/code]
The hibernate.cfg.xml content:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//hibernate/hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@myserver:mySID</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="show_sql">true</property>
<property name="transaction.factory_class">
org.hibernate.transaction.JDBCTransactionFactory
</property>
</session-factory>
</hibernate-configuration>
[/code]
My reveng file:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<type-mapping>
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
<sql-type jdbc-type="DOUBLE" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="true_false" />
</type-mapping>
</hibernate-reverse-engineering>
[/code]
[b]Full stack trace of any exception that occurs:[/b]
[code]
--- Nested Exception ---
org.hibernate.exception.GenericJDBCException: Reading from database
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:96)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:37)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:71)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:50)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:150)
at org.hibernate.tool.ant.GeneratorTask.configureExporter(GeneratorTask.java:74)
at org.hibernate.tool.ant.GeneratorTask.execute(GeneratorTask.java:32)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:115)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:386)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:106)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:242)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)
Caused by: java.sql.SQLException: ORA-01424: falta el carácter o no es válido a continuación del carácter de escape
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.fetch(TTC7Protocol.java:889)
at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1681)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1870)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:363)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:314)
at oracle.jdbc.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:2550)
at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:732)
at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:123)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
... 23 more
[/code]
[b]Name and version of the database you are using:[/b]
Oracle 8.1.6[/quote]
|
|